drm: omapdrm: Simplify DSS power management
Instead of sprinkling dispc_runtime_get() and dispc_runtime_put() calls in various CRTC operations, move all power management code to the atomic commit function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
@@ -429,8 +429,6 @@ static void omap_crtc_enable(struct drm_crtc *crtc)
|
|||||||
|
|
||||||
DBG("%s", omap_crtc->name);
|
DBG("%s", omap_crtc->name);
|
||||||
|
|
||||||
dispc_runtime_get();
|
|
||||||
|
|
||||||
/* Enable all planes associated with the CRTC. */
|
/* Enable all planes associated with the CRTC. */
|
||||||
for (i = 0; i < priv->num_planes; i++) {
|
for (i = 0; i < priv->num_planes; i++) {
|
||||||
struct drm_plane *plane = priv->planes[i];
|
struct drm_plane *plane = priv->planes[i];
|
||||||
@@ -443,8 +441,6 @@ static void omap_crtc_enable(struct drm_crtc *crtc)
|
|||||||
omap_crtc_flush(crtc);
|
omap_crtc_flush(crtc);
|
||||||
|
|
||||||
drm_crtc_vblank_on(crtc);
|
drm_crtc_vblank_on(crtc);
|
||||||
|
|
||||||
dispc_runtime_put();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void omap_crtc_disable(struct drm_crtc *crtc)
|
static void omap_crtc_disable(struct drm_crtc *crtc)
|
||||||
@@ -456,7 +452,6 @@ static void omap_crtc_disable(struct drm_crtc *crtc)
|
|||||||
DBG("%s", omap_crtc->name);
|
DBG("%s", omap_crtc->name);
|
||||||
|
|
||||||
omap_crtc_wait_page_flip(crtc);
|
omap_crtc_wait_page_flip(crtc);
|
||||||
dispc_runtime_get();
|
|
||||||
drm_crtc_vblank_off(crtc);
|
drm_crtc_vblank_off(crtc);
|
||||||
|
|
||||||
/* Disable all planes associated with the CRTC. */
|
/* Disable all planes associated with the CRTC. */
|
||||||
@@ -469,8 +464,6 @@ static void omap_crtc_disable(struct drm_crtc *crtc)
|
|||||||
|
|
||||||
omap_crtc_encoder_setup(crtc, false);
|
omap_crtc_encoder_setup(crtc, false);
|
||||||
omap_crtc_flush(crtc);
|
omap_crtc_flush(crtc);
|
||||||
|
|
||||||
dispc_runtime_put();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
|
static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
|
||||||
@@ -495,8 +488,6 @@ static void omap_crtc_atomic_begin(struct drm_crtc *crtc)
|
|||||||
struct drm_device *dev = crtc->dev;
|
struct drm_device *dev = crtc->dev;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
dispc_runtime_get();
|
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
WARN_ON(omap_crtc->event);
|
WARN_ON(omap_crtc->event);
|
||||||
WARN_ON(drm_crtc_vblank_get(crtc) != 0);
|
WARN_ON(drm_crtc_vblank_get(crtc) != 0);
|
||||||
@@ -511,8 +502,6 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc)
|
|||||||
{
|
{
|
||||||
omap_crtc_flush(crtc);
|
omap_crtc_flush(crtc);
|
||||||
|
|
||||||
dispc_runtime_put();
|
|
||||||
|
|
||||||
crtc->invert_dimensions = !!(crtc->primary->state->rotation &
|
crtc->invert_dimensions = !!(crtc->primary->state->rotation &
|
||||||
(BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)));
|
(BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ static void omap_atomic_complete(struct omap_atomic_state_commit *commit)
|
|||||||
struct drm_atomic_state *old_state = commit->state;
|
struct drm_atomic_state *old_state = commit->state;
|
||||||
|
|
||||||
/* Apply the atomic update. */
|
/* Apply the atomic update. */
|
||||||
|
dispc_runtime_get();
|
||||||
|
|
||||||
drm_atomic_helper_commit_modeset_disables(dev, old_state);
|
drm_atomic_helper_commit_modeset_disables(dev, old_state);
|
||||||
drm_atomic_helper_commit_planes(dev, old_state);
|
drm_atomic_helper_commit_planes(dev, old_state);
|
||||||
drm_atomic_helper_commit_modeset_enables(dev, old_state);
|
drm_atomic_helper_commit_modeset_enables(dev, old_state);
|
||||||
@@ -81,6 +83,8 @@ static void omap_atomic_complete(struct omap_atomic_state_commit *commit)
|
|||||||
|
|
||||||
drm_atomic_helper_cleanup_planes(dev, old_state);
|
drm_atomic_helper_cleanup_planes(dev, old_state);
|
||||||
|
|
||||||
|
dispc_runtime_put();
|
||||||
|
|
||||||
drm_atomic_state_free(old_state);
|
drm_atomic_state_free(old_state);
|
||||||
|
|
||||||
/* Complete the commit, wake up any waiter. */
|
/* Complete the commit, wake up any waiter. */
|
||||||
|
|||||||
Reference in New Issue
Block a user