From patchwork Fri Sep 20 21:43:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2921721 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 97173BFF05 for ; Fri, 20 Sep 2013 21:46:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6F6F20461 for ; Fri, 20 Sep 2013 21:46:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BC85420399 for ; Fri, 20 Sep 2013 21:46:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8775E66FA for ; Fri, 20 Sep 2013 14:46:16 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BF73E6533 for ; Fri, 20 Sep 2013 14:43:33 -0700 (PDT) Received: by mail.bwidawsk.net (Postfix, from userid 5001) id EF03F59EF4; Fri, 20 Sep 2013 14:43:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lundgren.intel.com (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by mail.bwidawsk.net (Postfix) with ESMTPSA id B27705820A; Fri, 20 Sep 2013 14:43:29 -0700 (PDT) From: Ben Widawsky To: Intel GFX Date: Fri, 20 Sep 2013 14:43:17 -0700 Message-Id: <1379713397-8546-1-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 1.8.4 Cc: Daniel Vetter , Ben Widawsky , Ben Widawsky , Srinivas Pandruvada Subject: [Intel-gfx] [PATCH] drm/i915: Quirk to ignore VBT bpp 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-Virus-Scanned: ClamAV using ClamSMTP We've had several reports of an Asus Zenbook reporting an 18bpp eDP display, which then proceeds to not work. Using the default 24, work just fine. Since it appears this is somewhat common in the budding world of eDP, make a new quirk for it, and use it. This code has been changed several times. Amongst the most recent with the best history are: commit 57c219633275c7e7413f8bc7be250dc092887458 Author: Daniel Vetter Date: Thu Apr 4 17:19:37 2013 +0200 drm/i915: revert eDP bpp clamping code changes and commit af13188a1a6623fc8b4b6c42178046fb80f8b1d0 Author: Daniel Vetter Date: Tue Feb 19 17:45:00 2013 +0100 drm/i915: force bpp for eDP panels Reported-by: Srinivas Pandruvada CC: Adam Jackson CC: Daniel Vetter Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 12 ++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 8c52cbd..bc8ff0a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -672,6 +672,7 @@ enum intel_sbi_destination { #define QUIRK_LVDS_SSC_DISABLE (1<<1) #define QUIRK_INVERT_BRIGHTNESS (1<<2) #define QUIRK_NO_PCH_PWM_ENABLE (1<<3) +#define QUIRK_IGNORE_VBT_BPP (1<<4) struct intel_fbdev; struct intel_fbc_work; diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 8206ee7..c364377 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10139,6 +10139,15 @@ static void quirk_no_pcm_pwm_enable(struct drm_device *dev) DRM_INFO("applying no-PCH_PWM_ENABLE quirk\n"); } +/* Some machines (ux31a) advertise the panel should use 18bpp, but it lies. + */ +static void quirk_ignore_vbt_bpp(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + dev_priv->quirks |= QUIRK_IGNORE_VBT_BPP; + DRM_INFO("applying IGNORE_VBT_BPP quirk\n"); +} + struct intel_quirk { int device; int subsystem_vendor; @@ -10213,6 +10222,9 @@ static struct intel_quirk intel_quirks[] = { { 0x0116, 0x1028, 0x052e, quirk_no_pcm_pwm_enable }, /* Dell XPS13 HD and XPS13 FHD Ivy Bridge */ { 0x0166, 0x1028, 0x058b, quirk_no_pcm_pwm_enable }, + + /* Asus Zenbook UX31A Ivybridge eDP */ + { 0x0166, 0x1043, 0x1517, quirk_ignore_vbt_bpp }, }; static void intel_init_quirks(struct drm_device *dev) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 9770160..fd47be8 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -805,7 +805,9 @@ intel_dp_compute_config(struct intel_encoder *encoder, /* Walk through all bpp values. Luckily they're all nicely spaced with 2 * bpc in between. */ bpp = pipe_config->pipe_bpp; - if (is_edp(intel_dp) && dev_priv->vbt.edp_bpp) { + if (is_edp(intel_dp) && + dev_priv->vbt.edp_bpp && + (dev_priv->quirks & QUIRK_IGNORE_VBT_BPP) == 0) { DRM_DEBUG_KMS("clamping bpp for eDP panel to BIOS-provided %i\n", dev_priv->vbt.edp_bpp); bpp = min_t(int, bpp, dev_priv->vbt.edp_bpp);