From patchwork Fri Jun 14 06:09:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lee, Shawn C" X-Patchwork-Id: 10994313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5B9476 for ; Fri, 14 Jun 2019 05:39:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D456427CEA for ; Fri, 14 Jun 2019 05:39:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C59A327D0C; Fri, 14 Jun 2019 05:39:38 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 7805527CEA for ; Fri, 14 Jun 2019 05:39:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5078489256; Fri, 14 Jun 2019 05:39:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C30189256 for ; Fri, 14 Jun 2019 05:39:36 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2019 22:39:36 -0700 X-ExtLoop1: 1 Received: from shawnle1-cm6330.itwn.intel.com ([10.5.253.127]) by fmsmga006.fm.intel.com with ESMTP; 13 Jun 2019 22:39:34 -0700 From: "Lee, Shawn C" To: intel-gfx@lists.freedesktop.org Date: Thu, 13 Jun 2019 23:09:24 -0700 Message-Id: <1560492565-30405-1-git-send-email-shawn.c.lee@intel.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Refine eDP aux backlight enable/disable sequence X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cooper Chiou , Lee@freedesktop.org, Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Modify aux backlight enable/disable sequence just like what we did for genernal eDP panel. 1. Setup PWM freq and brightness level before enable display backlight. 2. Set PWM to 0 after backlight enable was off. Cc: Ville Syrjälä Cc: Jani Nikula Cc: Jose Roberto de Souza Cc: Cooper Chiou Signed-off-by: Lee, Shawn C --- drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c index 7ded95a334db..98210ae17285 100644 --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c @@ -216,13 +216,14 @@ static void intel_dp_aux_enable_backlight(const struct intel_crtc_state *crtc_st } } - set_aux_backlight_enable(intel_dp, true); intel_dp_aux_set_backlight(conn_state, connector->panel.backlight.level); + set_aux_backlight_enable(intel_dp, true); } static void intel_dp_aux_disable_backlight(const struct drm_connector_state *old_conn_state) { set_aux_backlight_enable(enc_to_intel_dp(old_conn_state->best_encoder), false); + intel_dp_aux_set_backlight(old_conn_state, 0); } static int intel_dp_aux_setup_backlight(struct intel_connector *connector, From patchwork Fri Jun 14 06:09:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lee, Shawn C" X-Patchwork-Id: 10994315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 656E514DB for ; Fri, 14 Jun 2019 05:39:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5771527CEA for ; Fri, 14 Jun 2019 05:39:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B44C27D0C; Fri, 14 Jun 2019 05:39:44 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 05A4D27CEA for ; Fri, 14 Jun 2019 05:39:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E0FC8926E; Fri, 14 Jun 2019 05:39:43 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE1298926E for ; Fri, 14 Jun 2019 05:39:41 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2019 22:39:41 -0700 X-ExtLoop1: 1 Received: from shawnle1-cm6330.itwn.intel.com ([10.5.253.127]) by fmsmga006.fm.intel.com with ESMTP; 13 Jun 2019 22:39:40 -0700 From: "Lee, Shawn C" To: intel-gfx@lists.freedesktop.org Date: Thu, 13 Jun 2019 23:09:25 -0700 Message-Id: <1560492565-30405-2-git-send-email-shawn.c.lee@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560492565-30405-1-git-send-email-shawn.c.lee@intel.com> References: <1560492565-30405-1-git-send-email-shawn.c.lee@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Add backlight enable on/off delay for DP aux backlight control X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cooper Chiou , Lee@freedesktop.org, Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Follow generla eDP backlight enable control sequence. Add T8 (valid video data to backlight enable) delay before turn backlight_enable on. And T9 (backlight disable to end of valida video data) delay after backlight_enable off. Cc: Ville Syrjälä Cc: Jani Nikula Cc: Jose Roberto de Souza Cc: Cooper Chiou Signed-off-by: Lee, Shawn C --- drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c index 98210ae17285..b008e887f4e9 100644 --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c @@ -217,12 +217,25 @@ static void intel_dp_aux_enable_backlight(const struct intel_crtc_state *crtc_st } intel_dp_aux_set_backlight(conn_state, connector->panel.backlight.level); + + wait_remaining_ms_from_jiffies(intel_dp->last_power_on, + intel_dp->backlight_on_delay); + set_aux_backlight_enable(intel_dp, true); } static void intel_dp_aux_disable_backlight(const struct drm_connector_state *old_conn_state) { + struct intel_connector *connector = to_intel_connector(old_conn_state->connector); + struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base); + + intel_dp->last_backlight_off = jiffies; + set_aux_backlight_enable(enc_to_intel_dp(old_conn_state->best_encoder), false); + + wait_remaining_ms_from_jiffies(intel_dp->last_backlight_off, + intel_dp->backlight_off_delay); + intel_dp_aux_set_backlight(old_conn_state, 0); }