Lines Matching refs:plane_state
31 static u32 intel_cursor_base(const struct intel_plane_state *plane_state) in intel_cursor_base() argument
34 to_i915(plane_state->uapi.plane->dev); in intel_cursor_base()
35 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_cursor_base()
42 base = intel_plane_ggtt_offset(plane_state); in intel_cursor_base()
44 return base + plane_state->view.color_plane[0].offset; in intel_cursor_base()
47 static u32 intel_cursor_position(const struct intel_plane_state *plane_state) in intel_cursor_position() argument
49 int x = plane_state->uapi.dst.x1; in intel_cursor_position()
50 int y = plane_state->uapi.dst.y1; in intel_cursor_position()
68 static bool intel_cursor_size_ok(const struct intel_plane_state *plane_state) in intel_cursor_size_ok() argument
71 &plane_state->uapi.plane->dev->mode_config; in intel_cursor_size_ok()
72 int width = drm_rect_width(&plane_state->uapi.dst); in intel_cursor_size_ok()
73 int height = drm_rect_height(&plane_state->uapi.dst); in intel_cursor_size_ok()
79 static int intel_cursor_check_surface(struct intel_plane_state *plane_state) in intel_cursor_check_surface() argument
82 to_i915(plane_state->uapi.plane->dev); in intel_cursor_check_surface()
83 unsigned int rotation = plane_state->hw.rotation; in intel_cursor_check_surface()
88 ret = intel_plane_compute_gtt(plane_state); in intel_cursor_check_surface()
92 if (!plane_state->uapi.visible) in intel_cursor_check_surface()
95 src_x = plane_state->uapi.src.x1 >> 16; in intel_cursor_check_surface()
96 src_y = plane_state->uapi.src.y1 >> 16; in intel_cursor_check_surface()
98 intel_add_fb_offsets(&src_x, &src_y, plane_state, 0); in intel_cursor_check_surface()
100 plane_state, 0); in intel_cursor_check_surface()
112 drm_rect_translate_to(&plane_state->uapi.src, in intel_cursor_check_surface()
117 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_cursor_check_surface()
118 int src_w = drm_rect_width(&plane_state->uapi.src) >> 16; in intel_cursor_check_surface()
119 int src_h = drm_rect_height(&plane_state->uapi.src) >> 16; in intel_cursor_check_surface()
124 plane_state->view.color_plane[0].offset = offset; in intel_cursor_check_surface()
125 plane_state->view.color_plane[0].x = src_x; in intel_cursor_check_surface()
126 plane_state->view.color_plane[0].y = src_y; in intel_cursor_check_surface()
132 struct intel_plane_state *plane_state) in intel_check_cursor() argument
134 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_check_cursor()
135 struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); in intel_check_cursor()
136 const struct drm_rect src = plane_state->uapi.src; in intel_check_cursor()
137 const struct drm_rect dst = plane_state->uapi.dst; in intel_check_cursor()
145 ret = intel_atomic_plane_check_clipping(plane_state, crtc_state, in intel_check_cursor()
153 plane_state->uapi.src = src; in intel_check_cursor()
154 plane_state->uapi.dst = dst; in intel_check_cursor()
157 drm_rect_translate(&plane_state->uapi.dst, in intel_check_cursor()
161 ret = intel_cursor_check_surface(plane_state); in intel_check_cursor()
165 if (!plane_state->uapi.visible) in intel_check_cursor()
168 ret = intel_plane_check_src_coordinates(plane_state); in intel_check_cursor()
194 const struct intel_plane_state *plane_state) in i845_cursor_ctl() argument
198 CURSOR_STRIDE(plane_state->view.color_plane[0].mapping_stride); in i845_cursor_ctl()
201 static bool i845_cursor_size_ok(const struct intel_plane_state *plane_state) in i845_cursor_size_ok() argument
203 int width = drm_rect_width(&plane_state->uapi.dst); in i845_cursor_size_ok()
209 return intel_cursor_size_ok(plane_state) && IS_ALIGNED(width, 64); in i845_cursor_size_ok()
213 struct intel_plane_state *plane_state) in i845_check_cursor() argument
215 const struct drm_framebuffer *fb = plane_state->hw.fb; in i845_check_cursor()
216 struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev); in i845_check_cursor()
219 ret = intel_check_cursor(crtc_state, plane_state); in i845_check_cursor()
228 if (!i845_cursor_size_ok(plane_state)) { in i845_check_cursor()
231 drm_rect_width(&plane_state->uapi.dst), in i845_check_cursor()
232 drm_rect_height(&plane_state->uapi.dst)); in i845_check_cursor()
236 drm_WARN_ON(&i915->drm, plane_state->uapi.visible && in i845_check_cursor()
237 plane_state->view.color_plane[0].mapping_stride != fb->pitches[0]); in i845_check_cursor()
251 plane_state->ctl = i845_cursor_ctl(crtc_state, plane_state); in i845_check_cursor()
259 const struct intel_plane_state *plane_state) in i845_cursor_update_arm() argument
264 if (plane_state && plane_state->uapi.visible) { in i845_cursor_update_arm()
265 unsigned int width = drm_rect_width(&plane_state->uapi.dst); in i845_cursor_update_arm()
266 unsigned int height = drm_rect_height(&plane_state->uapi.dst); in i845_cursor_update_arm()
268 cntl = plane_state->ctl | in i845_cursor_update_arm()
273 base = intel_cursor_base(plane_state); in i845_cursor_update_arm()
274 pos = intel_cursor_position(plane_state); in i845_cursor_update_arm()
355 const struct intel_plane_state *plane_state) in i9xx_cursor_ctl() argument
358 to_i915(plane_state->uapi.plane->dev); in i9xx_cursor_ctl()
364 switch (drm_rect_width(&plane_state->uapi.dst)) { in i9xx_cursor_ctl()
375 MISSING_CASE(drm_rect_width(&plane_state->uapi.dst)); in i9xx_cursor_ctl()
379 if (plane_state->hw.rotation & DRM_MODE_ROTATE_180) in i9xx_cursor_ctl()
389 static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state) in i9xx_cursor_size_ok() argument
392 to_i915(plane_state->uapi.plane->dev); in i9xx_cursor_size_ok()
393 int width = drm_rect_width(&plane_state->uapi.dst); in i9xx_cursor_size_ok()
394 int height = drm_rect_height(&plane_state->uapi.dst); in i9xx_cursor_size_ok()
396 if (!intel_cursor_size_ok(plane_state)) in i9xx_cursor_size_ok()
416 plane_state->hw.rotation & DRM_MODE_ROTATE_0) { in i9xx_cursor_size_ok()
428 struct intel_plane_state *plane_state) in i9xx_check_cursor() argument
430 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in i9xx_check_cursor()
432 const struct drm_framebuffer *fb = plane_state->hw.fb; in i9xx_check_cursor()
436 ret = intel_check_cursor(crtc_state, plane_state); in i9xx_check_cursor()
445 if (!i9xx_cursor_size_ok(plane_state)) { in i9xx_check_cursor()
448 drm_rect_width(&plane_state->uapi.dst), in i9xx_check_cursor()
449 drm_rect_height(&plane_state->uapi.dst)); in i9xx_check_cursor()
453 drm_WARN_ON(&dev_priv->drm, plane_state->uapi.visible && in i9xx_check_cursor()
454 plane_state->view.color_plane[0].mapping_stride != fb->pitches[0]); in i9xx_check_cursor()
457 drm_rect_width(&plane_state->uapi.dst) * fb->format->cpp[0]) { in i9xx_check_cursor()
461 drm_rect_width(&plane_state->uapi.dst)); in i9xx_check_cursor()
476 plane_state->uapi.visible && plane_state->uapi.dst.x1 < 0) { in i9xx_check_cursor()
482 plane_state->ctl = i9xx_cursor_ctl(crtc_state, plane_state); in i9xx_check_cursor()
490 const struct intel_plane_state *plane_state) in i9xx_cursor_update_arm() argument
496 if (plane_state && plane_state->uapi.visible) { in i9xx_cursor_update_arm()
497 int width = drm_rect_width(&plane_state->uapi.dst); in i9xx_cursor_update_arm()
498 int height = drm_rect_height(&plane_state->uapi.dst); in i9xx_cursor_update_arm()
500 cntl = plane_state->ctl | in i9xx_cursor_update_arm()
506 base = intel_cursor_base(plane_state); in i9xx_cursor_update_arm()
507 pos = intel_cursor_position(plane_state); in i9xx_cursor_update_arm()
533 if (plane_state) in i9xx_cursor_update_arm()
534 intel_psr2_program_plane_sel_fetch(plane, crtc_state, plane_state, 0); in i9xx_cursor_update_arm()