Lines Matching full:plane
77 static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, in virtio_gpu_plane_atomic_check() argument
81 plane); in virtio_gpu_plane_atomic_check()
83 plane); in virtio_gpu_plane_atomic_check()
84 bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR; in virtio_gpu_plane_atomic_check()
92 * Ignore damage clips if the framebuffer attached to the plane's state in virtio_gpu_plane_atomic_check()
93 * has changed since the last plane update (page-flip). In this case, a in virtio_gpu_plane_atomic_check()
94 * full plane update should happen because uploads are done per-buffer. in virtio_gpu_plane_atomic_check()
134 static void virtio_gpu_resource_flush(struct drm_plane *plane, in virtio_gpu_resource_flush() argument
138 struct drm_device *dev = plane->dev; in virtio_gpu_resource_flush()
143 vgfb = to_virtio_gpu_framebuffer(plane->state->fb); in virtio_gpu_resource_flush()
168 static void virtio_gpu_primary_plane_update(struct drm_plane *plane, in virtio_gpu_primary_plane_update() argument
172 plane); in virtio_gpu_primary_plane_update()
173 struct drm_device *dev = plane->dev; in virtio_gpu_primary_plane_update()
179 if (plane->state->crtc) in virtio_gpu_primary_plane_update()
180 output = drm_crtc_to_virtio_gpu_output(plane->state->crtc); in virtio_gpu_primary_plane_update()
186 if (!plane->state->fb || !output->crtc.state->active) { in virtio_gpu_primary_plane_update()
189 plane->state->src_w >> 16, in virtio_gpu_primary_plane_update()
190 plane->state->src_h >> 16, in virtio_gpu_primary_plane_update()
196 if (!drm_atomic_helper_damage_merged(old_state, plane->state, &rect)) in virtio_gpu_primary_plane_update()
199 bo = gem_to_virtio_gpu_obj(plane->state->fb->obj[0]); in virtio_gpu_primary_plane_update()
201 virtio_gpu_update_dumb_bo(vgdev, plane->state, &rect); in virtio_gpu_primary_plane_update()
203 if (plane->state->fb != old_state->fb || in virtio_gpu_primary_plane_update()
204 plane->state->src_w != old_state->src_w || in virtio_gpu_primary_plane_update()
205 plane->state->src_h != old_state->src_h || in virtio_gpu_primary_plane_update()
206 plane->state->src_x != old_state->src_x || in virtio_gpu_primary_plane_update()
207 plane->state->src_y != old_state->src_y || in virtio_gpu_primary_plane_update()
212 plane->state->crtc_w, plane->state->crtc_h, in virtio_gpu_primary_plane_update()
213 plane->state->crtc_x, plane->state->crtc_y, in virtio_gpu_primary_plane_update()
214 plane->state->src_w >> 16, in virtio_gpu_primary_plane_update()
215 plane->state->src_h >> 16, in virtio_gpu_primary_plane_update()
216 plane->state->src_x >> 16, in virtio_gpu_primary_plane_update()
217 plane->state->src_y >> 16); in virtio_gpu_primary_plane_update()
222 plane->state->fb, in virtio_gpu_primary_plane_update()
223 plane->state->src_w >> 16, in virtio_gpu_primary_plane_update()
224 plane->state->src_h >> 16, in virtio_gpu_primary_plane_update()
225 plane->state->src_x >> 16, in virtio_gpu_primary_plane_update()
226 plane->state->src_y >> 16); in virtio_gpu_primary_plane_update()
230 plane->state->src_w >> 16, in virtio_gpu_primary_plane_update()
231 plane->state->src_h >> 16, in virtio_gpu_primary_plane_update()
232 plane->state->src_x >> 16, in virtio_gpu_primary_plane_update()
233 plane->state->src_y >> 16); in virtio_gpu_primary_plane_update()
237 virtio_gpu_resource_flush(plane, in virtio_gpu_primary_plane_update()
244 static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane, in virtio_gpu_plane_prepare_fb() argument
247 struct drm_device *dev = plane->dev; in virtio_gpu_plane_prepare_fb()
257 if (!bo || (plane->type == DRM_PLANE_TYPE_PRIMARY && !bo->guest_blob)) in virtio_gpu_plane_prepare_fb()
260 if (bo->dumb && (plane->state->fb != new_state->fb)) { in virtio_gpu_plane_prepare_fb()
270 static void virtio_gpu_plane_cleanup_fb(struct drm_plane *plane, in virtio_gpu_plane_cleanup_fb() argument
285 static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, in virtio_gpu_cursor_plane_update() argument
289 plane); in virtio_gpu_cursor_plane_update()
290 struct drm_device *dev = plane->dev; in virtio_gpu_cursor_plane_update()
297 if (plane->state->crtc) in virtio_gpu_cursor_plane_update()
298 output = drm_crtc_to_virtio_gpu_output(plane->state->crtc); in virtio_gpu_cursor_plane_update()
304 if (plane->state->fb) { in virtio_gpu_cursor_plane_update()
305 vgfb = to_virtio_gpu_framebuffer(plane->state->fb); in virtio_gpu_cursor_plane_update()
312 if (bo && bo->dumb && (plane->state->fb != old_state->fb)) { in virtio_gpu_cursor_plane_update()
323 plane->state->crtc_w, in virtio_gpu_cursor_plane_update()
324 plane->state->crtc_h, in virtio_gpu_cursor_plane_update()
332 if (plane->state->fb != old_state->fb) { in virtio_gpu_cursor_plane_update()
334 plane->state->crtc_x, in virtio_gpu_cursor_plane_update()
335 plane->state->crtc_y, in virtio_gpu_cursor_plane_update()
336 plane->state->hotspot_x, in virtio_gpu_cursor_plane_update()
337 plane->state->hotspot_y); in virtio_gpu_cursor_plane_update()
341 if (plane->state->fb) { in virtio_gpu_cursor_plane_update()
343 cpu_to_le32(plane->state->hotspot_x); in virtio_gpu_cursor_plane_update()
345 cpu_to_le32(plane->state->hotspot_y); in virtio_gpu_cursor_plane_update()
352 plane->state->crtc_x, in virtio_gpu_cursor_plane_update()
353 plane->state->crtc_y); in virtio_gpu_cursor_plane_update()
357 output->cursor.pos.x = cpu_to_le32(plane->state->crtc_x); in virtio_gpu_cursor_plane_update()
358 output->cursor.pos.y = cpu_to_le32(plane->state->crtc_y); in virtio_gpu_cursor_plane_update()
382 struct drm_plane *plane; in virtio_gpu_plane_init() local
396 plane = drmm_universal_plane_alloc(dev, struct drm_plane, dev, in virtio_gpu_plane_init()
399 if (IS_ERR(plane)) in virtio_gpu_plane_init()
400 return plane; in virtio_gpu_plane_init()
402 drm_plane_helper_add(plane, funcs); in virtio_gpu_plane_init()
405 drm_plane_enable_fb_damage_clips(plane); in virtio_gpu_plane_init()
407 return plane; in virtio_gpu_plane_init()