From patchwork Fri Mar 22 14:44:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2321031 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 E0515400E6 for ; Fri, 22 Mar 2013 14:50:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE7A3E617C for ; Fri, 22 Mar 2013 07:50:56 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by gabe.freedesktop.org (Postfix) with ESMTP id C229FE5C30 for ; Fri, 22 Mar 2013 07:42:02 -0700 (PDT) Received: by mail-ee0-f42.google.com with SMTP id b47so2357677eek.29 for ; Fri, 22 Mar 2013 07:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=7zAMTlJrsZ4ATWbsLQRd3D2XZTI6jF46mr1p065Ug90=; b=dsVbaq74lsN8YYtMkKDscTkNVGcRfWcGuLq1JXqLLmKxe3WTnH+trjQyEAyX8/TQ24 II+ksQWFqxZG1E06qXzmcWe59ITxYbLYLxlofsid2mhFcV9u4tCkxSjsyvCHWAS2CSCt b2MmMH9xvnmC4PGTyQ7cRPUjr6MDeXC9H1g3E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=7zAMTlJrsZ4ATWbsLQRd3D2XZTI6jF46mr1p065Ug90=; b=YDYvKlZOewiKcN87hPLgoD1lJ2ZHN3/Krxdnee40vYA0VreZUp13Gz8kGXqrkNpSzL FGlOcBi79K5jXDTnDlX831/VeMfS1SVI8NmKagnqTScAlERNBfO44za25aNCVCZGuS+m YfI8qcvE7s4Xgu1Lovzhj+O+ocZzjTWuR7fGMmqwn86HQSnxvonKC8jPPPmvSZb/uswE e+qL23vifdJauJqLdDXwGyT+74jN333Dzp/Ov63NrbIjkOsm9LkDvIMhvWz07fGsfrlY QSPqBLl7th9IfHzFX+O3IG54XP6y89nsKLLBxDBnq5UrUCgf9eOydzx25Lb0XXxPpvN1 8/kw== X-Received: by 10.14.206.132 with SMTP id l4mr5648571eeo.38.1363963321899; Fri, 22 Mar 2013 07:42:01 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id a1sm3447192eep.2.2013.03.22.07.42.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Mar 2013 07:42:01 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 22 Mar 2013 15:44:46 +0100 Message-Id: <1363963486-7891-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20130322140129.GU9021@phenom.ffwll.local> References: <20130322140129.GU9021@phenom.ffwll.local> X-Gm-Message-State: ALoCoQk1oqD4JCfm6043/f63+PpU5TzsLgFNZeZ6FhhJGTfv8n5nndesP8bW5U0ajq1zBiZ3mWxz Cc: Jani Nikula , Daniel Vetter , Takashi Iwai Subject: [Intel-gfx] [PATCH] Revert "drm/i915: write backlight harder" 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 This reverts commit cf0a6584aa6d382f802f2c3cacac23ccbccde0cd. Turns out that cargo-culting breaks systems. Note that we can't revert further, since commit 770c12312ad617172b1a65b911d3e6564fc5aca8 Author: Takashi Iwai Date: Sat Aug 11 08:56:42 2012 +0200 drm/i915: Fix blank panel at reopening lid fixed a regression in 3.6-rc kernels for which we've never figured out the exact root cause. But some further inspection of the backlight code reveals that it's seriously lacking locking. And especially the asle backlight update is know to get fired (through some smm magic) when writing specific backlight control registers. So the possibility of suffering from races is rather real. Until those races are fixed I don't think it makes sense to try further hacks. Which sucks a bit, but sometimes that's how it is :( References: http://www.mail-archive.com/intel-gfx@lists.freedesktop.org/msg18788.html Cc: Jani Nikula Cc: Takashi Iwai Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_panel.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index a3730e0..bee8cb6 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -321,9 +321,6 @@ void intel_panel_enable_backlight(struct drm_device *dev, if (dev_priv->backlight_level == 0) dev_priv->backlight_level = intel_panel_get_max_backlight(dev); - dev_priv->backlight_enabled = true; - intel_panel_actually_set_backlight(dev, dev_priv->backlight_level); - if (INTEL_INFO(dev)->gen >= 4) { uint32_t reg, tmp; @@ -359,12 +356,12 @@ void intel_panel_enable_backlight(struct drm_device *dev, } set_level: - /* Check the current backlight level and try to set again if it's zero. - * On some machines, BLC_PWM_CPU_CTL is cleared to zero automatically - * when BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1 are written. + /* Call below after setting BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1. + * BLC_PWM_CPU_CTL may be cleared to zero automatically when these + * registers are set. */ - if (!intel_panel_get_backlight(dev)) - intel_panel_actually_set_backlight(dev, dev_priv->backlight_level); + dev_priv->backlight_enabled = true; + intel_panel_actually_set_backlight(dev, dev_priv->backlight_level); } static void intel_panel_init_backlight(struct drm_device *dev)