Lines Matching refs:plane

70 static void virtio_gpu_plane_destroy(struct drm_plane *plane)
72 drm_plane_cleanup(plane);
73 kfree(plane);
85 static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
88 bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR;
129 static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
132 struct drm_device *dev = plane->dev;
138 if (plane->state->crtc)
139 output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
145 if (!plane->state->fb || !output->crtc.state->active) {
148 plane->state->src_w >> 16,
149 plane->state->src_h >> 16,
155 if (!drm_atomic_helper_damage_merged(old_state, plane->state, &rect))
158 bo = gem_to_virtio_gpu_obj(plane->state->fb->obj[0]);
160 virtio_gpu_update_dumb_bo(vgdev, plane->state, &rect);
162 if (plane->state->fb != old_state->fb ||
163 plane->state->src_w != old_state->src_w ||
164 plane->state->src_h != old_state->src_h ||
165 plane->state->src_x != old_state->src_x ||
166 plane->state->src_y != old_state->src_y ||
171 plane->state->crtc_w, plane->state->crtc_h,
172 plane->state->crtc_x, plane->state->crtc_y,
173 plane->state->src_w >> 16,
174 plane->state->src_h >> 16,
175 plane->state->src_x >> 16,
176 plane->state->src_y >> 16);
179 plane->state->src_w >> 16,
180 plane->state->src_h >> 16,
181 plane->state->src_x >> 16,
182 plane->state->src_y >> 16);
193 static int virtio_gpu_cursor_prepare_fb(struct drm_plane *plane,
196 struct drm_device *dev = plane->dev;
206 if (bo && bo->dumb && (plane->state->fb != new_state->fb)) {
215 static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,
230 static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
233 struct drm_device *dev = plane->dev;
240 if (plane->state->crtc)
241 output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
247 if (plane->state->fb) {
248 vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
255 if (bo && bo->dumb && (plane->state->fb != old_state->fb)) {
266 plane->state->crtc_w,
267 plane->state->crtc_h,
275 if (plane->state->fb != old_state->fb) {
277 plane->state->crtc_x,
278 plane->state->crtc_y,
279 plane->state->fb ? plane->state->fb->hot_x : 0,
280 plane->state->fb ? plane->state->fb->hot_y : 0);
284 if (plane->state->fb) {
286 cpu_to_le32(plane->state->fb->hot_x);
288 cpu_to_le32(plane->state->fb->hot_y);
295 plane->state->crtc_x,
296 plane->state->crtc_y);
300 output->cursor.pos.x = cpu_to_le32(plane->state->crtc_x);
301 output->cursor.pos.y = cpu_to_le32(plane->state->crtc_y);
323 struct drm_plane *plane;
327 plane = kzalloc(sizeof(*plane), GFP_KERNEL);
328 if (!plane)
340 ret = drm_universal_plane_init(dev, plane, 1 << index,
347 drm_plane_helper_add(plane, funcs);
348 return plane;
351 kfree(plane);