Lines Matching refs:plane_state

53 static void intel_plane_state_reset(struct intel_plane_state *plane_state,  in intel_plane_state_reset()  argument
56 memset(plane_state, 0, sizeof(*plane_state)); in intel_plane_state_reset()
58 __drm_atomic_helper_plane_state_reset(&plane_state->uapi, &plane->base); in intel_plane_state_reset()
60 plane_state->scaler_id = -1; in intel_plane_state_reset()
65 struct intel_plane_state *plane_state; in intel_plane_alloc() local
72 plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL); in intel_plane_alloc()
73 if (!plane_state) { in intel_plane_alloc()
78 intel_plane_state_reset(plane_state, plane); in intel_plane_alloc()
80 plane->base.state = &plane_state->uapi; in intel_plane_alloc()
136 struct intel_plane_state *plane_state = to_intel_plane_state(state); in intel_plane_destroy_state() local
138 drm_WARN_ON(plane->dev, plane_state->ggtt_vma); in intel_plane_destroy_state()
139 drm_WARN_ON(plane->dev, plane_state->dpt_vma); in intel_plane_destroy_state()
141 __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); in intel_plane_destroy_state()
142 if (plane_state->hw.fb) in intel_plane_destroy_state()
143 drm_framebuffer_put(plane_state->hw.fb); in intel_plane_destroy_state()
144 kfree(plane_state); in intel_plane_destroy_state()
167 const struct intel_plane_state *plane_state) in intel_plane_pixel_rate() argument
181 return intel_adjusted_rate(&plane_state->uapi.src, in intel_plane_pixel_rate()
182 &plane_state->uapi.dst, in intel_plane_pixel_rate()
187 const struct intel_plane_state *plane_state, in intel_plane_data_rate() argument
190 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_data_rate()
192 if (!plane_state->uapi.visible) in intel_plane_data_rate()
195 return intel_plane_pixel_rate(crtc_state, plane_state) * in intel_plane_data_rate()
212 const struct intel_plane_state *plane_state, in intel_plane_relative_data_rate() argument
215 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_plane_relative_data_rate()
216 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_relative_data_rate()
223 if (!plane_state->uapi.visible) in intel_plane_relative_data_rate()
239 width = drm_rect_width(&plane_state->uapi.src) >> 16; in intel_plane_relative_data_rate()
240 height = drm_rect_height(&plane_state->uapi.src) >> 16; in intel_plane_relative_data_rate()
250 return intel_adjusted_rate(&plane_state->uapi.src, in intel_plane_relative_data_rate()
251 &plane_state->uapi.dst, in intel_plane_relative_data_rate()
260 const struct intel_plane_state *plane_state = in intel_plane_calc_min_cdclk() local
262 struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc); in intel_plane_calc_min_cdclk()
267 if (!plane_state->uapi.visible || !plane->min_cdclk) in intel_plane_calc_min_cdclk()
274 plane->min_cdclk(new_crtc_state, plane_state); in intel_plane_calc_min_cdclk()
315 static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state) in intel_plane_clear_hw_state() argument
317 if (plane_state->hw.fb) in intel_plane_clear_hw_state()
318 drm_framebuffer_put(plane_state->hw.fb); in intel_plane_clear_hw_state()
320 memset(&plane_state->hw, 0, sizeof(plane_state->hw)); in intel_plane_clear_hw_state()
323 void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, in intel_plane_copy_uapi_to_hw_state() argument
327 intel_plane_clear_hw_state(plane_state); in intel_plane_copy_uapi_to_hw_state()
335 plane_state->hw.crtc = from_plane_state->uapi.crtc ? &crtc->base : NULL; in intel_plane_copy_uapi_to_hw_state()
337 plane_state->hw.fb = from_plane_state->uapi.fb; in intel_plane_copy_uapi_to_hw_state()
338 if (plane_state->hw.fb) in intel_plane_copy_uapi_to_hw_state()
339 drm_framebuffer_get(plane_state->hw.fb); in intel_plane_copy_uapi_to_hw_state()
341 plane_state->hw.alpha = from_plane_state->uapi.alpha; in intel_plane_copy_uapi_to_hw_state()
342 plane_state->hw.pixel_blend_mode = in intel_plane_copy_uapi_to_hw_state()
344 plane_state->hw.rotation = from_plane_state->uapi.rotation; in intel_plane_copy_uapi_to_hw_state()
345 plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; in intel_plane_copy_uapi_to_hw_state()
346 plane_state->hw.color_range = from_plane_state->uapi.color_range; in intel_plane_copy_uapi_to_hw_state()
347 plane_state->hw.scaling_filter = from_plane_state->uapi.scaling_filter; in intel_plane_copy_uapi_to_hw_state()
349 plane_state->uapi.src = drm_plane_state_src(&from_plane_state->uapi); in intel_plane_copy_uapi_to_hw_state()
350 plane_state->uapi.dst = drm_plane_state_dest(&from_plane_state->uapi); in intel_plane_copy_uapi_to_hw_state()
353 void intel_plane_copy_hw_state(struct intel_plane_state *plane_state, in intel_plane_copy_hw_state() argument
356 intel_plane_clear_hw_state(plane_state); in intel_plane_copy_hw_state()
358 memcpy(&plane_state->hw, &from_plane_state->hw, in intel_plane_copy_hw_state()
359 sizeof(plane_state->hw)); in intel_plane_copy_hw_state()
361 if (plane_state->hw.fb) in intel_plane_copy_hw_state()
362 drm_framebuffer_get(plane_state->hw.fb); in intel_plane_copy_hw_state()
366 struct intel_plane_state *plane_state) in intel_plane_set_invisible() argument
368 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_plane_set_invisible()
381 plane_state->uapi.visible = false; in intel_plane_set_invisible()
406 static bool intel_plane_is_scaled(const struct intel_plane_state *plane_state) in intel_plane_is_scaled() argument
408 int src_w = drm_rect_width(&plane_state->uapi.src) >> 16; in intel_plane_is_scaled()
409 int src_h = drm_rect_height(&plane_state->uapi.src) >> 16; in intel_plane_is_scaled()
410 int dst_w = drm_rect_width(&plane_state->uapi.dst); in intel_plane_is_scaled()
411 int dst_h = drm_rect_height(&plane_state->uapi.dst); in intel_plane_is_scaled()
733 struct intel_plane_state __maybe_unused *plane_state; in skl_next_plane_to_commit() local
740 for_each_new_intel_plane_in_state(state, plane, plane_state, i) { in skl_next_plane_to_commit()
768 const struct intel_plane_state *plane_state) in intel_plane_update_noarm() argument
775 plane->update_noarm(plane, crtc_state, plane_state); in intel_plane_update_noarm()
780 const struct intel_plane_state *plane_state) in intel_plane_update_arm() argument
787 plane->async_flip(plane, crtc_state, plane_state, true); in intel_plane_update_arm()
789 plane->update_arm(plane, crtc_state, plane_state); in intel_plane_update_arm()
900 int intel_atomic_plane_check_clipping(struct intel_plane_state *plane_state, in intel_atomic_plane_check_clipping() argument
905 struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); in intel_atomic_plane_check_clipping()
906 struct drm_framebuffer *fb = plane_state->hw.fb; in intel_atomic_plane_check_clipping()
907 struct drm_rect *src = &plane_state->uapi.src; in intel_atomic_plane_check_clipping()
908 struct drm_rect *dst = &plane_state->uapi.dst; in intel_atomic_plane_check_clipping()
910 unsigned int rotation = plane_state->hw.rotation; in intel_atomic_plane_check_clipping()
914 plane_state->uapi.visible = false; in intel_atomic_plane_check_clipping()
934 plane_state->uapi.visible = drm_rect_clip_scaled(src, dst, clip); in intel_atomic_plane_check_clipping()
938 if (!can_position && plane_state->uapi.visible && in intel_atomic_plane_check_clipping()
952 int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state) in intel_plane_check_src_coordinates() argument
954 struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); in intel_plane_check_src_coordinates()
955 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_check_src_coordinates()
956 struct drm_rect *src = &plane_state->uapi.src; in intel_plane_check_src_coordinates()
958 bool rotated = drm_rotation_90_or_270(plane_state->hw.rotation); in intel_plane_check_src_coordinates()