From 15a996bbb6978ae21c497aeadfe20deca6ddd07a Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 29 Sep 2014 10:06:18 +0200 Subject: drm/nouveau: assign fence_chan->name correctly Make nouveau_fence_chan refcounted, to make trace_fence_destroy always return the correct name without a race condition. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/nouveau/nouveau_fence.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/nouveau/nouveau_fence.h') diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.h b/drivers/gpu/drm/nouveau/nouveau_fence.h index a7dc537..943b0b1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.h +++ b/drivers/gpu/drm/nouveau/nouveau_fence.h @@ -30,6 +30,8 @@ int nouveau_fence_sync(struct nouveau_bo *, struct nouveau_channel *, bool excl struct nouveau_fence_chan { spinlock_t lock; + struct kref fence_ref; + struct list_head pending; struct list_head flip; @@ -42,7 +44,7 @@ struct nouveau_fence_chan { u32 sequence; u32 context; - char name[24]; + char name[32]; struct nvif_notify notify; int notify_ref; @@ -63,6 +65,7 @@ struct nouveau_fence_priv { void nouveau_fence_context_new(struct nouveau_channel *, struct nouveau_fence_chan *); void nouveau_fence_context_del(struct nouveau_fence_chan *); +void nouveau_fence_context_free(struct nouveau_fence_chan *); int nv04_fence_create(struct nouveau_drm *); int nv04_fence_mthd(struct nouveau_channel *, u32, u32, u32); -- cgit v1.1