Skip to content

Commit

Permalink
drm/virtio: simplify cursor updates
Browse files Browse the repository at this point in the history
No need to do the reservation dance,
we can just wait on the fence directly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20190829103301.3539-4-kraxel@redhat.com
  • Loading branch information
Gerd Hoffmann committed Sep 4, 2019
1 parent 29cf123 commit 620f9c5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/gpu/drm/virtio/virtgpu_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
struct virtio_gpu_framebuffer *vgfb;
struct virtio_gpu_object *bo = NULL;
uint32_t handle;
int ret = 0;

if (plane->state->crtc)
output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
Expand All @@ -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_h),
0, 0, vgfb->fence);
ret = virtio_gpu_object_reserve(bo, false);
if (!ret) {
dma_resv_add_excl_fence(bo->tbo.base.resv,
&vgfb->fence->f);
dma_fence_put(&vgfb->fence->f);
vgfb->fence = NULL;
virtio_gpu_object_unreserve(bo);
virtio_gpu_object_wait(bo, false);
}
dma_fence_wait(&vgfb->fence->f, true);
dma_fence_put(&vgfb->fence->f);
vgfb->fence = NULL;
}

if (plane->state->fb != old_state->fb) {
Expand Down

0 comments on commit 620f9c5

Please sign in to comment.