All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: robdclark@gmail.com
Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	Archit Taneja <architt@codeaurora.org>
Subject: [PATCH 07/10] drm/msm/mdp5: Don't use mode_set helper funcs for encoders and CRTCs
Date: Fri, 28 Jul 2017 16:17:05 +0530	[thread overview]
Message-ID: <20170728104708.20635-8-architt@codeaurora.org> (raw)
In-Reply-To: <20170728104708.20635-1-architt@codeaurora.org>

We shouldn't use use mode_set/mode_set_nofb helpers when we use runtime
PM. The registers configured in these funcs lose their state when we
eventually enable the display pipeline.

Do not implement these vfuncs in the helpers, and call them in the
crtc_enable/encoder_enable paths instead.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c    | 4 +++-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
index fb78425db52c..0de6e3436ac8 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
@@ -443,6 +443,9 @@ static void mdp5_crtc_enable(struct drm_crtc *crtc)
 		return;
 
 	pm_runtime_get_sync(dev);
+
+	mdp5_crtc_mode_set_nofb(crtc);
+
 	mdp_irq_register(&mdp5_kms->base, &mdp5_crtc->err);
 
 	if (mdp5_cstate->cmd_mode)
@@ -951,7 +954,6 @@ static const struct drm_crtc_funcs mdp5_crtc_no_lm_cursor_funcs = {
 };
 
 static const struct drm_crtc_helper_funcs mdp5_crtc_helper_funcs = {
-	.mode_set_nofb = mdp5_crtc_mode_set_nofb,
 	.disable = mdp5_crtc_disable,
 	.enable = mdp5_crtc_enable,
 	.atomic_check = mdp5_crtc_atomic_check,
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c
index 0ca9e4033bb6..5b851380d3f2 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c
@@ -297,6 +297,10 @@ static void mdp5_encoder_enable(struct drm_encoder *encoder)
 {
 	struct mdp5_encoder *mdp5_encoder = to_mdp5_encoder(encoder);
 	struct mdp5_interface *intf = mdp5_encoder->intf;
+	/* this isn't right I think */
+	struct drm_crtc_state *cstate = encoder->crtc->state;
+
+	mdp5_encoder_mode_set(encoder, &cstate->mode, &cstate->adjusted_mode);
 
 	if (intf->mode == MDP5_INTF_DSI_MODE_COMMAND)
 		mdp5_cmd_encoder_enable(encoder);
@@ -320,7 +324,6 @@ static int mdp5_encoder_atomic_check(struct drm_encoder *encoder,
 }
 
 static const struct drm_encoder_helper_funcs mdp5_encoder_helper_funcs = {
-	.mode_set = mdp5_encoder_mode_set,
 	.disable = mdp5_encoder_disable,
 	.enable = mdp5_encoder_enable,
 	.atomic_check = mdp5_encoder_atomic_check,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2017-07-28 10:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 10:46 [PATCH 00/10] drm/msm: Runtime PM for MDP5 based devices Archit Taneja
2017-07-28 10:46 ` [PATCH 01/10] drm/msm/mdp5: Fix typo in encoder_enable path Archit Taneja
2017-07-28 10:47 ` [PATCH 02/10] drm/msm/mdp5: Drop clock names with "_clk" suffix Archit Taneja
2017-07-28 10:47 ` [PATCH 03/10] drm/msm/mdp5: Use runtime PM get/put API instead of toggling clocks Archit Taneja
2017-07-28 10:47 ` [PATCH 04/10] drm/msm/hdmi: Set up runtime PM for HDMI Archit Taneja
2017-07-28 10:47 ` [PATCH 05/10] drm/msm/dsi: Set up runtime PM for DSI Archit Taneja
2017-07-28 10:47 ` [PATCH 06/10] drm/msm/dsi: Implement RPM suspend/resume callbacks Archit Taneja
2017-07-28 10:47 ` Archit Taneja [this message]
2017-07-28 10:47 ` [PATCH 08/10] drm/msm/mdp5: Write to SMP registers even if allocations don't change Archit Taneja
2017-07-28 10:47 ` [PATCH 09/10] drm/msm/mdp5: Set up runtime PM for MDSS Archit Taneja
2017-07-28 10:47 ` [PATCH 10/10] drm/msm/adreno: Prevent unclocked access when retrieving timestamps Archit Taneja
2017-07-28 13:52   ` Jordan Crouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170728104708.20635-8-architt@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.