From patchwork Tue Sep 3 17:37:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 2853354 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 31CAC9F494 for ; Tue, 3 Sep 2013 17:37:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F08432041D for ; Tue, 3 Sep 2013 17:37:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E584E203F1 for ; Tue, 3 Sep 2013 17:37:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E024BE6D73 for ; Tue, 3 Sep 2013 10:37:51 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by gabe.freedesktop.org (Postfix) with ESMTP id D47A9E6736; Tue, 3 Sep 2013 10:37:38 -0700 (PDT) Received: from c-67-160-231-162.hsd1.ca.comcast.net ([67.160.231.162] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VGuXo-0007C0-Ig; Tue, 03 Sep 2013 17:37:36 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1VGuXm-0007aB-0L; Tue, 03 Sep 2013 10:37:34 -0700 From: Kamal Mostafa To: Daniel Vetter , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Tue, 3 Sep 2013 10:37:28 -0700 Message-Id: <1378229848-29113-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.1.2 Subject: [Intel-gfx] [PATCH] drm/i915: i915.disable_pch_pwm overrides PCH_PWM_ENABLE quirk X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=47941 Some BIOS configurations of Dell XPS13 are adversely affected by e85843b ("drm/i915: quirk no PCH_PWM_ENABLE for Dell XPS13 backlight") so provide a boot param to inhibit the quirk, or force it on. i915.disable_pch_pwm can be set to -1: auto (default; allows the disabling of pch_pwm by dmi quirk table match) 0: inhibits the disabling of pch_pwm (overrides dmi quirk table match) 1: forces the disabling of pch_pwm Signed-off-by: Kamal Mostafa --- drivers/gpu/drm/i915/i915_drv.c | 4 ++++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 11 ++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 72e2be7..fee05df 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -154,6 +154,10 @@ module_param_named(prefault_disable, i915_prefault_disable, bool, 0600); MODULE_PARM_DESC(prefault_disable, "Disable page prefaulting for pread/pwrite/reloc (default:false). For developers only."); +int i915_disable_pch_pwm __read_mostly = -1; +module_param_named(disable_pch_pwm, i915_disable_pch_pwm, int, 0600); +MODULE_PARM_DESC(disable_pch_pwm, "disable PCH_PWM (default: -1 (auto))"); + static struct drm_driver driver; extern int intel_agp_enabled; diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 769c138..e6f2a34 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1726,6 +1726,7 @@ extern bool i915_fastboot __read_mostly; extern int i915_enable_pc8 __read_mostly; extern int i915_pc8_timeout __read_mostly; extern bool i915_prefault_disable __read_mostly; +extern int i915_disable_pch_pwm __read_mostly; extern int i915_suspend(struct drm_device *dev, pm_message_t state); extern int i915_resume(struct drm_device *dev); diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 30e5946..86fa722 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9948,9 +9948,8 @@ static void quirk_invert_brightness(struct drm_device *dev) */ static void quirk_no_pcm_pwm_enable(struct drm_device *dev) { - struct drm_i915_private *dev_priv = dev->dev_private; - dev_priv->quirks |= QUIRK_NO_PCH_PWM_ENABLE; - DRM_INFO("applying no-PCH_PWM_ENABLE quirk\n"); + if (i915_disable_pch_pwm < 0) + i915_disable_pch_pwm = 1; } struct intel_quirk { @@ -10048,6 +10047,12 @@ static void intel_init_quirks(struct drm_device *dev) if (dmi_check_system(*intel_dmi_quirks[i].dmi_id_list) != 0) intel_dmi_quirks[i].hook(dev); } + + if (i915_disable_pch_pwm == 1) { + struct drm_i915_private *dev_priv = dev->dev_private; + dev_priv->quirks |= QUIRK_NO_PCH_PWM_ENABLE; + DRM_INFO("applying no-PCH_PWM_ENABLE quirk\n"); + } } /* Disable the VGA plane that we never use */