Commit b9662c3a authored by Gurchetan Singh's avatar Gurchetan Singh Committed by Gerd Hoffmann

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: default avatarGurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: default avatarAnthoine Bourgeois <anthoine.bourgeois@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-2-gurchetansingh@chromium.orgSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 41a90202
......@@ -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;
}
......
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