From patchwork Sat Jul 14 14:57:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 1197871 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id C96D03FC4C for ; Sat, 14 Jul 2012 14:57:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 648A39E7A9 for ; Sat, 14 Jul 2012 07:57:28 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gg0-f177.google.com (mail-gg0-f177.google.com [209.85.161.177]) by gabe.freedesktop.org (Postfix) with ESMTP id B3F529E76A for ; Sat, 14 Jul 2012 07:57:00 -0700 (PDT) Received: by ggcs5 with SMTP id s5so4683315ggc.36 for ; Sat, 14 Jul 2012 07:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=zidJDAFws4paKYW9MJOzEPySDX/VfUlOPjLKAtVTmOo=; b=JqH4Xerwp3qD6lP0bZ+56sR4jk5eXqZmovxYa1guN/sjKJmCD4KKVSXufVIMaNgc4S TcjUxq0SF6Urn3JFYKBDyWGdrsk635sqCPZyCRxEqIxe/z3qIiIBQ1FV7/sY0vS2FNWX AOdNGM9ujUUCcKwnRl1/5cf/BBm2ZVf1242f6Hrj9hX/VU0V3zRXQbwz+T/rMKqOrYuH KpCqn8XBpoCoefSqN4XfN8BWzc/4aQrcoxefdwovNX5QS41TQy1shmY3z3cuUmnoMj4z H9blVMzhC1QnKEORCmB8REQB6o1111bRxv+CH0QNPITLzOFqOsBC5tbMk0X2oPOZiXZ7 K45g== Received: by 10.236.173.135 with SMTP id v7mr1958693yhl.19.1342277820497; Sat, 14 Jul 2012 07:57:00 -0700 (PDT) Received: from vicky.domain.invalid ([177.96.26.221]) by mx.google.com with ESMTPS id k23sm10022474ann.11.2012.07.14.07.56.58 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Jul 2012 07:56:59 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Sat, 14 Jul 2012 11:57:12 -0300 Message-Id: <1342277833-3694-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH] drm/i915: don't forget the PCH backlight registers 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 From: Paulo Zanoni When we enable/disable the CPU backlight registers we can't forget to enable/disable the PCH backlight registers. Since we're using the CPU registers we should also unset the override bit. Fixes a regression on the following commit: drm/i915: properly enable the blc controller on the right pipe The commit just deleted the code that sets the PCH registers, so it was relying on the values set by the BIOS. I told my BIOS to boot on the DVI monitor instead of the LVDS panel, so I noticed the bug. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_panel.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) I really think this patch fixes fd.o bug #51463. I'm waiting confirmation from the bug reporter. Also, I did not really do the git bisect: I understood it is a regression from that commit just by reading the commit (and by the fact that backlight used to work until I upgraded my Kernel). diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 58c7ee7..10c7d39 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -289,11 +289,17 @@ void intel_panel_disable_backlight(struct drm_device *dev) intel_panel_actually_set_backlight(dev, 0); if (INTEL_INFO(dev)->gen >= 4) { - uint32_t reg; + uint32_t reg, tmp; reg = HAS_PCH_SPLIT(dev) ? BLC_PWM_CPU_CTL2 : BLC_PWM_CTL2; I915_WRITE(reg, I915_READ(reg) & ~BLM_PWM_ENABLE); + + if (HAS_PCH_SPLIT(dev)) { + tmp = I915_READ(BLC_PWM_PCH_CTL1); + tmp &= ~BLM_PCH_PWM_ENABLE; + I915_WRITE(BLC_PWM_PCH_CTL1, tmp); + } } } @@ -333,6 +339,13 @@ void intel_panel_enable_backlight(struct drm_device *dev, I915_WRITE(reg, tmp); POSTING_READ(reg); I915_WRITE(reg, tmp | BLM_PWM_ENABLE); + + if (HAS_PCH_SPLIT(dev)) { + tmp = I915_READ(BLC_PWM_PCH_CTL1); + tmp |= BLM_PCH_PWM_ENABLE; + tmp &= ~BLM_PCH_OVERRIDE_ENABLE; + I915_WRITE(BLC_PWM_PCH_CTL1, tmp); + } } }