From patchwork Tue Mar 28 07:42:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 744111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3vsjY86N68z9s76; Tue, 28 Mar 2017 18:42:52 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1cslmC-0003jc-JY; Tue, 28 Mar 2017 07:42:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cslm4-0003fm-8x for kernel-team@lists.ubuntu.com; Tue, 28 Mar 2017 07:42:40 +0000 Received: from [175.41.48.77] (helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cslm3-0002Pp-Gs for kernel-team@lists.ubuntu.com; Tue, 28 Mar 2017 07:42:40 +0000 From: Kai-Heng Feng To: kernel-team@lists.ubuntu.com Subject: [Xenial] [PATCH 5/5] drm/i915: Add lspcon resume function Date: Tue, 28 Mar 2017 15:42:18 +0800 Message-Id: <20170328074218.13027-6-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170328074218.13027-1-kai.heng.feng@canonical.com> References: <20170328074218.13027-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Shashank Sharma BugLink: https://bugs.launchpad.net/bugs/1676747 As per the software design, we are driving lspcon in PCON mode. But while resuming from suspend, lspcon can go in LS mode (which is its default operating mode on power on) This patch adds a resume function for lspcon, which makes sure its operating in PCON mode, post resume. V2: Address review comments from Imre - move lspcon_resume call to encoder->reset() - use early returns Signed-off-by: Shashank Sharma Reviewed-by: Imre Deak Acked-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/1476455212-27893-6-git-send-email-shashank.sharma@intel.com (cherry picked from commit 910530c0630541aa5d2f20ea15f3108bfe2c1693) Signed-off-by: Kai-Heng Feng --- ubuntu/i915/intel_dp.c | 7 ++++++- ubuntu/i915/intel_drv.h | 1 + ubuntu/i915/intel_lspcon.c | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ubuntu/i915/intel_dp.c b/ubuntu/i915/intel_dp.c index 92320f6a628d..c61759ef00c8 100644 --- a/ubuntu/i915/intel_dp.c +++ b/ubuntu/i915/intel_dp.c @@ -4895,11 +4895,16 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp) void intel_dp_encoder_reset(struct drm_encoder *encoder) { struct drm_i915_private *dev_priv = to_i915(encoder->dev); - struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); + struct intel_lspcon *lspcon = &intel_dig_port->lspcon; + struct intel_dp *intel_dp = &intel_dig_port->dp; if (!HAS_DDI(dev_priv)) intel_dp->DP = I915_READ(intel_dp->output_reg); + if (IS_GEN9(dev_priv) && lspcon->active) + lspcon_resume(lspcon); + if (to_intel_encoder(encoder)->type != INTEL_OUTPUT_EDP) return; diff --git a/ubuntu/i915/intel_drv.h b/ubuntu/i915/intel_drv.h index 0956da76fd82..0fcd23566bcc 100644 --- a/ubuntu/i915/intel_drv.h +++ b/ubuntu/i915/intel_drv.h @@ -1704,4 +1704,5 @@ void intel_color_load_luts(struct drm_crtc_state *crtc_state); /* intel_lspcon.c */ bool lspcon_init(struct intel_digital_port *intel_dig_port); +void lspcon_resume(struct intel_lspcon *lspcon); #endif /* __INTEL_DRV_H__ */ diff --git a/ubuntu/i915/intel_lspcon.c b/ubuntu/i915/intel_lspcon.c index 628ae6fbdcb1..d606f1a8f3b6 100644 --- a/ubuntu/i915/intel_lspcon.c +++ b/ubuntu/i915/intel_lspcon.c @@ -89,6 +89,14 @@ static bool lspcon_probe(struct intel_lspcon *lspcon) return true; } +void lspcon_resume(struct intel_lspcon *lspcon) +{ + if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON, true)) + DRM_ERROR("LSPCON resume failed\n"); + else + DRM_DEBUG_KMS("LSPCON resume success\n"); +} + bool lspcon_init(struct intel_digital_port *intel_dig_port) { struct intel_dp *dp = &intel_dig_port->dp;