Lines Matching refs:plane_state

66 static void intel_plane_state_reset(struct intel_plane_state *plane_state,  in intel_plane_state_reset()  argument
69 memset(plane_state, 0, sizeof(*plane_state)); in intel_plane_state_reset()
71 __drm_atomic_helper_plane_state_reset(&plane_state->uapi, &plane->base); in intel_plane_state_reset()
73 plane_state->scaler_id = -1; in intel_plane_state_reset()
78 struct intel_plane_state *plane_state; in intel_plane_alloc() local
85 plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL); in intel_plane_alloc()
86 if (!plane_state) { in intel_plane_alloc()
91 intel_plane_state_reset(plane_state, plane); in intel_plane_alloc()
93 plane->base.state = &plane_state->uapi; in intel_plane_alloc()
163 struct intel_plane_state *plane_state = to_intel_plane_state(state); in intel_plane_destroy_state() local
165 drm_WARN_ON(plane->dev, plane_state->ggtt_vma); in intel_plane_destroy_state()
166 drm_WARN_ON(plane->dev, plane_state->dpt_vma); in intel_plane_destroy_state()
168 __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); in intel_plane_destroy_state()
169 if (plane_state->hw.fb) in intel_plane_destroy_state()
170 drm_framebuffer_put(plane_state->hw.fb); in intel_plane_destroy_state()
171 kfree(plane_state); in intel_plane_destroy_state()
223 const struct intel_plane_state *plane_state) in intel_plane_pixel_rate() argument
237 return intel_adjusted_rate(&plane_state->uapi.src, in intel_plane_pixel_rate()
238 &plane_state->uapi.dst, in intel_plane_pixel_rate()
243 const struct intel_plane_state *plane_state, in intel_plane_data_rate() argument
246 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_data_rate()
248 if (!plane_state->uapi.visible) in intel_plane_data_rate()
251 return intel_plane_pixel_rate(crtc_state, plane_state) * in intel_plane_data_rate()
257 const struct intel_plane_state *plane_state, in intel_plane_relative_data_rate() argument
260 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_plane_relative_data_rate()
261 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_relative_data_rate()
268 if (!plane_state->uapi.visible) in intel_plane_relative_data_rate()
276 width = drm_rect_width(&plane_state->uapi.src) >> 16; in intel_plane_relative_data_rate()
277 height = drm_rect_height(&plane_state->uapi.src) >> 16; in intel_plane_relative_data_rate()
291 return intel_adjusted_rate(&plane_state->uapi.src, in intel_plane_relative_data_rate()
292 &plane_state->uapi.dst, in intel_plane_relative_data_rate()
301 const struct intel_plane_state *plane_state = in intel_plane_calc_min_cdclk() local
303 struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc); in intel_plane_calc_min_cdclk()
308 if (!plane_state->uapi.visible || !plane->min_cdclk) in intel_plane_calc_min_cdclk()
315 plane->min_cdclk(new_crtc_state, plane_state); in intel_plane_calc_min_cdclk()
356 static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state) in intel_plane_clear_hw_state() argument
358 if (plane_state->hw.fb) in intel_plane_clear_hw_state()
359 drm_framebuffer_put(plane_state->hw.fb); in intel_plane_clear_hw_state()
361 memset(&plane_state->hw, 0, sizeof(plane_state->hw)); in intel_plane_clear_hw_state()
383 void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, in intel_plane_copy_uapi_to_hw_state() argument
387 intel_plane_clear_hw_state(plane_state); in intel_plane_copy_uapi_to_hw_state()
395 plane_state->hw.crtc = from_plane_state->uapi.crtc ? &crtc->base : NULL; in intel_plane_copy_uapi_to_hw_state()
397 plane_state->hw.fb = from_plane_state->uapi.fb; in intel_plane_copy_uapi_to_hw_state()
398 if (plane_state->hw.fb) in intel_plane_copy_uapi_to_hw_state()
399 drm_framebuffer_get(plane_state->hw.fb); in intel_plane_copy_uapi_to_hw_state()
401 plane_state->hw.alpha = from_plane_state->uapi.alpha; in intel_plane_copy_uapi_to_hw_state()
402 plane_state->hw.pixel_blend_mode = in intel_plane_copy_uapi_to_hw_state()
404 plane_state->hw.rotation = from_plane_state->uapi.rotation; in intel_plane_copy_uapi_to_hw_state()
405 plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; in intel_plane_copy_uapi_to_hw_state()
406 plane_state->hw.color_range = from_plane_state->uapi.color_range; in intel_plane_copy_uapi_to_hw_state()
407 plane_state->hw.scaling_filter = from_plane_state->uapi.scaling_filter; in intel_plane_copy_uapi_to_hw_state()
409 plane_state->uapi.src = drm_plane_state_src(&from_plane_state->uapi); in intel_plane_copy_uapi_to_hw_state()
410 plane_state->uapi.dst = drm_plane_state_dest(&from_plane_state->uapi); in intel_plane_copy_uapi_to_hw_state()
413 void intel_plane_copy_hw_state(struct intel_plane_state *plane_state, in intel_plane_copy_hw_state() argument
416 intel_plane_clear_hw_state(plane_state); in intel_plane_copy_hw_state()
418 memcpy(&plane_state->hw, &from_plane_state->hw, in intel_plane_copy_hw_state()
419 sizeof(plane_state->hw)); in intel_plane_copy_hw_state()
421 if (plane_state->hw.fb) in intel_plane_copy_hw_state()
422 drm_framebuffer_get(plane_state->hw.fb); in intel_plane_copy_hw_state()
426 struct intel_plane_state *plane_state) in intel_plane_set_invisible() argument
428 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_plane_set_invisible()
441 plane_state->uapi.visible = false; in intel_plane_set_invisible()
444 static bool intel_plane_is_scaled(const struct intel_plane_state *plane_state) in intel_plane_is_scaled() argument
446 int src_w = drm_rect_width(&plane_state->uapi.src) >> 16; in intel_plane_is_scaled()
447 int src_h = drm_rect_height(&plane_state->uapi.src) >> 16; in intel_plane_is_scaled()
448 int dst_w = drm_rect_width(&plane_state->uapi.dst); in intel_plane_is_scaled()
449 int dst_h = drm_rect_height(&plane_state->uapi.dst); in intel_plane_is_scaled()
801 struct intel_plane_state __maybe_unused *plane_state; in skl_next_plane_to_commit() local
808 for_each_new_intel_plane_in_state(state, plane, plane_state, i) { in skl_next_plane_to_commit()
837 const struct intel_plane_state *plane_state) in intel_plane_update_noarm() argument
841 trace_intel_plane_update_noarm(plane_state, crtc); in intel_plane_update_noarm()
847 plane->update_noarm(dsb, plane, crtc_state, plane_state); in intel_plane_update_noarm()
853 const struct intel_plane_state *plane_state, in intel_plane_async_flip() argument
859 plane->async_flip(dsb, plane, crtc_state, plane_state, async_flip); in intel_plane_async_flip()
865 const struct intel_plane_state *plane_state) in intel_plane_update_arm() argument
870 intel_plane_async_flip(dsb, plane, crtc_state, plane_state, true); in intel_plane_update_arm()
874 trace_intel_plane_update_arm(plane_state, crtc); in intel_plane_update_arm()
875 plane->update_arm(dsb, plane, crtc_state, plane_state); in intel_plane_update_arm()
992 int intel_plane_check_clipping(struct intel_plane_state *plane_state, in intel_plane_check_clipping() argument
997 struct intel_display *display = to_intel_display(plane_state); in intel_plane_check_clipping()
998 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_plane_check_clipping()
999 struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_check_clipping()
1000 struct drm_rect *src = &plane_state->uapi.src; in intel_plane_check_clipping()
1001 struct drm_rect *dst = &plane_state->uapi.dst; in intel_plane_check_clipping()
1003 unsigned int rotation = plane_state->hw.rotation; in intel_plane_check_clipping()
1007 plane_state->uapi.visible = false; in intel_plane_check_clipping()
1028 plane_state->uapi.visible = drm_rect_clip_scaled(src, dst, clip); in intel_plane_check_clipping()
1032 if (!can_position && plane_state->uapi.visible && in intel_plane_check_clipping()
1047 int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state) in intel_plane_check_src_coordinates() argument
1049 struct intel_display *display = to_intel_display(plane_state); in intel_plane_check_src_coordinates()
1050 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_plane_check_src_coordinates()
1051 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_check_src_coordinates()
1052 struct drm_rect *src = &plane_state->uapi.src; in intel_plane_check_src_coordinates()
1054 bool rotated = drm_rotation_90_or_270(plane_state->hw.rotation); in intel_plane_check_src_coordinates()
1323 struct intel_plane_state *plane_state = to_intel_plane_state(plane->state); in intel_panic_flush() local
1327 struct drm_framebuffer *fb = plane_state->hw.fb; in intel_panic_flush()
1383 struct intel_plane_state *plane_state; in intel_get_scanout_buffer() local
1392 plane_state = to_intel_plane_state(plane->state); in intel_get_scanout_buffer()
1393 fb = plane_state->hw.fb; in intel_get_scanout_buffer()
1497 struct intel_plane_state *plane_state) in unlink_nv12_plane() argument
1499 struct intel_display *display = to_intel_display(plane_state); in unlink_nv12_plane()
1500 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in unlink_nv12_plane()
1502 plane_state->planar_linked_plane = NULL; in unlink_nv12_plane()
1504 if (!plane_state->is_y_plane) in unlink_nv12_plane()
1507 drm_WARN_ON(display->drm, plane_state->uapi.visible); in unlink_nv12_plane()
1509 plane_state->is_y_plane = false; in unlink_nv12_plane()
1524 struct intel_plane_state *plane_state; in icl_check_nv12_planes() local
1535 for_each_new_intel_plane_in_state(state, plane, plane_state, i) { in icl_check_nv12_planes()
1539 if (plane_state->planar_linked_plane) in icl_check_nv12_planes()
1540 unlink_nv12_plane(crtc_state, plane_state); in icl_check_nv12_planes()
1546 for_each_new_intel_plane_in_state(state, plane, plane_state, i) { in icl_check_nv12_planes()
1578 link_nv12_planes(crtc_state, plane_state, y_plane_state); in icl_check_nv12_planes()
1592 struct intel_plane_state *plane_state; in intel_crtc_add_planes_to_state() local
1597 plane_state = intel_atomic_get_plane_state(state, plane); in intel_crtc_add_planes_to_state()
1598 if (IS_ERR(plane_state)) in intel_crtc_add_planes_to_state()
1599 return PTR_ERR(plane_state); in intel_crtc_add_planes_to_state()
1629 const struct intel_plane_state *plane_state; in intel_joiner_affected_planes() local
1634 for_each_new_intel_plane_in_state(state, plane, plane_state, i) { in intel_joiner_affected_planes()
1635 struct intel_plane *linked = plane_state->planar_linked_plane; in intel_joiner_affected_planes()
1704 struct intel_plane_state __maybe_unused *plane_state; in intel_plane_atomic_check() local
1713 for_each_new_intel_plane_in_state(state, plane, plane_state, i) { in intel_plane_atomic_check()
1753 u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state) in intel_plane_ggtt_offset() argument
1755 return i915_ggtt_offset(plane_state->ggtt_vma); in intel_plane_ggtt_offset()