Merge tag 'armsoc-dt2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[cascardo/linux.git] / drivers / gpu / drm / virtio / virtgpu_plane.c
index 572fb35..70b44a2 100644 (file)
@@ -68,10 +68,17 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
        struct virtio_gpu_object *bo;
        uint32_t handle;
 
-       if (plane->fb) {
-               vgfb = to_virtio_gpu_framebuffer(plane->fb);
+       if (plane->state->fb) {
+               vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
                bo = gem_to_virtio_gpu_obj(vgfb->obj);
                handle = bo->hw_res_handle;
+               if (bo->dumb) {
+                       virtio_gpu_cmd_transfer_to_host_2d
+                               (vgdev, handle, 0,
+                                cpu_to_le32(plane->state->crtc_w),
+                                cpu_to_le32(plane->state->crtc_h),
+                                plane->state->crtc_x, plane->state->crtc_y, NULL);
+               }
        } else {
                handle = 0;
        }
@@ -84,6 +91,11 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
                                   plane->state->crtc_h,
                                   plane->state->crtc_x,
                                   plane->state->crtc_y);
+       virtio_gpu_cmd_resource_flush(vgdev, handle,
+                                     plane->state->crtc_x,
+                                     plane->state->crtc_y,
+                                     plane->state->crtc_w,
+                                     plane->state->crtc_h);
 }