linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: Stefan Agner <stefan@agner.ch>, Marek Vasut <marex@denx.de>,
	Shawn Guo <shawnguo@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Robert Chiras <robert.chiras@nxp.com>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Anson Huang <Anson.Huang@nxp.com>,
	dri-devel@lists.freedesktop.org,
	Dong Aisheng <aisheng.dong@nxp.com>,
	linux-imx@nxp.com, kernel@pengutronix.de,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 3/5] drm/mxsfb: Add pm_runtime calls to pipe_enable/disable
Date: Wed,  8 Aug 2018 19:09:00 +0300	[thread overview]
Message-ID: <5b434a3d8b2968552e9bdff9eb5c78266c3bb28b.1533743954.git.leonard.crestez@nxp.com> (raw)
In-Reply-To: <cover.1533743954.git.leonard.crestez@nxp.com>

Adding lcdif nodes to a power domain currently results in
black/corrupted screens or hangs because power is not correctly enabled
when required.

Ensure power is on when display is active by adding
pm_runtime_get/put_sync to mxsfb_pipe_enable/disable.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index ffe5137ccaf8..68d79f5dc0d3 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -101,23 +101,27 @@ static const struct drm_mode_config_funcs mxsfb_mode_config_funcs = {
 static void mxsfb_pipe_enable(struct drm_simple_display_pipe *pipe,
 			      struct drm_crtc_state *crtc_state,
 			      struct drm_plane_state *plane_state)
 {
 	struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe);
+	struct drm_device *drm = pipe->plane.dev;
 
+	pm_runtime_get_sync(drm->dev);
 	drm_panel_prepare(mxsfb->panel);
 	mxsfb_crtc_enable(mxsfb);
 	drm_panel_enable(mxsfb->panel);
 }
 
 static void mxsfb_pipe_disable(struct drm_simple_display_pipe *pipe)
 {
 	struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe);
+	struct drm_device *drm = pipe->plane.dev;
 
 	drm_panel_disable(mxsfb->panel);
 	mxsfb_crtc_disable(mxsfb);
 	drm_panel_unprepare(mxsfb->panel);
+	pm_runtime_put_sync(drm->dev);
 }
 
 static void mxsfb_pipe_update(struct drm_simple_display_pipe *pipe,
 			      struct drm_plane_state *plane_state)
 {
-- 
2.17.1


  parent reply	other threads:[~2018-08-08 16:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 16:08 [PATCH v4 0/5] drm/mxsfb: Fix runtime PM for unpowering lcdif block Leonard Crestez
2018-08-08 16:08 ` [PATCH v4 1/5] drm/mxsfb: Move axi clk enable/disable to crtc enable/disable Leonard Crestez
2018-08-08 18:57   ` Stefan Agner
2018-08-13 13:19     ` Leonard Crestez
2018-08-08 16:08 ` [PATCH v4 2/5] drm/mxsfb: Fix initial corrupt frame when activating display Leonard Crestez
2018-08-08 18:58   ` Stefan Agner
2018-08-08 16:09 ` Leonard Crestez [this message]
2018-08-08 16:09 ` [PATCH v4 4/5] drm/mxsfb: Add PM_SLEEP support Leonard Crestez
2018-08-08 16:09 ` [PATCH v4 5/5] drm/mxsfb: Switch to drm_atomic_helper_commit_tail_rpm Leonard Crestez

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=5b434a3d8b2968552e9bdff9eb5c78266c3bb28b.1533743954.git.leonard.crestez@nxp.com \
    --to=leonard.crestez@nxp.com \
    --cc=Anson.Huang@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=p.zabel@pengutronix.de \
    --cc=robert.chiras@nxp.com \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).