drm: Set fence->ops for stub fences too.

This commit is contained in:
riastradh 2021-12-19 12:31:11 +00:00
parent 96323d8388
commit 464621fbdd
1 changed files with 14 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_dma_fence.c,v 1.29 2021/12/19 12:30:56 riastradh Exp $ */
/* $NetBSD: linux_dma_fence.c,v 1.30 2021/12/19 12:31:11 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.29 2021/12/19 12:30:56 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.30 2021/12/19 12:31:11 riastradh Exp $");
#include <sys/atomic.h>
#include <sys/condvar.h>
@ -221,6 +221,17 @@ dma_fence_is_later(struct dma_fence *a, struct dma_fence *b)
return a->seqno - b->seqno < INT_MAX;
}
static const char *dma_fence_stub_name(struct dma_fence *f)
{
return "stub";
}
static const struct dma_fence_ops dma_fence_stub_ops = {
.get_driver_name = dma_fence_stub_name,
.get_timeline_name = dma_fence_stub_name,
};
/*
* dma_fence_get_stub()
*
@ -238,6 +249,7 @@ dma_fence_get_stub(void)
static struct dma_fence fence = {
.refcount = {1}, /* always referenced */
.flags = 1u << DMA_FENCE_FLAG_SIGNALED_BIT,
.ops = &dma_fence_stub_ops,
#ifdef DIAGNOSTIC
.f_magic = FENCE_MAGIC_GOOD,
#endif