From patchwork Wed Mar 22 22:54:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9640229 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 1371F602D6 for ; Wed, 22 Mar 2017 22:54:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0610A284EE for ; Wed, 22 Mar 2017 22:54:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF285284F2; Wed, 22 Mar 2017 22:54:54 +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 BFC57284EE for ; Wed, 22 Mar 2017 22:54:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E98366E9B6; Wed, 22 Mar 2017 22:54:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x231.google.com (mail-pg0-x231.google.com [IPv6:2607:f8b0:400e:c05::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id A55506E990 for ; Wed, 22 Mar 2017 22:54:49 +0000 (UTC) Received: by mail-pg0-x231.google.com with SMTP id t143so47911645pgb.2 for ; Wed, 22 Mar 2017 15:54:49 -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=/RuBNZWskeHTwufrVvVtUajf1W3svH43GUJzleAi3B4=; b=jV2irYgEhCJ9EcP/xcskAxow3vki2CncaaEY7gTHXeTs/Jl/xDgy17/QIvRAZrYTE5 MCBNAMM62U4LYnQksrVoQwy1JwiNA68f5aTvkJ5BIfRDxnuQu6i9Y1nlp1ea5PuWPiyI te1wuZ76/p+NSq+ytzhh6Uv7k5kRlvfm5ar1Jw6U8VZZBPvuEnwkkPuEaPrT7VCEXUpT M9Uyrk3EbpvAqsKs3DuY8T1y2U3oXCvlKqhdxmRCOK1g9TMr6d1E7wKD1ibdtleYQazY dQ+pcaTKNpCG+LDYk3v+dBqBAhRFP5liNXUTcTvn7/JkYDeEeK8aoQ1x64IomxLOZyr/ 58Hw== 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=/RuBNZWskeHTwufrVvVtUajf1W3svH43GUJzleAi3B4=; b=N/TqcN/dCdniJ/VsDF5JUyU09ChlYjMK4mqPgpEKmkkdcu7xY3+bHrqIo4hurv73lJ ef3PryuElL01dJZCGwVQrqXNtn/4vGg38VEBVQjfAY79auC1uYm/1RicATanGC6IxH9u UdkoKQseVYIpT3W2aBRI4+PgMEB4cEiOaS0f4KqTD5EQh8JHGQqjYk7o/tOzLIXXvbz3 ZhXpx/bgUBUnT0+1dzsZeIad6lqsV0EynrAfVbC0IDSubgug8hmnaQ09o47s0wt/QqVa NEibrAeNIqiQ9t4XTY8mFWU7NinRJfgtJwG3sh9MPTcpGoj1/Er4M4ounhIFt0bcJc7Z JT9g== X-Gm-Message-State: AFeK/H0Ivqdr1NjW/2keDxg3NWkIg/PSFx+GH2gJocxRUeL/u5D6EXzWpt1jkLtXe3Qs6SPF X-Received: by 10.84.214.22 with SMTP id h22mr24746305pli.65.1490223289153; Wed, 22 Mar 2017 15:54:49 -0700 (PDT) Received: from puthik2.mtv.corp.google.com ([172.22.64.53]) by smtp.gmail.com with ESMTPSA id j19sm1810580pfk.4.2017.03.22.15.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 15:54:48 -0700 (PDT) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id B7B3D11F8CD; Wed, 22 Mar 2017 15:54:46 -0700 (PDT) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org, Jani Nikula Date: Wed, 22 Mar 2017 15:54:41 -0700 Message-Id: <20170322225443.79343-5-puthik@chromium.org> X-Mailer: git-send-email 2.12.1.500.gab5fba24ee-goog In-Reply-To: <20170322225443.79343-1-puthik@chromium.org> References: <20170322225443.79343-1-puthik@chromium.org> Cc: Puthikorn Voravootivat Subject: [Intel-gfx] [PATCH v4 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. Cc: Jani Nikula 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 ae1b6fe67feb..f99cf0a6ae44 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)