From patchwork Wed Sep 4 18:23:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 2853822 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 8B48F9F494 for ; Wed, 4 Sep 2013 18:24:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E0E12042C for ; Wed, 4 Sep 2013 18:24:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6C42620445 for ; Wed, 4 Sep 2013 18:24:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E3EAE6768 for ; Wed, 4 Sep 2013 11:24:10 -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 CBA20E64D0; Wed, 4 Sep 2013 11:24:00 -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 1VHHkE-0004nR-20; Wed, 04 Sep 2013 18:23:58 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1VHHkB-0002ry-US; Wed, 04 Sep 2013 11:23:55 -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: Wed, 4 Sep 2013 11:23:55 -0700 Message-Id: <1378319035-10997-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.1.2 Subject: [Intel-gfx] [PATCH] drm/i915: i915.quirks_set/quirks_mask overrides dmi match 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 Boot params quirks_set and quirks_mask allow the user to enable or inhibit any dmi-matched quirks, overriding the dmi match table. Examples: i915.quirks_set=0x2 - enables QUIRK_LVDS_SSC_DISABLE i915.quirks_set=0x8 - enables QUIRK_NO_PCH_PWM_ENABLE i915.quirks_mask=0x8 - disables QUIRK_NO_PCH_PWM_ENABLE i915.quirks_mask=0xFF - disables all quirks Signed-off-by: Kamal Mostafa Cc: stable@vger.kernel.org --- drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d88057e..a6af11c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10028,8 +10028,19 @@ static struct intel_quirk intel_quirks[] = { { 0x0166, 0x1028, 0x058b, quirk_no_pcm_pwm_enable }, }; +unsigned long i915_quirks_set __read_mostly = 0; +module_param_named(quirks_set, i915_quirks_set, ulong, 0600); +MODULE_PARM_DESC(quirks_set, + "Enable specified quirks bits."); + +unsigned long i915_quirks_mask __read_mostly = 0; +module_param_named(quirks_mask, i915_quirks_mask, ulong, 0600); +MODULE_PARM_DESC(quirks_mask, + "Disable specified quirks bits (override dmi match)."); + static void intel_init_quirks(struct drm_device *dev) { + struct drm_i915_private *dev_priv = dev->dev_private; struct pci_dev *d = dev->pdev; int i; @@ -10047,6 +10058,10 @@ 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); } + + /* handle user-specified quirks overrides */ + dev_priv->quirks |= i915_quirks_set; + dev_priv->quirks &= ~i915_quirks_mask; } /* Disable the VGA plane that we never use */