Lines Matching refs:plane_state
36 static u32 intel_cursor_base(const struct intel_plane_state *plane_state) in intel_cursor_base() argument
38 struct intel_display *display = to_intel_display(plane_state); in intel_cursor_base()
42 base = plane_state->phys_dma_addr; in intel_cursor_base()
44 base = intel_plane_ggtt_offset(plane_state); in intel_cursor_base()
46 return base + plane_state->view.color_plane[0].offset; in intel_cursor_base()
50 const struct intel_plane_state *plane_state, in intel_cursor_position() argument
53 int x = plane_state->uapi.dst.x1; in intel_cursor_position()
54 int y = plane_state->uapi.dst.y1; in intel_cursor_position()
63 y = max(-1 * drm_rect_height(&plane_state->uapi.dst) + 1, in intel_cursor_position()
81 static bool intel_cursor_size_ok(const struct intel_plane_state *plane_state) in intel_cursor_size_ok() argument
84 &plane_state->uapi.plane->dev->mode_config; in intel_cursor_size_ok()
85 int width = drm_rect_width(&plane_state->uapi.dst); in intel_cursor_size_ok()
86 int height = drm_rect_height(&plane_state->uapi.dst); in intel_cursor_size_ok()
92 static int intel_cursor_check_surface(struct intel_plane_state *plane_state) in intel_cursor_check_surface() argument
94 struct intel_display *display = to_intel_display(plane_state); in intel_cursor_check_surface()
95 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_cursor_check_surface()
96 unsigned int rotation = plane_state->hw.rotation; in intel_cursor_check_surface()
101 ret = intel_plane_compute_gtt(plane_state); in intel_cursor_check_surface()
105 if (!plane_state->uapi.visible) in intel_cursor_check_surface()
108 src_x = plane_state->uapi.src.x1 >> 16; in intel_cursor_check_surface()
109 src_y = plane_state->uapi.src.y1 >> 16; in intel_cursor_check_surface()
111 intel_add_fb_offsets(&src_x, &src_y, plane_state, 0); in intel_cursor_check_surface()
113 plane_state, 0); in intel_cursor_check_surface()
126 drm_rect_translate_to(&plane_state->uapi.src, in intel_cursor_check_surface()
131 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_cursor_check_surface()
132 int src_w = drm_rect_width(&plane_state->uapi.src) >> 16; in intel_cursor_check_surface()
133 int src_h = drm_rect_height(&plane_state->uapi.src) >> 16; in intel_cursor_check_surface()
138 plane_state->view.color_plane[0].offset = offset; in intel_cursor_check_surface()
139 plane_state->view.color_plane[0].x = src_x; in intel_cursor_check_surface()
140 plane_state->view.color_plane[0].y = src_y; in intel_cursor_check_surface()
146 struct intel_plane_state *plane_state) in intel_check_cursor() argument
148 struct intel_display *display = to_intel_display(plane_state); in intel_check_cursor()
149 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_check_cursor()
150 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_check_cursor()
151 const struct drm_rect src = plane_state->uapi.src; in intel_check_cursor()
152 const struct drm_rect dst = plane_state->uapi.dst; in intel_check_cursor()
161 ret = intel_plane_check_clipping(plane_state, crtc_state, in intel_check_cursor()
169 plane_state->uapi.src = src; in intel_check_cursor()
170 plane_state->uapi.dst = dst; in intel_check_cursor()
173 drm_rect_translate(&plane_state->uapi.dst, in intel_check_cursor()
177 ret = intel_cursor_check_surface(plane_state); in intel_check_cursor()
181 if (!plane_state->uapi.visible) in intel_check_cursor()
184 ret = intel_plane_check_src_coordinates(plane_state); in intel_check_cursor()
217 const struct intel_plane_state *plane_state) in i845_cursor_ctl() argument
221 CURSOR_STRIDE(plane_state->view.color_plane[0].mapping_stride); in i845_cursor_ctl()
224 static bool i845_cursor_size_ok(const struct intel_plane_state *plane_state) in i845_cursor_size_ok() argument
226 int width = drm_rect_width(&plane_state->uapi.dst); in i845_cursor_size_ok()
232 return intel_cursor_size_ok(plane_state) && IS_ALIGNED(width, 64); in i845_cursor_size_ok()
236 struct intel_plane_state *plane_state) in i845_check_cursor() argument
238 struct intel_display *display = to_intel_display(plane_state); in i845_check_cursor()
239 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in i845_check_cursor()
240 const struct drm_framebuffer *fb = plane_state->hw.fb; in i845_check_cursor()
243 ret = intel_check_cursor(crtc_state, plane_state); in i845_check_cursor()
252 if (!i845_cursor_size_ok(plane_state)) { in i845_check_cursor()
256 drm_rect_width(&plane_state->uapi.dst), in i845_check_cursor()
257 drm_rect_height(&plane_state->uapi.dst)); in i845_check_cursor()
261 drm_WARN_ON(display->drm, plane_state->uapi.visible && in i845_check_cursor()
262 plane_state->view.color_plane[0].mapping_stride != fb->pitches[0]); in i845_check_cursor()
277 plane_state->ctl = i845_cursor_ctl(crtc_state, plane_state); in i845_check_cursor()
286 const struct intel_plane_state *plane_state) in i845_cursor_update_arm() argument
291 if (plane_state && plane_state->uapi.visible) { in i845_cursor_update_arm()
292 unsigned int width = drm_rect_width(&plane_state->uapi.dst); in i845_cursor_update_arm()
293 unsigned int height = drm_rect_height(&plane_state->uapi.dst); in i845_cursor_update_arm()
295 cntl = plane_state->ctl | in i845_cursor_update_arm()
300 base = intel_cursor_base(plane_state); in i845_cursor_update_arm()
301 pos = intel_cursor_position(crtc_state, plane_state, false); in i845_cursor_update_arm()
410 const struct intel_plane_state *plane_state) in i9xx_cursor_ctl() argument
412 struct intel_display *display = to_intel_display(plane_state); in i9xx_cursor_ctl()
418 switch (drm_rect_width(&plane_state->uapi.dst)) { in i9xx_cursor_ctl()
429 MISSING_CASE(drm_rect_width(&plane_state->uapi.dst)); in i9xx_cursor_ctl()
433 if (plane_state->hw.rotation & DRM_MODE_ROTATE_180) in i9xx_cursor_ctl()
443 static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state) in i9xx_cursor_size_ok() argument
445 struct intel_display *display = to_intel_display(plane_state); in i9xx_cursor_size_ok()
446 int width = drm_rect_width(&plane_state->uapi.dst); in i9xx_cursor_size_ok()
447 int height = drm_rect_height(&plane_state->uapi.dst); in i9xx_cursor_size_ok()
449 if (!intel_cursor_size_ok(plane_state)) in i9xx_cursor_size_ok()
469 plane_state->hw.rotation & DRM_MODE_ROTATE_0) { in i9xx_cursor_size_ok()
481 struct intel_plane_state *plane_state) in i9xx_check_cursor() argument
483 struct intel_display *display = to_intel_display(plane_state); in i9xx_check_cursor()
484 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in i9xx_check_cursor()
485 const struct drm_framebuffer *fb = plane_state->hw.fb; in i9xx_check_cursor()
489 ret = intel_check_cursor(crtc_state, plane_state); in i9xx_check_cursor()
498 if (!i9xx_cursor_size_ok(plane_state)) { in i9xx_check_cursor()
502 drm_rect_width(&plane_state->uapi.dst), in i9xx_check_cursor()
503 drm_rect_height(&plane_state->uapi.dst)); in i9xx_check_cursor()
507 drm_WARN_ON(display->drm, plane_state->uapi.visible && in i9xx_check_cursor()
508 plane_state->view.color_plane[0].mapping_stride != fb->pitches[0]); in i9xx_check_cursor()
511 drm_rect_width(&plane_state->uapi.dst) * fb->format->cpp[0]) { in i9xx_check_cursor()
515 fb->pitches[0], drm_rect_width(&plane_state->uapi.dst)); in i9xx_check_cursor()
530 plane_state->uapi.visible && plane_state->uapi.dst.x1 < 0) { in i9xx_check_cursor()
537 plane_state->ctl = i9xx_cursor_ctl(crtc_state, plane_state); in i9xx_check_cursor()
558 const struct intel_plane_state *plane_state) in wa_16021440873() argument
561 u32 ctl = plane_state->ctl; in wa_16021440873()
577 const struct intel_plane_state *plane_state) in i9xx_cursor_update_sel_fetch_arm() argument
585 if (drm_rect_height(&plane_state->psr2_sel_fetch_area) > 0) { in i9xx_cursor_update_sel_fetch_arm()
587 u32 val = intel_cursor_position(crtc_state, plane_state, in i9xx_cursor_update_sel_fetch_arm()
593 intel_de_write_dsb(display, dsb, SEL_FETCH_CUR_CTL(pipe), plane_state->ctl); in i9xx_cursor_update_sel_fetch_arm()
597 wa_16021440873(dsb, plane, crtc_state, plane_state); in i9xx_cursor_update_sel_fetch_arm()
662 const struct intel_plane_state *plane_state) in i9xx_cursor_update_arm() argument
668 if (plane_state && plane_state->uapi.visible) { in i9xx_cursor_update_arm()
669 int width = drm_rect_width(&plane_state->uapi.dst); in i9xx_cursor_update_arm()
670 int height = drm_rect_height(&plane_state->uapi.dst); in i9xx_cursor_update_arm()
672 cntl = plane_state->ctl | in i9xx_cursor_update_arm()
678 base = intel_cursor_base(plane_state); in i9xx_cursor_update_arm()
679 pos = intel_cursor_position(crtc_state, plane_state, false); in i9xx_cursor_update_arm()
705 if (plane_state) in i9xx_cursor_update_arm()
706 i9xx_cursor_update_sel_fetch_arm(dsb, plane, crtc_state, plane_state); in i9xx_cursor_update_arm()
801 struct intel_plane_state *plane_state = in intel_cursor_unpin_work() local
802 container_of(work, typeof(*plane_state), unpin_work); in intel_cursor_unpin_work()
803 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); in intel_cursor_unpin_work()
805 intel_plane_unpin_fb(plane_state); in intel_cursor_unpin_work()
806 intel_plane_destroy_state(&plane->base, &plane_state->uapi); in intel_cursor_unpin_work()