Lines Matching refs:state

12  * state that would be necessary for displaying the plane (giving us a
14 * atomic flush time the CRTC will ask us to write our element state
262 static bool plane_enabled(struct drm_plane_state *state)
264 return state->fb && !WARN_ON(!state->crtc);
271 if (WARN_ON(!plane->state))
274 vc4_state = kmemdup(plane->state, sizeof(*vc4_state), GFP_KERNEL);
298 struct drm_plane_state *state)
301 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
313 kfree(state);
316 /* Called during init to allocate the plane's atomic state. */
321 WARN_ON(plane->state);
361 static u32 vc4_get_scl_field(struct drm_plane_state *state, int plane)
363 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
397 crtc_state = drm_atomic_get_new_crtc_state(pstate->state,
437 static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
439 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
440 struct drm_framebuffer *fb = state->fb;
448 crtc_state = drm_atomic_get_existing_crtc_state(state->state,
449 state->crtc);
451 DRM_DEBUG_KMS("Invalid crtc state\n");
455 ret = drm_atomic_helper_check_plane_state(state, crtc_state, 1,
470 vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1 << 16);
471 vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1 << 16);
472 vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1 << 16) - vc4_state->src_x;
473 vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1 << 16) - vc4_state->src_y;
475 vc4_state->crtc_x = state->dst.x1;
476 vc4_state->crtc_y = state->dst.y1;
477 vc4_state->crtc_w = state->dst.x2 - state->dst.x1;
478 vc4_state->crtc_h = state->dst.y2 - state->dst.y1;
480 ret = vc4_plane_margins_adj(state);
550 static u32 vc4_lbm_size(struct drm_plane_state *state)
552 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
553 struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev);
598 static void vc4_write_scaling_parameters(struct drm_plane_state *state,
601 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
630 static void vc4_plane_calc_load(struct drm_plane_state *state)
633 struct drm_framebuffer *fb = state->fb;
638 vc4_state = to_vc4_plane_state(state);
639 crtc_state = drm_atomic_get_existing_crtc_state(state->state,
640 state->crtc);
685 static int vc4_plane_allocate_lbm(struct drm_plane_state *state)
687 struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev);
688 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
692 lbm_size = vc4_lbm_size(state);
769 static u32 vc4_hvs4_get_alpha_blend_mode(struct drm_plane_state *state)
771 if (!state->fb->format->has_alpha)
775 switch (state->pixel_blend_mode) {
790 static u32 vc4_hvs5_get_alpha_blend_mode(struct drm_plane_state *state)
792 if (!state->fb->format->has_alpha)
796 switch (state->pixel_blend_mode) {
812 * private dlist state.
815 struct drm_plane_state *state)
818 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
819 struct drm_framebuffer *fb = state->fb;
837 ret = vc4_plane_setup_clipping_and_scaling(state);
848 scl0 = vc4_get_scl_field(state, 0);
851 scl0 = vc4_get_scl_field(state, 1);
852 scl1 = vc4_get_scl_field(state, 0);
855 rotation = drm_rotation_simplify(state->rotation,
1057 mix_plane_alpha = state->alpha != DRM_BLEND_ALPHA_OPAQUE &&
1077 VC4_SET_FIELD(state->alpha >> 8, SCALER_POS0_FIXED_ALPHA) |
1094 vc4_hvs4_get_alpha_blend_mode(state) |
1132 VC4_SET_FIELD(state->alpha >> 4,
1134 vc4_hvs5_get_alpha_blend_mode(state) |
1190 enum drm_color_encoding color_encoding = state->color_encoding;
1191 enum drm_color_range color_range = state->color_range;
1226 vc4_write_scaling_parameters(state, 1);
1228 vc4_write_scaling_parameters(state, 0);
1256 vc4_state->crtc_w == state->crtc->mode.hdisplay &&
1257 vc4_state->crtc_h == state->crtc->mode.vdisplay;
1263 state->alpha != DRM_BLEND_ALPHA_OPAQUE;
1272 vc4_plane_calc_load(state);
1285 struct drm_atomic_state *state)
1287 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
1305 struct drm_atomic_state *state)
1316 struct vc4_plane_state *vc4_state = to_vc4_plane_state(plane->state);
1335 u32 vc4_plane_dlist_size(const struct drm_plane_state *state)
1337 const struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
1347 struct vc4_plane_state *vc4_state = to_vc4_plane_state(plane->state);
1358 WARN_ON_ONCE(plane->state->crtc_x < 0 || plane->state->crtc_y < 0);
1377 struct drm_atomic_state *state)
1379 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
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);
1453 struct drm_atomic_state *state)
1455 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
1465 old_vc4_state = to_vc4_plane_state(plane->state);
1475 vc4_lbm_size(plane->state) != vc4_lbm_size(new_plane_state))
1497 struct drm_plane_state *state)
1501 if (!state->fb)
1504 bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base);
1506 drm_gem_plane_helper_prepare_fb(plane, state);
1508 if (plane->state->fb == state->fb)
1515 struct drm_plane_state *state)
1519 if (plane->state->fb == state->fb || !state->fb)
1522 bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base);