Commit 620f9c5e authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm/virtio: simplify cursor updates

No need to do the reservation dance,
we can just wait on the fence directly.
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarChia-I Wu <olvaffe@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20190829103301.3539-4-kraxel@redhat.com
parent 29cf1239
...@@ -201,7 +201,6 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, ...@@ -201,7 +201,6 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
struct virtio_gpu_framebuffer *vgfb; struct virtio_gpu_framebuffer *vgfb;
struct virtio_gpu_object *bo = NULL; struct virtio_gpu_object *bo = NULL;
uint32_t handle; uint32_t handle;
int ret = 0;
if (plane->state->crtc) if (plane->state->crtc)
output = drm_crtc_to_virtio_gpu_output(plane->state->crtc); output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
...@@ -225,15 +224,9 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, ...@@ -225,15 +224,9 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
cpu_to_le32(plane->state->crtc_w), cpu_to_le32(plane->state->crtc_w),
cpu_to_le32(plane->state->crtc_h), cpu_to_le32(plane->state->crtc_h),
0, 0, vgfb->fence); 0, 0, vgfb->fence);
ret = virtio_gpu_object_reserve(bo, false); dma_fence_wait(&vgfb->fence->f, true);
if (!ret) { dma_fence_put(&vgfb->fence->f);
dma_resv_add_excl_fence(bo->tbo.base.resv, vgfb->fence = NULL;
&vgfb->fence->f);
dma_fence_put(&vgfb->fence->f);
vgfb->fence = NULL;
virtio_gpu_object_unreserve(bo);
virtio_gpu_object_wait(bo, false);
}
} }
if (plane->state->fb != old_state->fb) { if (plane->state->fb != old_state->fb) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment