Lines Matching full:plane

49 static int lsdc_primary_atomic_check(struct drm_plane *plane,  in lsdc_primary_atomic_check()  argument
52 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); in lsdc_primary_atomic_check()
68 static void lsdc_primary_atomic_update(struct drm_plane *plane, in lsdc_primary_atomic_update() argument
71 struct lsdc_primary *primary = to_lsdc_primary(plane); in lsdc_primary_atomic_update()
73 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); in lsdc_primary_atomic_update()
74 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); in lsdc_primary_atomic_update()
88 static void lsdc_primary_atomic_disable(struct drm_plane *plane, in lsdc_primary_atomic_disable() argument
96 drm_dbg(plane->dev, "%s disabled\n", plane->name); in lsdc_primary_atomic_disable()
99 static int lsdc_plane_prepare_fb(struct drm_plane *plane, in lsdc_plane_prepare_fb() argument
114 drm_err(plane->dev, "bo %p reserve failed\n", lbo); in lsdc_plane_prepare_fb()
123 drm_err(plane->dev, "bo %p pin failed\n", lbo); in lsdc_plane_prepare_fb()
129 if (plane->type != DRM_PLANE_TYPE_CURSOR) in lsdc_plane_prepare_fb()
130 drm_dbg(plane->dev, in lsdc_plane_prepare_fb()
132 plane->name, lbo, gpu_vaddr, lsdc_bo_size(lbo)); in lsdc_plane_prepare_fb()
134 return drm_gem_plane_helper_prepare_fb(plane, new_state); in lsdc_plane_prepare_fb()
137 static void lsdc_plane_cleanup_fb(struct drm_plane *plane, in lsdc_plane_cleanup_fb() argument
151 drm_err(plane->dev, "%p reserve failed\n", lbo); in lsdc_plane_cleanup_fb()
161 if (plane->type != DRM_PLANE_TYPE_CURSOR) in lsdc_plane_cleanup_fb()
162 drm_dbg(plane->dev, "%s unpin\n", plane->name); in lsdc_plane_cleanup_fb()
173 static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane, in lsdc_cursor_plane_atomic_async_check() argument
179 new_state = drm_atomic_get_new_plane_state(state, plane); in lsdc_cursor_plane_atomic_async_check()
181 if (!plane->state || !plane->state->fb) { in lsdc_cursor_plane_atomic_async_check()
182 drm_dbg(plane->dev, "%s: state is NULL\n", plane->name); in lsdc_cursor_plane_atomic_async_check()
187 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", in lsdc_cursor_plane_atomic_async_check()
193 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", in lsdc_cursor_plane_atomic_async_check()
202 if (plane->state->crtc != new_state->crtc || in lsdc_cursor_plane_atomic_async_check()
203 plane->state->src_w != new_state->src_w || in lsdc_cursor_plane_atomic_async_check()
204 plane->state->src_h != new_state->src_h || in lsdc_cursor_plane_atomic_async_check()
205 plane->state->crtc_w != new_state->crtc_w || in lsdc_cursor_plane_atomic_async_check()
206 plane->state->crtc_h != new_state->crtc_h) in lsdc_cursor_plane_atomic_async_check()
209 if (new_state->visible != plane->state->visible) in lsdc_cursor_plane_atomic_async_check()
212 return drm_atomic_helper_check_plane_state(plane->state, in lsdc_cursor_plane_atomic_async_check()
219 static void lsdc_cursor_plane_atomic_async_update(struct drm_plane *plane, in lsdc_cursor_plane_atomic_async_update() argument
222 struct lsdc_cursor *cursor = to_lsdc_cursor(plane); in lsdc_cursor_plane_atomic_async_update()
224 struct drm_framebuffer *old_fb = plane->state->fb; in lsdc_cursor_plane_atomic_async_update()
228 new_state = drm_atomic_get_new_plane_state(state, plane); in lsdc_cursor_plane_atomic_async_update()
230 new_fb = plane->state->fb; in lsdc_cursor_plane_atomic_async_update()
232 plane->state->crtc_x = new_state->crtc_x; in lsdc_cursor_plane_atomic_async_update()
233 plane->state->crtc_y = new_state->crtc_y; in lsdc_cursor_plane_atomic_async_update()
234 plane->state->crtc_h = new_state->crtc_h; in lsdc_cursor_plane_atomic_async_update()
235 plane->state->crtc_w = new_state->crtc_w; in lsdc_cursor_plane_atomic_async_update()
236 plane->state->src_x = new_state->src_x; in lsdc_cursor_plane_atomic_async_update()
237 plane->state->src_y = new_state->src_y; in lsdc_cursor_plane_atomic_async_update()
238 plane->state->src_h = new_state->src_h; in lsdc_cursor_plane_atomic_async_update()
239 plane->state->src_w = new_state->src_w; in lsdc_cursor_plane_atomic_async_update()
240 swap(plane->state->fb, new_state->fb); in lsdc_cursor_plane_atomic_async_update()
266 /* ls7a1000 cursor plane helpers */
268 static int ls7a1000_cursor_plane_atomic_check(struct drm_plane *plane, in ls7a1000_cursor_plane_atomic_check() argument
275 new_plane_state = drm_atomic_get_new_plane_state(state, plane); in ls7a1000_cursor_plane_atomic_check()
279 drm_dbg(plane->dev, "%s is not bind to a crtc\n", plane->name); in ls7a1000_cursor_plane_atomic_check()
284 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", in ls7a1000_cursor_plane_atomic_check()
298 static void ls7a1000_cursor_plane_atomic_update(struct drm_plane *plane, in ls7a1000_cursor_plane_atomic_update() argument
301 struct lsdc_cursor *cursor = to_lsdc_cursor(plane); in ls7a1000_cursor_plane_atomic_update()
302 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); in ls7a1000_cursor_plane_atomic_update()
303 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); in ls7a1000_cursor_plane_atomic_update()
320 static void ls7a1000_cursor_plane_atomic_disable(struct drm_plane *plane, in ls7a1000_cursor_plane_atomic_disable() argument
323 struct lsdc_cursor *cursor = to_lsdc_cursor(plane); in ls7a1000_cursor_plane_atomic_disable()
339 /* ls7a2000 cursor plane helpers */
341 static int ls7a2000_cursor_plane_atomic_check(struct drm_plane *plane, in ls7a2000_cursor_plane_atomic_check() argument
348 new_plane_state = drm_atomic_get_new_plane_state(state, plane); in ls7a2000_cursor_plane_atomic_check()
352 drm_dbg(plane->dev, "%s is not bind to a crtc\n", plane->name); in ls7a2000_cursor_plane_atomic_check()
357 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", in ls7a2000_cursor_plane_atomic_check()
363 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n", in ls7a2000_cursor_plane_atomic_check()
379 static void ls7a2000_cursor_plane_atomic_update(struct drm_plane *plane, in ls7a2000_cursor_plane_atomic_update() argument
382 struct lsdc_cursor *cursor = to_lsdc_cursor(plane); in ls7a2000_cursor_plane_atomic_update()
383 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); in ls7a2000_cursor_plane_atomic_update()
384 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); in ls7a2000_cursor_plane_atomic_update()
416 static void ls7a2000_cursor_plane_atomic_disable(struct drm_plane *plane, in ls7a2000_cursor_plane_atomic_disable() argument
419 struct lsdc_cursor *cursor = to_lsdc_cursor(plane); in ls7a2000_cursor_plane_atomic_disable()
459 /* Primary plane 0 hardware related ops */
505 /* Primary plane 1 hardware related ops */
567 * cursor 1 is attach to CRTC-1. Compositing the primary plane and cursor
568 * plane is automatically done by hardware, the cursor is alway on the top of
569 * the primary plane. In other word, z-order is fixed in hardware and cannot
574 /* cursor plane 0 (for pipe 0) related hardware ops */
612 /* cursor plane 1 (for pipe 1) related hardware ops */
704 * The unforgiving LS7A1000/LS2K1000 has only one hardware cursors plane
720 struct drm_plane *plane, in lsdc_primary_plane_init() argument
723 struct lsdc_primary *primary = to_lsdc_primary(plane); in lsdc_primary_plane_init()
726 ret = drm_universal_plane_init(ddev, plane, 1 << index, in lsdc_primary_plane_init()
732 "ls-primary-plane-%u", index); in lsdc_primary_plane_init()
736 drm_plane_helper_add(plane, &lsdc_primary_helper_funcs); in lsdc_primary_plane_init()
745 struct drm_plane *plane, in ls7a1000_cursor_plane_init() argument
748 struct lsdc_cursor *cursor = to_lsdc_cursor(plane); in ls7a1000_cursor_plane_init()
751 ret = drm_universal_plane_init(ddev, plane, 1 << index, in ls7a1000_cursor_plane_init()
757 "ls-cursor-plane-%u", index); in ls7a1000_cursor_plane_init()
764 drm_plane_helper_add(plane, &ls7a1000_cursor_plane_helper_funcs); in ls7a1000_cursor_plane_init()
770 struct drm_plane *plane, in ls7a2000_cursor_plane_init() argument
773 struct lsdc_cursor *cursor = to_lsdc_cursor(plane); in ls7a2000_cursor_plane_init()
776 ret = drm_universal_plane_init(ddev, plane, 1 << index, in ls7a2000_cursor_plane_init()
782 "ls-cursor-plane-%u", index); in ls7a2000_cursor_plane_init()
789 drm_plane_helper_add(plane, &ls7a2000_cursor_plane_helper_funcs); in ls7a2000_cursor_plane_init()