From patchwork Wed Mar 8 21:30:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9611999 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 4D0016016C for ; Wed, 8 Mar 2017 21:31:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 405FA2863F for ; Wed, 8 Mar 2017 21:31:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3574F28642; Wed, 8 Mar 2017 21:31:07 +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 01D1B2863F for ; Wed, 8 Mar 2017 21:31:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB30F6EA5A; Wed, 8 Mar 2017 21:31:04 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x22f.google.com (mail-pg0-x22f.google.com [IPv6:2607:f8b0:400e:c05::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9EE6D89DD5 for ; Wed, 8 Mar 2017 21:31:01 +0000 (UTC) Received: by mail-pg0-x22f.google.com with SMTP id b129so17651755pgc.2 for ; Wed, 08 Mar 2017 13:31:01 -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=8cWbbntnpNBW3hJdYmjIaxpfJTrCZ+zfU5hi0EoAmzc=; b=IDdd+vsM525bb7oiFfSknyBH3yeY7/rxG3LJZ4B2FYwznogTzZFlojTShGAgxJP+Yu nz/ZvIkW7m1SDoDiF9gNdkKoLXwZer8nNf3nehVxvl7J5v41AGrwxFkl2NyUwfH+2/x9 y3TnoKmsqQvCtlClVrdewbwyvTmMLu94uJfkQBUd8eio3SYJCjsuc87CW5Q3hI4P+DGG d3PFAP6H6QDfaF84ydRABQhR8IRmmkySeaatWT9yDpgJZAO63STveg17Td+xWD+WoVqU x4k594fdD+4TLu5cPLqP9iFDOdJlk1ns8R5lDb01yHDcK1Il8Zu1M6rxlDw9hWt2dzl+ 2cqA== 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=8cWbbntnpNBW3hJdYmjIaxpfJTrCZ+zfU5hi0EoAmzc=; b=NcJJXy8NP2A9jxayRFNmKHefkR5d2r0wT4DlxF5K+HuBGhsipO9llHAMv6sEXxeUGb fWpYB401IE0jXutvPe2W4779rPQ0u1VBGRx1F7jLYixr/iaC/0T2raKYJCg+UPdMBrC0 nlqSjoRi/joiDQVNj7aWFiz/eXk/D8XVNcqZCb8rGHEOWqNkyDDcB3E2km6Z1hyQo/4M sB6n6VdtK+Y3hS4DGUW9mbZnx6tufvU0uXrim7MWkbB7IKsKfbjSnYobOAKKOPO3IcNm /TeK3ia9VJsBhFOiljCEH6+BIVSWSErYhPiIX/57sO/61yCoqwrYHqdOQUyYCYrFr44X qYRg== X-Gm-Message-State: AMke39mlTMfYyaUr21sZ5awM6qhflmwielYltCIjbiwh0SJbqSjvvAjFWCdPtcRPic8JLvcY X-Received: by 10.98.68.199 with SMTP id m68mr9630948pfi.31.1489008660593; Wed, 08 Mar 2017 13:31:00 -0800 (PST) Received: from puthik2.mtv.corp.google.com ([172.22.64.53]) by smtp.gmail.com with ESMTPSA id p4sm7975510pgd.50.2017.03.08.13.30.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 13:30:59 -0800 (PST) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id F028E120DF1; Wed, 8 Mar 2017 13:30:57 -0800 (PST) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Mar 2017 13:30:53 -0800 Message-Id: <20170308213053.194062-6-puthik@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170308213053.194062-1-puthik@chromium.org> References: <20170308213053.194062-1-puthik@chromium.org> Cc: Puthikorn Voravootivat Subject: [Intel-gfx] [PATCH 5/5] 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 32b426006a6a..fd7258715c88 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; } /* @@ -161,6 +162,7 @@ static void intel_dp_aux_enable_backlight(struct intel_connector *connector) drm_dp_dpcd_writeb(&intel_dp->aux, DP_EDP_BACKLIGHT_FREQ_SET, 0xff); } + intel_dp_aux_set_backlight(connector, connector->panel.backlight.level); } static void intel_dp_aux_disable_backlight(struct intel_connector *connector)