From patchwork Fri Mar 10 22:33:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9618069 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 059C56046A for ; Fri, 10 Mar 2017 22:33:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2EC3287B3 for ; Fri, 10 Mar 2017 22:33:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E77A1287B4; Fri, 10 Mar 2017 22:33:47 +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 B4B1D287B2 for ; Fri, 10 Mar 2017 22:33:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D1406EEE3; Fri, 10 Mar 2017 22:33:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E8436E12E for ; Fri, 10 Mar 2017 22:33:42 +0000 (UTC) Received: by mail-pf0-x22e.google.com with SMTP id w189so46750177pfb.0 for ; Fri, 10 Mar 2017 14:33:42 -0800 (PST) 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=QSQ3WDHWt2oMmzNd2Iz0QBopqB7H1QigHcj/w0CJuY8=; b=LQCWF6TURzAEhlGuaN59Owi05fcyqbvFdzFV9c+UMDYmlcZOJoHXlZY4t1aRO05yag YQ2taYU9v4JaRSg8+E+VSBwSctzobeCYMyBU48i7EZp/CQDf1GW7eKkVH08sbJL6o/AB bqP/bV9QwsW2HYOXSFQYd1qgNbZcB1lhkTtKunW+ctuuTT+D357J6cjuB3oaUk7hqpQ5 w+a0QJfuEzt3Ke5rwzuU5I8BToYLpqLLsuUkucVtLHNuy1saA07Tvoc5ovldD2RshrMO loTlrhS7nm1WyjEetG56BvTgSx1MjFsdoheLLR0SmSSAE7bxgXHlzQKbtsLJqf/8NpgM WyBw== 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=QSQ3WDHWt2oMmzNd2Iz0QBopqB7H1QigHcj/w0CJuY8=; b=ksaSL0phN1KbgOQgDc7MLx2X6cciqpSYD6YtbD/XUriTie+jJQfchT44v3/gmb3ZDn 2iXhBvRO8ptQHEHBRnumlcrldetjAbSpGACNOJAZxLHftZ1AXQfhP2M9scE5mwz89ske 83F7pevGtyDl2Mis7R3UjqLmyFBH89RtrPcZTlZV3EWu0bY37+NCCwbDvIWXCoSla94a NRLgpksdn2ElMfe3VgUW6BXMLaQFRNrIB3rSt83n6Y8Inwc52Lp6QrzzTmIdENLypDWf ytNGwmpyq1SZZUVYqTDp+OyJo9o8M862Guy8VJ/2pIochdGzTNT6D8u3mkJzgQydO+Vw UTaw== X-Gm-Message-State: AMke39mrM3rS2jSxK4Xl+K+LrOklvawlOYIA5srhIdbdHrcycPEzuEXWQeoZqNx8aaksMAHT X-Received: by 10.84.128.98 with SMTP id 89mr29451155pla.24.1489185221655; Fri, 10 Mar 2017 14:33:41 -0800 (PST) Received: from puthik2.mtv.corp.google.com ([172.22.64.53]) by smtp.gmail.com with ESMTPSA id e16sm10629694pfb.102.2017.03.10.14.33.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Mar 2017 14:33:41 -0800 (PST) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id 43E2611F9E9; Fri, 10 Mar 2017 14:33:39 -0800 (PST) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org, Jani Nikula Date: Fri, 10 Mar 2017 14:33:35 -0800 Message-Id: <20170310223335.46635-5-puthik@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310223335.46635-1-puthik@chromium.org> References: <20170310223335.46635-1-puthik@chromium.org> Cc: Puthikorn Voravootivat Subject: [Intel-gfx] [PATCH v2 4/4] 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)