aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-05-27 13:53:57 -0400
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-06-12 15:52:51 -0400
commit0dce4d75c3fc585387fbfc7ab2126118d86bf0f9 (patch)
tree772b55088dc2140263649ebb84d48cd95b27c5c5
parentaf6da31e9c8d25f4be524c2bf97a886071eb4a00 (diff)
drm: omapdrm: Don't setup planes manually from CRTC .enable()/.disable()
Planes setup is handled by the DRM core through the atomic helpers, there's no need to duplicate the code in the CRTC .enable() and .disable() operations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c20
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.h1
-rw-r--r--drivers/gpu/drm/omapdrm/omap_plane.c2
3 files changed, 1 insertions, 22 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 701406e1f0ee..abfafd1600b8 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -391,41 +391,21 @@ static bool omap_crtc_mode_fixup(struct drm_crtc *crtc,
391 391
392static void omap_crtc_enable(struct drm_crtc *crtc) 392static void omap_crtc_enable(struct drm_crtc *crtc)
393{ 393{
394 struct omap_drm_private *priv = crtc->dev->dev_private;
395 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 394 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
396 unsigned int i;
397 395
398 DBG("%s", omap_crtc->name); 396 DBG("%s", omap_crtc->name);
399 397
400 /* Enable all planes associated with the CRTC. */
401 for (i = 0; i < priv->num_planes; i++) {
402 struct drm_plane *plane = priv->planes[i];
403
404 if (plane->crtc == crtc)
405 WARN_ON(omap_plane_setup(plane));
406 }
407
408 drm_crtc_vblank_on(crtc); 398 drm_crtc_vblank_on(crtc);
409} 399}
410 400
411static void omap_crtc_disable(struct drm_crtc *crtc) 401static void omap_crtc_disable(struct drm_crtc *crtc)
412{ 402{
413 struct omap_drm_private *priv = crtc->dev->dev_private;
414 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 403 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
415 unsigned int i;
416 404
417 DBG("%s", omap_crtc->name); 405 DBG("%s", omap_crtc->name);
418 406
419 omap_crtc_wait_page_flip(crtc); 407 omap_crtc_wait_page_flip(crtc);
420 drm_crtc_vblank_off(crtc); 408 drm_crtc_vblank_off(crtc);
421
422 /* Disable all planes associated with the CRTC. */
423 for (i = 0; i < priv->num_planes; i++) {
424 struct drm_plane *plane = priv->planes[i];
425
426 if (plane->crtc == crtc)
427 WARN_ON(omap_plane_setup(plane));
428 }
429} 409}
430 410
431static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc) 411static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index bdd54162698f..0b7a055bf007 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -150,7 +150,6 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
150 150
151struct drm_plane *omap_plane_init(struct drm_device *dev, 151struct drm_plane *omap_plane_init(struct drm_device *dev,
152 int id, enum drm_plane_type type); 152 int id, enum drm_plane_type type);
153int omap_plane_setup(struct drm_plane *plane);
154void omap_plane_install_properties(struct drm_plane *plane, 153void omap_plane_install_properties(struct drm_plane *plane,
155 struct drm_mode_object *obj); 154 struct drm_mode_object *obj);
156 155
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index d18fe106e256..448707669690 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -58,7 +58,7 @@ to_omap_plane_state(struct drm_plane_state *state)
58 return container_of(state, struct omap_plane_state, base); 58 return container_of(state, struct omap_plane_state, base);
59} 59}
60 60
61int omap_plane_setup(struct drm_plane *plane) 61static int omap_plane_setup(struct drm_plane *plane)
62{ 62{
63 struct omap_plane *omap_plane = to_omap_plane(plane); 63 struct omap_plane *omap_plane = to_omap_plane(plane);
64 struct drm_plane_state *state = plane->state; 64 struct drm_plane_state *state = plane->state;