Lines Matching refs:plane
50 static int lsdc_primary_atomic_check(struct drm_plane *plane,
53 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane);
69 static void lsdc_primary_atomic_update(struct drm_plane *plane,
72 struct lsdc_primary *primary = to_lsdc_primary(plane);
74 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane);
75 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane);
89 static void lsdc_primary_atomic_disable(struct drm_plane *plane,
97 drm_dbg(plane->dev, "%s disabled\n", plane->name);
100 static int lsdc_plane_prepare_fb(struct drm_plane *plane,
115 drm_err(plane->dev, "bo %p reserve failed\n", lbo);
124 drm_err(plane->dev, "bo %p pin failed\n", lbo);
130 if (plane->type != DRM_PLANE_TYPE_CURSOR)
131 drm_dbg(plane->dev,
133 plane->name, lbo, gpu_vaddr, lsdc_bo_size(lbo));
135 return drm_gem_plane_helper_prepare_fb(plane, new_state);
138 static void lsdc_plane_cleanup_fb(struct drm_plane *plane,
152 drm_err(plane->dev, "%p reserve failed\n", lbo);
162 if (plane->type != DRM_PLANE_TYPE_CURSOR)
163 drm_dbg(plane->dev, "%s unpin\n", plane->name);
174 static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane,
180 new_state = drm_atomic_get_new_plane_state(state, plane);
182 if (!plane->state || !plane->state->fb) {
183 drm_dbg(plane->dev, "%s: state is NULL\n", plane->name);
188 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
194 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
203 if (plane->state->crtc != new_state->crtc ||
204 plane->state->src_w != new_state->src_w ||
205 plane->state->src_h != new_state->src_h ||
206 plane->state->crtc_w != new_state->crtc_w ||
207 plane->state->crtc_h != new_state->crtc_h)
210 if (new_state->visible != plane->state->visible)
213 return drm_atomic_helper_check_plane_state(plane->state,
220 static void lsdc_cursor_plane_atomic_async_update(struct drm_plane *plane,
223 struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
225 struct drm_framebuffer *old_fb = plane->state->fb;
229 new_state = drm_atomic_get_new_plane_state(state, plane);
231 new_fb = plane->state->fb;
233 plane->state->crtc_x = new_state->crtc_x;
234 plane->state->crtc_y = new_state->crtc_y;
235 plane->state->crtc_h = new_state->crtc_h;
236 plane->state->crtc_w = new_state->crtc_w;
237 plane->state->src_x = new_state->src_x;
238 plane->state->src_y = new_state->src_y;
239 plane->state->src_h = new_state->src_h;
240 plane->state->src_w = new_state->src_w;
241 swap(plane->state->fb, new_state->fb);
267 /* ls7a1000 cursor plane helpers */
269 static int ls7a1000_cursor_plane_atomic_check(struct drm_plane *plane,
276 new_plane_state = drm_atomic_get_new_plane_state(state, plane);
280 drm_dbg(plane->dev, "%s is not bind to a crtc\n", plane->name);
285 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
299 static void ls7a1000_cursor_plane_atomic_update(struct drm_plane *plane,
302 struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
303 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane);
304 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane);
321 static void ls7a1000_cursor_plane_atomic_disable(struct drm_plane *plane,
324 struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
340 /* ls7a2000 cursor plane helpers */
342 static int ls7a2000_cursor_plane_atomic_check(struct drm_plane *plane,
349 new_plane_state = drm_atomic_get_new_plane_state(state, plane);
353 drm_dbg(plane->dev, "%s is not bind to a crtc\n", plane->name);
358 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
364 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
380 static void ls7a2000_cursor_plane_atomic_update(struct drm_plane *plane,
383 struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
384 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane);
385 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane);
417 static void ls7a2000_cursor_plane_atomic_disable(struct drm_plane *plane,
420 struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
460 /* Primary plane 0 hardware related ops */
506 /* Primary plane 1 hardware related ops */
568 * cursor 1 is attach to CRTC-1. Compositing the primary plane and cursor
569 * plane is automatically done by hardware, the cursor is alway on the top of
570 * the primary plane. In other word, z-order is fixed in hardware and cannot
575 /* cursor plane 0 (for pipe 0) related hardware ops */
613 /* cursor plane 1 (for pipe 1) related hardware ops */
705 * The unforgiving LS7A1000/LS2K1000 has only one hardware cursors plane
721 struct drm_plane *plane,
724 struct lsdc_primary *primary = to_lsdc_primary(plane);
727 ret = drm_universal_plane_init(ddev, plane, 1 << index,
733 "ls-primary-plane-%u", index);
737 drm_plane_helper_add(plane, &lsdc_primary_helper_funcs);
746 struct drm_plane *plane,
749 struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
752 ret = drm_universal_plane_init(ddev, plane, 1 << index,
758 "ls-cursor-plane-%u", index);
765 drm_plane_helper_add(plane, &ls7a1000_cursor_plane_helper_funcs);
771 struct drm_plane *plane,
774 struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
777 ret = drm_universal_plane_init(ddev, plane, 1 << index,
783 "ls-cursor-plane-%u", index);
790 drm_plane_helper_add(plane, &ls7a2000_cursor_plane_helper_funcs);