From patchwork Sat Jan 10 21:25:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremiah Mahler X-Patchwork-Id: 5605241 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 834F6C058D for ; Sat, 10 Jan 2015 21:27:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FDDA20591 for ; Sat, 10 Jan 2015 21:27:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A2EB720585 for ; Sat, 10 Jan 2015 21:27:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FC806E265; Sat, 10 Jan 2015 13:27:00 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f41.google.com (mail-yh0-f41.google.com [209.85.213.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 832FA6E265; Sat, 10 Jan 2015 13:26:58 -0800 (PST) Received: by mail-yh0-f41.google.com with SMTP id a41so6895905yho.0; Sat, 10 Jan 2015 13:26:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0sQhQoK6rMmAeLNvL/IjzhgheQCjy5M5pPx/3dIM3y0=; b=qk8Rw2l3PLJdQ4aXQ6ESHXT4cp75cNKpP9obqRcqzdnned1htYdD2M8Ze8cDuEhBqE gySVKHSuVxYYjlmNafdK+GIf6yGi7mKGiIe2Huw214A9OFrr1g57pwyCC/UZIUZ8dq1M SuPTQqi+VYJ2X7bU4YLvXqV/85t7iz68ZNymYt6DjvIqyHlfqcujrJg/f1oEjMfOwO+5 X+g6GjarydJib2j7a+rb5EhI1AftAHWQJ+O8fc/NoWzZz9+Zc/VgUoua2SSTJkzs/FjL 8biPPNPU3IRdlUH8t5SlfuPx0i93qpQWOeIoaK2ptaiDVsKf2DfVzrJaxDXoffpFzlvU BRAA== X-Received: by 10.170.173.78 with SMTP id p75mr19510056ykd.66.1420925217941; Sat, 10 Jan 2015 13:26:57 -0800 (PST) Received: from localhost (108-76-185-60.lightspeed.frokca.sbcglobal.net. [108.76.185.60]) by mx.google.com with ESMTPSA id c67sm7035482yhc.55.2015.01.10.13.26.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jan 2015 13:26:56 -0800 (PST) From: Jeremiah Mahler To: Jani Nikula Date: Sat, 10 Jan 2015 13:25:35 -0800 Message-Id: <1420925135-1589-1-git-send-email-jmmahler@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <87fvbkz7nd.fsf@intel.com> References: <87fvbkz7nd.fsf@intel.com> Cc: David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Jeremiah Mahler Subject: [Intel-gfx] [PATCH] drm/i915: fix inconsistent brightness after resume X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 Commit 6dda730e55f4 introduced a bug which resulted in inconsistent brightness levels on different machines. If a suspended was entered with the screen off some machines would resume with the screen at minimum brightness and others at maximum brightness. The following commands can be used to produce this behavior. xset dpms force off sleep 1 sudo systemctl suspend (resume ...) The root cause of this problem is a comparison which checks to see if the backlight level is zero when the panel is enabled. If it is zero, it is set to the maximum level. Unfortunately, not all machines have a minimum level of zero. On those machines the level is left at the minimum instead of begin set to the maximum. Fix the bug by updating the comparison to check for the minimum backlight level instead of zero. Fixes: 6dda730e55f4 ("respect the VBT minimum backlight brightness") Signed-off-by: Jeremiah Mahler --- drivers/gpu/drm/i915/intel_panel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 4d63839..4ef4d66 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -962,7 +962,7 @@ void intel_panel_enable_backlight(struct intel_connector *connector) WARN_ON(panel->backlight.max == 0); - if (panel->backlight.level == 0) { + if (panel->backlight.level == panel->backlight.min) { panel->backlight.level = panel->backlight.max; if (panel->backlight.device) panel->backlight.device->props.brightness =