diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2020-11-30 18:16:22 -0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-12-02 11:48:14 +0100 |
commit | b9662c3a54eba1a06e2c14744dd78b065df120c5 (patch) | |
tree | b7e2c3c040146b51bfa0b283d199e0b17d4e8c87 | |
parent | 41a90202cd150a2f1318582a985e27b4a3bd9a8d (diff) | |
download | linux-b9662c3a54eba1a06e2c14744dd78b065df120c5.tar.gz linux-b9662c3a54eba1a06e2c14744dd78b065df120c5.tar.bz2 linux-b9662c3a54eba1a06e2c14744dd78b065df120c5.zip |
drm/virtio: rework virtio_fence_signaled
virtio_gpu_fence_event_process sets the last_fence_id and
subsequently calls dma_fence_signal_locked(..).
dma_fence_signal_locked(..) sets DMA_FENCE_FLAG_SIGNALED_BIT,
which is actually checked before &dma_fence_ops.(*signaled) is
called.
The check for last_fence_id is therefore a bit redundant, and
it will not be sufficient to check the last_fence_id for multiple
synchronization timelines. Remove it.
v3: add r-b tags
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-2-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_fence.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index 586034c90587..b35fcd1d02d7 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -42,14 +42,10 @@ static const char *virtio_gpu_get_timeline_name(struct dma_fence *f) static bool virtio_gpu_fence_signaled(struct dma_fence *f) { - struct virtio_gpu_fence *fence = to_virtio_gpu_fence(f); - - if (WARN_ON_ONCE(fence->f.seqno == 0)) - /* leaked fence outside driver before completing - * initialization with virtio_gpu_fence_emit */ - return false; - if (atomic64_read(&fence->drv->last_fence_id) >= fence->f.seqno) - return true; + /* leaked fence outside driver before completing + * initialization with virtio_gpu_fence_emit. + */ + WARN_ON_ONCE(f->seqno == 0); return false; } |