From patchwork Wed Mar 15 23:41:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9626849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D3A0F604A9 for ; Wed, 15 Mar 2017 23:41:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C52AE285ED for ; Wed, 15 Mar 2017 23:41:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA189285FC; Wed, 15 Mar 2017 23:41:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 885EE285ED for ; Wed, 15 Mar 2017 23:41:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 302876E2FE; Wed, 15 Mar 2017 23:41:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 230C76E97F for ; Wed, 15 Mar 2017 23:41:19 +0000 (UTC) Received: by mail-pg0-x22b.google.com with SMTP id 141so15977756pgd.1 for ; Wed, 15 Mar 2017 16:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VRrLOC3HmT9XfaU/I1iysVI3d+IZMrRL4witds5gwn4=; b=i3MkJxptmzNRn4U/KKyGMJSYP6J+Bl58R7UIvbELvzXg5p5bZgi4gv9tlYrK2M5YXE zvc811q4vabmetdhffs0qoKhHQFTAHfavCTJgejareQwbZ/apq7JsWXDgL0a1qAvly++ Xi8eRVY4mk5QFHSgz4Cho8onADikXTAayJVf0/guCXnB7rz2ljG91LP54NyS7D7eu7fD aCOhRjzTOpE8FE7SqiZj5Lc5F+gWikSDVzz+YfSGhG3ux+eL67hyKWjbabkmqupJWzl2 DWzOmBB4gRif+UdnaMjKOJGwOdlwuqMEE3pbJRt2qn10LRYiBpOUW5usIyS/+svVel6S swnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VRrLOC3HmT9XfaU/I1iysVI3d+IZMrRL4witds5gwn4=; b=flfPA7Yy+R6Z4OsGpcbJ35BIcnim9Th3ui8iZ3mJw9lRjRU+rhN4d5bxzrAmJz2NXm SD1sJ4D2/F9sEOgVxM6+ZAJIW5vwIMFvtpWE+bEsk47ykW/QNrX2DFT0a9+fq6U19Lz2 2ZAr/nA5rSLoEmq4x1FeXokIjpCIpVX0Dih/LKU2vRXjRHJ/j5O2jHDC/ceU3rSHtHBK Oj0Z1RsmAmswggrpmet0maYOBl5caxO6vonCRyHijRg9Jt+BBmZzi+HZ3vlUvw092a2N JRv1BhtqV5U8BCLv99CW0fX3vANfrZb8Xd3brFkklDHMBvbGN3fVJqwcbo8+99+kBdX7 MoCQ== X-Gm-Message-State: AFeK/H3YZAU80ptLFM76VtJkJQbfAsTeRCHSKMcM+xcpgf+Zqqr4YsbL5RJGrGUEIIEAunM9 X-Received: by 10.84.231.9 with SMTP id f9mr8184824plk.117.1489621278673; Wed, 15 Mar 2017 16:41:18 -0700 (PDT) Received: from puthik2.mtv.corp.google.com ([172.22.64.53]) by smtp.gmail.com with ESMTPSA id o17sm6273319pfa.98.2017.03.15.16.41.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2017 16:41:17 -0700 (PDT) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id 052E211F8CD; Wed, 15 Mar 2017 16:41:15 -0700 (PDT) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org, Jani Nikula Date: Wed, 15 Mar 2017 16:41:09 -0700 Message-Id: <20170315234111.57204-5-puthik@chromium.org> X-Mailer: git-send-email 2.12.0.367.g23dc2f6d3c-goog In-Reply-To: <20170315234111.57204-1-puthik@chromium.org> References: <20170315234111.57204-1-puthik@chromium.org> Cc: Puthikorn Voravootivat Subject: [Intel-gfx] [PATCH v3 4/6] drm/i915: Store brightness level in aux backlight driver 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-Virus-Scanned: ClamAV using ClamSMTP Some panel will default to zero brightness when turning the panel off and on again. This patch stores last brightness level before turning off and set them back when panel is turning on. Signed-off-by: Puthikorn Voravootivat --- drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c index 420a5aada652..755ff47ab1ea 100644 --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c @@ -95,6 +95,7 @@ intel_dp_aux_set_backlight(struct intel_connector *connector, u32 level) DRM_DEBUG_KMS("Failed to write aux backlight level\n"); return; } + connector->panel.backlight.level = level; } /* @@ -150,6 +151,7 @@ static void intel_dp_aux_enable_backlight(struct intel_connector *connector) drm_dp_dpcd_writeb(&intel_dp->aux, DP_EDP_BACKLIGHT_MODE_SET_REGISTER, new_dpcd_buf); } + intel_dp_aux_set_backlight(connector, connector->panel.backlight.level); } static void intel_dp_aux_disable_backlight(struct intel_connector *connector)