diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-05-29 04:05:37 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-06-12 15:52:51 -0400 |
commit | 11ffd031e3e5b9cc0232aad549bb08eb14612f43 (patch) | |
tree | b4856435551a0fe76a5814e9a138d29fec0e96cc | |
parent | d9157dfd045f27f376edeab164203f1a68ba3ba4 (diff) |
drm: omapdrm: inline omap_plane_setup into update/disable
At the moment we have omap_plane_setup() function which handles both
enabling (and configuring) and disabling the plane. With atomic
modesetting we have separate hooks for plane enable/config and disable.
This patch moves the code from omap_plane_setup() to
omap_plane_atomic_update() and omap_plane_atomic_disable().
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_plane.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index a8e617f9f2af..b13fb2fd4a9a 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c | |||
@@ -58,7 +58,22 @@ 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 | ||
61 | static void omap_plane_setup(struct drm_plane *plane) | 61 | static int omap_plane_prepare_fb(struct drm_plane *plane, |
62 | struct drm_framebuffer *fb, | ||
63 | const struct drm_plane_state *new_state) | ||
64 | { | ||
65 | return omap_framebuffer_pin(fb); | ||
66 | } | ||
67 | |||
68 | static void omap_plane_cleanup_fb(struct drm_plane *plane, | ||
69 | struct drm_framebuffer *fb, | ||
70 | const struct drm_plane_state *old_state) | ||
71 | { | ||
72 | omap_framebuffer_unpin(fb); | ||
73 | } | ||
74 | |||
75 | static void omap_plane_atomic_update(struct drm_plane *plane, | ||
76 | struct drm_plane_state *old_state) | ||
62 | { | 77 | { |
63 | struct omap_plane *omap_plane = to_omap_plane(plane); | 78 | struct omap_plane *omap_plane = to_omap_plane(plane); |
64 | struct drm_plane_state *state = plane->state; | 79 | struct drm_plane_state *state = plane->state; |
@@ -69,11 +84,6 @@ static void omap_plane_setup(struct drm_plane *plane) | |||
69 | 84 | ||
70 | DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb); | 85 | DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb); |
71 | 86 | ||
72 | if (!state->crtc) { | ||
73 | dispc_ovl_enable(omap_plane->id, false); | ||
74 | return; | ||
75 | } | ||
76 | |||
77 | memset(&info, 0, sizeof(info)); | 87 | memset(&info, 0, sizeof(info)); |
78 | info.rotation_type = OMAP_DSS_ROT_DMA; | 88 | info.rotation_type = OMAP_DSS_ROT_DMA; |
79 | info.rotation = OMAP_DSS_ROT_0; | 89 | info.rotation = OMAP_DSS_ROT_0; |
@@ -128,26 +138,6 @@ static void omap_plane_setup(struct drm_plane *plane) | |||
128 | dispc_ovl_enable(omap_plane->id, true); | 138 | dispc_ovl_enable(omap_plane->id, true); |
129 | } | 139 | } |
130 | 140 | ||
131 | static int omap_plane_prepare_fb(struct drm_plane *plane, | ||
132 | struct drm_framebuffer *fb, | ||
133 | const struct drm_plane_state *new_state) | ||
134 | { | ||
135 | return omap_framebuffer_pin(fb); | ||
136 | } | ||
137 | |||
138 | static void omap_plane_cleanup_fb(struct drm_plane *plane, | ||
139 | struct drm_framebuffer *fb, | ||
140 | const struct drm_plane_state *old_state) | ||
141 | { | ||
142 | omap_framebuffer_unpin(fb); | ||
143 | } | ||
144 | |||
145 | static void omap_plane_atomic_update(struct drm_plane *plane, | ||
146 | struct drm_plane_state *old_state) | ||
147 | { | ||
148 | omap_plane_setup(plane); | ||
149 | } | ||
150 | |||
151 | static void omap_plane_atomic_disable(struct drm_plane *plane, | 141 | static void omap_plane_atomic_disable(struct drm_plane *plane, |
152 | struct drm_plane_state *old_state) | 142 | struct drm_plane_state *old_state) |
153 | { | 143 | { |
@@ -158,7 +148,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane, | |||
158 | omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY | 148 | omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY |
159 | ? 0 : omap_plane->id; | 149 | ? 0 : omap_plane->id; |
160 | 150 | ||
161 | omap_plane_setup(plane); | 151 | dispc_ovl_enable(omap_plane->id, false); |
162 | } | 152 | } |
163 | 153 | ||
164 | static const struct drm_plane_helper_funcs omap_plane_helper_funcs = { | 154 | static const struct drm_plane_helper_funcs omap_plane_helper_funcs = { |