Lines Matching full:plane
27 * Atomic hardware plane allocator
29 * The hardware plane allocator is solely based on the atomic plane states
35 * the allocated hardware plane(s) for each KMS plane. The allocator then loops
36 * over all plane states to compute the free planes bitmask, allocates hardware
37 * planes based on that bitmask, and stores the result back in the plane states.
56 * as the extra hardware plane will be freed when committing, but doing in rcar_du_plane_needs_realloc()
86 * VSPD1. VSPD0 feeds DU0/1 plane 0, and VSPD1 feeds either DU2 plane 0 or
87 * DU0/1 plane 1.
89 * Allocate the correct fixed plane when sourcing frames from VSPD0 or VSPD1,
96 static int rcar_du_plane_hwalloc(struct rcar_du_plane *plane, in rcar_du_plane_hwalloc() argument
105 /* VSPD0 feeds plane 0 on DU0/1. */ in rcar_du_plane_hwalloc()
106 if (plane->group->index != 0) in rcar_du_plane_hwalloc()
111 /* VSPD1 feeds plane 1 on DU0/1 or plane 0 on DU2. */ in rcar_du_plane_hwalloc()
112 fixed = plane->group->index == 0 ? 1 : 0; in rcar_du_plane_hwalloc()
147 struct rcar_du_plane *plane; in rcar_du_atomic_check_planes() local
150 plane = to_rcar_plane(drm_plane); in rcar_du_atomic_check_planes()
154 dev_dbg(rcdu->dev, "%s: checking plane (%u,%tu)\n", __func__, in rcar_du_atomic_check_planes()
155 plane->group->index, plane - plane->group->planes); in rcar_du_atomic_check_planes()
158 * If the plane is being disabled we don't need to go through in rcar_du_atomic_check_planes()
160 * plane(s) as freed. in rcar_du_atomic_check_planes()
163 dev_dbg(rcdu->dev, "%s: plane is being disabled\n", in rcar_du_atomic_check_planes()
165 index = plane - plane->group->planes; in rcar_du_atomic_check_planes()
166 group_freed_planes[plane->group->index] |= 1 << index; in rcar_du_atomic_check_planes()
172 * If the plane needs to be reallocated mark it as such, and in rcar_du_atomic_check_planes()
173 * mark the hardware plane(s) as free. in rcar_du_atomic_check_planes()
176 dev_dbg(rcdu->dev, "%s: plane needs reallocation\n", in rcar_du_atomic_check_planes()
178 groups |= 1 << plane->group->index; in rcar_du_atomic_check_planes()
181 index = plane - plane->group->planes; in rcar_du_atomic_check_planes()
182 group_freed_planes[plane->group->index] |= 1 << index; in rcar_du_atomic_check_planes()
191 * Grab all plane states for the groups that need reallocation to ensure in rcar_du_atomic_check_planes()
208 struct rcar_du_plane *plane = &group->planes[i]; in rcar_du_atomic_check_planes() local
212 s = drm_atomic_get_plane_state(state, &plane->plane); in rcar_du_atomic_check_planes()
217 * If the plane has been freed in the above loop its in rcar_du_atomic_check_planes()
226 "%s: plane (%u,%tu) has been freed, skipping\n", in rcar_du_atomic_check_planes()
227 __func__, plane->group->index, in rcar_du_atomic_check_planes()
228 plane - plane->group->planes); in rcar_du_atomic_check_planes()
236 "%s: plane (%u,%tu) uses %u hwplanes (index %d)\n", in rcar_du_atomic_check_planes()
237 __func__, plane->group->index, in rcar_du_atomic_check_planes()
238 plane - plane->group->planes, in rcar_du_atomic_check_planes()
251 /* Reallocate hardware planes for each plane that needs it. */ in rcar_du_atomic_check_planes()
256 struct rcar_du_plane *plane; in rcar_du_atomic_check_planes() local
261 plane = to_rcar_plane(drm_plane); in rcar_du_atomic_check_planes()
265 dev_dbg(rcdu->dev, "%s: allocating plane (%u,%tu)\n", __func__, in rcar_du_atomic_check_planes()
266 plane->group->index, plane - plane->group->planes); in rcar_du_atomic_check_planes()
277 * Try to allocate the plane from the free planes currently in rcar_du_atomic_check_planes()
283 ? plane->group->dptsr_planes in rcar_du_atomic_check_planes()
284 : ~plane->group->dptsr_planes; in rcar_du_atomic_check_planes()
285 free = group_free_planes[plane->group->index]; in rcar_du_atomic_check_planes()
287 idx = rcar_du_plane_hwalloc(plane, new_plane_state, in rcar_du_atomic_check_planes()
290 idx = rcar_du_plane_hwalloc(plane, new_plane_state, in rcar_du_atomic_check_planes()
293 dev_dbg(rcdu->dev, "%s: no available hardware plane\n", in rcar_du_atomic_check_planes()
303 group_free_planes[plane->group->index] &= in rcar_du_atomic_check_planes()
307 __func__, plane->group->index, in rcar_du_atomic_check_planes()
308 group_free_planes[plane->group->index]); in rcar_du_atomic_check_planes()
315 * Plane Setup
379 * Similarly, for the second plane, NV12 and NV21 formats seem to in rcar_du_plane_setup_scanout()
416 * For XRGB, set the alpha value to the plane-wide alpha value and in rcar_du_plane_setup_mode()
592 int __rcar_du_plane_atomic_check(struct drm_plane *plane, in __rcar_du_plane_atomic_check() argument
596 struct drm_device *dev = plane->dev; in __rcar_du_plane_atomic_check()
637 static int rcar_du_plane_atomic_check(struct drm_plane *plane, in rcar_du_plane_atomic_check() argument
641 plane); in rcar_du_plane_atomic_check()
644 return __rcar_du_plane_atomic_check(plane, new_plane_state, in rcar_du_plane_atomic_check()
648 static void rcar_du_plane_atomic_update(struct drm_plane *plane, in rcar_du_plane_atomic_update() argument
651 struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane); in rcar_du_plane_atomic_update()
652 struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); in rcar_du_plane_atomic_update()
653 struct rcar_du_plane *rplane = to_rcar_plane(plane); in rcar_du_plane_atomic_update()
684 rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane) in rcar_du_plane_atomic_duplicate_state() argument
689 if (WARN_ON(!plane->state)) in rcar_du_plane_atomic_duplicate_state()
692 state = to_rcar_plane_state(plane->state); in rcar_du_plane_atomic_duplicate_state()
697 __drm_atomic_helper_plane_duplicate_state(plane, ©->state); in rcar_du_plane_atomic_duplicate_state()
702 static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane, in rcar_du_plane_atomic_destroy_state() argument
709 static void rcar_du_plane_reset(struct drm_plane *plane) in rcar_du_plane_reset() argument
713 if (plane->state) { in rcar_du_plane_reset()
714 rcar_du_plane_atomic_destroy_state(plane, plane->state); in rcar_du_plane_reset()
715 plane->state = NULL; in rcar_du_plane_reset()
722 __drm_atomic_helper_plane_reset(plane, &state->state); in rcar_du_plane_reset()
729 static int rcar_du_plane_atomic_set_property(struct drm_plane *plane, in rcar_du_plane_atomic_set_property() argument
735 struct rcar_du_device *rcdu = to_rcar_plane(plane)->group->dev; in rcar_du_plane_atomic_set_property()
745 static int rcar_du_plane_atomic_get_property(struct drm_plane *plane, in rcar_du_plane_atomic_get_property() argument
751 struct rcar_du_device *rcdu = to_rcar_plane(plane)->group->dev; in rcar_du_plane_atomic_get_property()
793 * Create one primary plane per CRTC in this group and seven overlay in rcar_du_planes_init()
804 struct rcar_du_plane *plane = &rgrp->planes[i]; in rcar_du_planes_init() local
806 plane->group = rgrp; in rcar_du_planes_init()
808 ret = drm_universal_plane_init(&rcdu->ddev, &plane->plane, in rcar_du_planes_init()
815 drm_plane_helper_add(&plane->plane, in rcar_du_planes_init()
818 drm_plane_create_alpha_property(&plane->plane); in rcar_du_planes_init()
821 drm_plane_create_zpos_immutable_property(&plane->plane, in rcar_du_planes_init()
824 drm_object_attach_property(&plane->plane.base, in rcar_du_planes_init()
827 drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); in rcar_du_planes_init()