Lines Matching defs:plane
7 * DOC: VC4 plane module
9 * Each DRM plane is a layer of pixels being scanned out by the HVS.
12 * state that would be necessary for displaying the plane (giving us a
13 * chance to figure out if a plane configuration is invalid), then at
267 static struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane)
271 if (WARN_ON(!plane->state))
274 vc4_state = kmemdup(plane->state, sizeof(*vc4_state), GFP_KERNEL);
281 __drm_atomic_helper_plane_duplicate_state(plane, &vc4_state->base);
297 static void vc4_plane_destroy_state(struct drm_plane *plane,
300 struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
316 /* Called during init to allocate the plane's atomic state. */
317 static void vc4_plane_reset(struct drm_plane *plane)
321 WARN_ON(plane->state);
327 __drm_atomic_helper_plane_reset(plane, &vc4_state->base);
361 static u32 vc4_get_scl_field(struct drm_plane_state *state, int plane)
365 switch (vc4_state->x_scaling[plane] << 2 | vc4_state->y_scaling[plane]) {
506 * on the UV plane even if vc4_get_scaling_mode() returned
553 struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev);
661 /* Even if the bandwidth/plane required for a single frame is
668 * calculate the down-scaling factor and multiply the plane
687 struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev);
811 /* Writes out a full display list for an active plane to the plane's
814 static int vc4_plane_mode_set(struct drm_plane *plane,
817 struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
843 * the scaler do the same thing. For YUV, the Y plane needs
1053 /* Don't waste cycles mixing with plane alpha if the set alpha
1240 /* HPPF plane 0 */
1242 /* VPPF plane 0 */
1244 /* HPPF plane 1 */
1246 /* VPPF plane 1 */
1258 /* Background fill might be necessary when the plane has per-pixel
1259 * alpha content or a non-opaque plane alpha and could blend from the
1277 /* If a modeset involves changing the setup of a plane, the atomic
1278 * infrastructure will call this to validate a proposed plane setup.
1279 * However, if a plane isn't getting updated, this (and the
1281 * compute the dlist here and have all active plane dlists get updated
1284 static int vc4_plane_atomic_check(struct drm_plane *plane,
1288 plane);
1297 ret = vc4_plane_mode_set(plane, new_plane_state);
1304 static void vc4_plane_atomic_update(struct drm_plane *plane,
1314 u32 vc4_plane_write_dlist(struct drm_plane *plane, u32 __iomem *dlist)
1316 struct vc4_plane_state *vc4_state = to_vc4_plane_state(plane->state);
1320 if (!drm_dev_enter(plane->dev, &idx))
1342 /* Updates the plane to immediately (well, once the FIFO needs
1345 void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb)
1347 struct vc4_plane_state *vc4_state = to_vc4_plane_state(plane->state);
1352 if (!drm_dev_enter(plane->dev, &idx))
1356 * because this is only called on the primary plane.
1358 WARN_ON_ONCE(plane->state->crtc_x < 0 || plane->state->crtc_y < 0);
1368 * atomic updates that don't do a new modeset on our plane
1376 static void vc4_plane_atomic_async_update(struct drm_plane *plane,
1380 plane);
1384 if (!drm_dev_enter(plane->dev, &idx))
1387 swap(plane->state->fb, new_plane_state->fb);
1388 plane->state->crtc_x = new_plane_state->crtc_x;
1389 plane->state->crtc_y = new_plane_state->crtc_y;
1390 plane->state->crtc_w = new_plane_state->crtc_w;
1391 plane->state->crtc_h = new_plane_state->crtc_h;
1392 plane->state->src_x = new_plane_state->src_x;
1393 plane->state->src_y = new_plane_state->src_y;
1394 plane->state->src_w = new_plane_state->src_w;
1395 plane->state->src_h = new_plane_state->src_h;
1396 plane->state->alpha = new_plane_state->alpha;
1397 plane->state->pixel_blend_mode = new_plane_state->pixel_blend_mode;
1398 plane->state->rotation = new_plane_state->rotation;
1399 plane->state->zpos = new_plane_state->zpos;
1400 plane->state->normalized_zpos = new_plane_state->normalized_zpos;
1401 plane->state->color_encoding = new_plane_state->color_encoding;
1402 plane->state->color_range = new_plane_state->color_range;
1403 plane->state->src = new_plane_state->src;
1404 plane->state->dst = new_plane_state->dst;
1405 plane->state->visible = new_plane_state->visible;
1408 vc4_state = to_vc4_plane_state(plane->state);
1452 static int vc4_plane_atomic_async_check(struct drm_plane *plane,
1456 plane);
1461 ret = vc4_plane_mode_set(plane, new_plane_state);
1465 old_vc4_state = to_vc4_plane_state(plane->state);
1475 vc4_lbm_size(plane->state) != vc4_lbm_size(new_plane_state))
1496 static int vc4_prepare_fb(struct drm_plane *plane,
1506 drm_gem_plane_helper_prepare_fb(plane, state);
1508 if (plane->state->fb == state->fb)
1514 static void vc4_cleanup_fb(struct drm_plane *plane,
1519 if (plane->state->fb == state->fb || !state->fb)
1542 static bool vc4_format_mod_supported(struct drm_plane *plane,
1620 struct drm_plane *plane;
1648 plane = &vc4_plane->base;
1651 drm_plane_helper_add(plane, &vc5_plane_helper_funcs);
1653 drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
1655 drm_plane_create_alpha_property(plane);
1656 drm_plane_create_blend_mode_property(plane,
1660 drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0,
1666 drm_plane_create_color_properties(plane,
1676 drm_plane_create_zpos_immutable_property(plane, 0);
1678 return plane;
1691 * the HVS (16k) and how small an plane can be (28 bytes).
1692 * However, each plane we set up takes up some memory, and
1699 struct drm_plane *plane =
1703 if (IS_ERR(plane))
1707 * 1 cursor plane on a crtc.
1709 drm_plane_create_zpos_property(plane, i + 1, 1,
1715 * since the zpos fallback is that planes are rendered by plane