From patchwork Tue Apr 18 23:48:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9686711 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 95439602C2 for ; Tue, 18 Apr 2017 23:48:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87B2C28354 for ; Tue, 18 Apr 2017 23:48:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CCB72838E; Tue, 18 Apr 2017 23:48:45 +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 4A99728354 for ; Tue, 18 Apr 2017 23:48:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D1C616E23D; Tue, 18 Apr 2017 23:48:43 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x22d.google.com (mail-pg0-x22d.google.com [IPv6:2607:f8b0:400e:c05::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8108A6E231 for ; Tue, 18 Apr 2017 23:48:40 +0000 (UTC) Received: by mail-pg0-x22d.google.com with SMTP id g2so3860792pge.3 for ; Tue, 18 Apr 2017 16:48:40 -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=II3DfVAv26ZpgeiApGpnFAy0ziQ68FmGYsX/3bkIO3I=; b=sc4Rf0SAZ+hXTgP7Cu9y/lf97cnI26GBd06Q+aYSm62/6gxolAm3nkJRBhgkPJcrx3 HxIzp1xju+Qn+/J+I5lXVnpW62bOBAJxzyyzztR7Wkb2g87SqQNzGwnMLYKRYtpRVE4g sjkEMVZK9n/EH6VTExMFv9W9EMdKAJbL6naN0XI9MJwxhUgDUlWFmlAb9nptxnW6nYaX feIRm3GYhYRju4/yuQsxpB+SqUABLw7dypPCqY51GXCVmIDvWqFXFoc2COh2J5quRaGG 2rFmlQqHUJ2AYokZSXNG0fIgJHF93SRjdr7ShbnFh+kptPKFFYB6zUbX+CxNbIpvEIfy i8Vg== 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=II3DfVAv26ZpgeiApGpnFAy0ziQ68FmGYsX/3bkIO3I=; b=KnkKzIITr19NRbspSDmwnVcizXDUChZSYGN2wzRsVZJQoNKLsLO5gZeyYvr2IkuS4C uiUF6RqN68N1LlKgEUhAuabP24D93TxtfPp2uk/GWfqVrQWxsnveAmIBCw7TCvvYyGP3 FMjFzU8/LXz3XlDiKlOi1po3WetR1i/bTKhWPAN3Mi5Eyr4wqYgwedw5Ddw+PZkKs93j DWZhuVBO34tvKDpposWz3yBwHifkssPHlP2Vfnc3cO8UqpJ17Ovqi795K/YzBz/JKz0J 5ZHL4OClJkaE8TFmNsQn04UiEVY+lxG3gC0cLcC8s3X+MX+N3BGGTPoI+fW086tQY8O+ r1uA== X-Gm-Message-State: AN3rC/5xaQuYzRulRnY+CVc4x/TN/BjMNcPdloxOrFSz3mMcOn+e0wcj nAXNHzlEq+IMnXv1 X-Received: by 10.84.222.135 with SMTP id x7mr70708pls.50.1492559320042; Tue, 18 Apr 2017 16:48:40 -0700 (PDT) Received: from puthik2.mtv.corp.google.com ([172.22.64.53]) by smtp.gmail.com with ESMTPSA id 3sm557980pge.12.2017.04.18.16.48.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 16:48:38 -0700 (PDT) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id 9181911F8EA; Tue, 18 Apr 2017 16:48:37 -0700 (PDT) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org, Jani Nikula Date: Tue, 18 Apr 2017 16:48:22 -0700 Message-Id: <20170418234824.157355-5-puthik@chromium.org> X-Mailer: git-send-email 2.12.2.816.g2cccc81164-goog In-Reply-To: <20170418234824.157355-1-puthik@chromium.org> References: <20170418234824.157355-1-puthik@chromium.org> Cc: Puthikorn Voravootivat Subject: [Intel-gfx] [PATCH RESEND 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. 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)