mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-09 07:28:42 +02:00
libdrm/nouveau: incr refcount on ref fence before decr on old fence
This commit is contained in:
parent
00d8e960ca
commit
c37fca4ef6
1 changed files with 5 additions and 11 deletions
|
|
@ -96,22 +96,16 @@ nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **fence)
|
|||
int
|
||||
nouveau_fence_ref(struct nouveau_fence *ref, struct nouveau_fence **fence)
|
||||
{
|
||||
struct nouveau_fence_priv *nvfence;
|
||||
|
||||
if (!fence)
|
||||
return -EINVAL;
|
||||
|
||||
if (*fence) {
|
||||
if (ref)
|
||||
nouveau_fence(ref)->refcount++;
|
||||
|
||||
if (*fence)
|
||||
nouveau_fence_del(fence);
|
||||
*fence = NULL;
|
||||
}
|
||||
|
||||
if (ref) {
|
||||
nvfence = nouveau_fence(ref);
|
||||
nvfence->refcount++;
|
||||
*fence = &nvfence->base;
|
||||
}
|
||||
|
||||
*fence = ref;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue