Home | History | Annotate | Download | only in virtio

Lines Matching defs:plane

75 static void virtio_gpu_plane_destroy(struct drm_plane *plane)
77 drm_plane_cleanup(plane);
78 kfree(plane);
90 static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
93 bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR;
134 static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
137 struct drm_device *dev = plane->dev;
143 if (plane->state->crtc)
144 output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
150 if (!plane->state->fb || !output->enabled) {
153 plane->state->src_w >> 16,
154 plane->state->src_h >> 16,
159 if (!drm_atomic_helper_damage_merged(old_state, plane->state, &rect))
164 bo = gem_to_virtio_gpu_obj(plane->state->fb->obj[0]);
166 virtio_gpu_update_dumb_bo(vgdev, plane->state, &rect);
168 if (plane->state->fb != old_state->fb ||
169 plane->state->src_w != old_state->src_w ||
170 plane->state->src_h != old_state->src_h ||
171 plane->state->src_x != old_state->src_x ||
172 plane->state->src_y != old_state->src_y) {
175 plane->state->crtc_w, plane->state->crtc_h,
176 plane->state->crtc_x, plane->state->crtc_y,
177 plane->state->src_w >> 16,
178 plane->state->src_h >> 16,
179 plane->state->src_x >> 16,
180 plane->state->src_y >> 16);
183 plane->state->src_w >> 16,
184 plane->state->src_h >> 16,
185 plane->state->src_x >> 16,
186 plane->state->src_y >> 16);
198 static int virtio_gpu_cursor_prepare_fb(struct drm_plane *plane,
201 struct drm_device *dev = plane->dev;
211 if (bo && bo->dumb && (plane->state->fb != new_state->fb)) {
220 static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,
225 if (!plane->state->fb)
228 vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
235 static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
238 struct drm_device *dev = plane->dev;
245 if (plane->state->crtc)
246 output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
252 if (plane->state->fb) {
253 vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
260 if (bo && bo->dumb && (plane->state->fb != old_state->fb)) {
271 plane->state->crtc_w,
272 plane->state->crtc_h,
279 if (plane->state->fb != old_state->fb) {
281 plane->state->crtc_x,
282 plane->state->crtc_y,
283 plane->state->fb ? plane->state->fb->hot_x : 0,
284 plane->state->fb ? plane->state->fb->hot_y : 0);
288 if (plane->state->fb) {
290 cpu_to_le32(plane->state->fb->hot_x);
292 cpu_to_le32(plane->state->fb->hot_y);
299 plane->state->crtc_x,
300 plane->state->crtc_y);
304 output->cursor.pos.x = cpu_to_le32(plane->state->crtc_x);
305 output->cursor.pos.y = cpu_to_le32(plane->state->crtc_y);
327 struct drm_plane *plane;
331 plane = kzalloc(sizeof(*plane), GFP_KERNEL);
332 if (!plane)
344 ret = drm_universal_plane_init(dev, plane, 1 << index,
351 drm_plane_helper_add(plane, funcs);
352 return plane;
355 kfree(plane);