From patchwork Fri Sep 14 12:57:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 1461631 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 2EE72DF264 for ; Sat, 15 Sep 2012 08:10:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0181E9E79D for ; Sat, 15 Sep 2012 01:10:47 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id CABF59E746 for ; Fri, 14 Sep 2012 05:57:13 -0700 (PDT) Received: by wgbdq11 with SMTP id dq11so553958wgb.12 for ; Fri, 14 Sep 2012 05:57:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=3n13h+BhCgZHHir2WhT/VrVBQcBqrtLH8olXRmIL8cE=; b=PX6rzhNDCVjyUgiuva8kGK3qIoO0ziioznfFMEhC+Z4oLSig9oPIFJjdsg4aWmLOij IunSViIo82K1s6xR0bbP6+zADBt0H6a3AbIwlPEPGhm/TBNH1Z3vskI+dbmBAH3hrEyP WgFAvON0fYBJppFgCehKh4bVK3LfzTVkExK1NRXC3UZZ0FpqkkploIuO1xYDizIFpTkP 7Q6d6H35qkE7wi7Muw3xufcQ8CLmB4hRTTBcwAxa1jvqxFxXaxURPvR4m4Q4kGoxL3iy 5c4NFpQNF17XJUOVxlNCObjJP7U8D3CKT/oGY27Rp8QtwQotp2MlrEG30o8pqJb4eZJ+ xc4Q== Received: by 10.216.198.145 with SMTP id v17mr984968wen.1.1347627432922; Fri, 14 Sep 2012 05:57:12 -0700 (PDT) Received: from localhost (host86-130-198-86.range86-130.btcentralplus.com. [86.130.198.86]) by mx.google.com with ESMTPS id o2sm3984457wiz.11.2012.09.14.05.57.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 05:57:10 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 563AC3E0DC9; Fri, 14 Sep 2012 13:57:08 +0100 (BST) From: Grant Likely To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] i915: Quirk out disconnected backlight Date: Fri, 14 Sep 2012 13:57:06 +0100 Message-Id: <1347627426-3813-1-git-send-email-grant.likely@secretlab.ca> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmYnC438yY54U0fKfnniKN2sZpxH7DF3tg6zHB7kEB1/F5fu6LRn+vNWbY7fEPhLdE/uHat X-Mailman-Approved-At: Sat, 15 Sep 2012 01:08:26 -0700 Cc: Grant Likely , Daniel Vetter , David Woodhouse , Matthew Garrett X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Some platforms (for instance MacbookPros) have custom backlight drivers and don't use the integrated i915 backlight control. This patch adds a quirk to disable registering the intel backlight when unused on a platform. Tested on MacbookPro8,3. Without this patch both the intel_backlight and gmux_backlight devices get registered and userspace doesn't know which it should use. Signed-off-by: Grant Likely Cc: Daniel Vetter Cc: David Airlie Cc: Matthew Garrett Cc: David Woodhouse --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ drivers/gpu/drm/i915/intel_panel.c | 3 +++ 3 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 627fe35..48860a0 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -349,6 +349,7 @@ enum intel_pch { #define QUIRK_PIPEA_FORCE (1<<0) #define QUIRK_LVDS_SSC_DISABLE (1<<1) #define QUIRK_INVERT_BRIGHTNESS (1<<2) +#define QUIRK_NO_BACKLIGHT (2<<2) 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 2dfa6cf..c8153cd 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -7088,6 +7088,13 @@ static void quirk_invert_brightness(struct drm_device *dev) DRM_INFO("applying inverted panel brightness quirk\n"); } +static void quirk_no_backlight(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + dev_priv->quirks |= QUIRK_NO_BACKLIGHT; + DRM_INFO("applying no backlight quirk\n"); +} + struct intel_quirk { int device; int subsystem_vendor; @@ -7123,6 +7130,9 @@ static struct intel_quirk intel_quirks[] = { /* Acer Aspire 5734Z must invert backlight brightness */ { 0x2a42, 0x1025, 0x0459, quirk_invert_brightness }, + + /* Apple MacbookPro8,3 doesn't have a backlight */ + { 0x0126, 0x106b, 0x00de, quirk_no_backlight }, }; static void intel_init_quirks(struct drm_device *dev) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 3df4f5f..f116e2a 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -413,6 +413,9 @@ int intel_panel_setup_backlight(struct drm_device *dev) struct backlight_properties props; struct drm_connector *connector; + if (dev_priv->quirks & QUIRK_NO_BACKLIGHT) + return 0; + intel_panel_init_backlight(dev); if (dev_priv->int_lvds_connector)