aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_crtc.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-11-10 06:16:54 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-11-12 04:50:13 -0500
commit24ec84e854c68ceda59a26027114eb7f260f9411 (patch)
treef239c0c4f52c14c6ed3bc43c5c101602e007f73c /drivers/gpu/drm/omapdrm/omap_crtc.c
parent350c03e880038bf60184500bab9025d3361c0b0e (diff)
drm/omap: Move DISPC runtime PM handling to omapdrm
The internal encoders (DSI, HDMI4, HDMI5 and VENC) runtime PM handlers attempt to manage the runtime PM state of the connected DISPC, based on the rationale that the DISPC providing data to the encoders requires ensuring that the display is active whenever the encoders are active. While the DISPC provides data to the encoders, it doesn't as such constitute a resource that encoders require in order to be taken out of suspend, contrary to for instance a functional clock or a power supply. Encoders registers can be accessed without the DISPC being active, and while the encoders will not output any video stream without being fed by the DISPC, the DISPC PM state doesn't influence the encoders PM state. For this reason the DISPC PM state is better managed from the omapdrm driver, in the CRTC enable and disable operations. This allows the encoders PM state to be handled separately from the DISPC, and in particular at times when the DISPC may not be available (for instance at probe due to the DSS probe being deferred, or at remove time du to the DISPC being already removed). Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-5-laurent.pinchart@ideasonboard.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_crtc.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 62928ec0e7db..caffc547ef97 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -350,11 +350,14 @@ static void omap_crtc_arm_event(struct drm_crtc *crtc)
350static void omap_crtc_atomic_enable(struct drm_crtc *crtc, 350static void omap_crtc_atomic_enable(struct drm_crtc *crtc,
351 struct drm_crtc_state *old_state) 351 struct drm_crtc_state *old_state)
352{ 352{
353 struct omap_drm_private *priv = crtc->dev->dev_private;
353 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 354 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
354 int ret; 355 int ret;
355 356
356 DBG("%s", omap_crtc->name); 357 DBG("%s", omap_crtc->name);
357 358
359 priv->dispc_ops->runtime_get(priv->dispc);
360
358 spin_lock_irq(&crtc->dev->event_lock); 361 spin_lock_irq(&crtc->dev->event_lock);
359 drm_crtc_vblank_on(crtc); 362 drm_crtc_vblank_on(crtc);
360 ret = drm_crtc_vblank_get(crtc); 363 ret = drm_crtc_vblank_get(crtc);
@@ -367,6 +370,7 @@ static void omap_crtc_atomic_enable(struct drm_crtc *crtc,
367static void omap_crtc_atomic_disable(struct drm_crtc *crtc, 370static void omap_crtc_atomic_disable(struct drm_crtc *crtc,
368 struct drm_crtc_state *old_state) 371 struct drm_crtc_state *old_state)
369{ 372{
373 struct omap_drm_private *priv = crtc->dev->dev_private;
370 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 374 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
371 375
372 DBG("%s", omap_crtc->name); 376 DBG("%s", omap_crtc->name);
@@ -379,6 +383,8 @@ static void omap_crtc_atomic_disable(struct drm_crtc *crtc,
379 spin_unlock_irq(&crtc->dev->event_lock); 383 spin_unlock_irq(&crtc->dev->event_lock);
380 384
381 drm_crtc_vblank_off(crtc); 385 drm_crtc_vblank_off(crtc);
386
387 priv->dispc_ops->runtime_put(priv->dispc);
382} 388}
383 389
384static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc, 390static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc,