diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-08-27 16:12:54 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-11-08 15:36:02 +1000 |
commit | a25f83ba898797e50de200065ba91cb0115e0d57 (patch) | |
tree | bfc4495ce51addb11d26469ff2839cc17e267503 /drivers/gpu/drm | |
parent | ca3562226a901ddf77c7da36077c25316c4c0bb7 (diff) | |
download | op-kernel-dev-a25f83ba898797e50de200065ba91cb0115e0d57.zip op-kernel-dev-a25f83ba898797e50de200065ba91cb0115e0d57.tar.gz |
drm/nouveau/core: Add priv field for event handlers
Provide private field for event handlers exclusive use.
Convert nouveau_fence_wait_uevent() and
nouveau_fence_wait_uevent_handler(); drop struct nouveau_fence_uevent.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/core/event.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fence.c | 20 |
2 files changed, 8 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/core/event.h b/drivers/gpu/drm/nouveau/core/include/core/event.h index 9e09440..ad4d8c2 100644 --- a/drivers/gpu/drm/nouveau/core/include/core/event.h +++ b/drivers/gpu/drm/nouveau/core/include/core/event.h @@ -7,6 +7,7 @@ struct nouveau_eventh { struct list_head head; + void *priv; int (*func)(struct nouveau_eventh *, int index); }; diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index be31499..c2e3167 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -165,17 +165,11 @@ nouveau_fence_done(struct nouveau_fence *fence) return !fence->channel; } -struct nouveau_fence_uevent { - struct nouveau_eventh handler; - struct nouveau_fence_priv *priv; -}; - static int -nouveau_fence_wait_uevent_handler(struct nouveau_eventh *event, int index) +nouveau_fence_wait_uevent_handler(struct nouveau_eventh *handler, int index) { - struct nouveau_fence_uevent *uevent = - container_of(event, struct nouveau_fence_uevent, handler); - wake_up_all(&uevent->priv->waiting); + struct nouveau_fence_priv *priv = handler->priv; + wake_up_all(&priv->waiting); return NVKM_EVENT_KEEP; } @@ -186,13 +180,13 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr) struct nouveau_channel *chan = fence->channel; struct nouveau_fifo *pfifo = nouveau_fifo(chan->drm->device); struct nouveau_fence_priv *priv = chan->drm->fence; - struct nouveau_fence_uevent uevent = { - .handler.func = nouveau_fence_wait_uevent_handler, + struct nouveau_eventh handler = { + .func = nouveau_fence_wait_uevent_handler, .priv = priv, }; int ret = 0; - nouveau_event_get(pfifo->uevent, 0, &uevent.handler); + nouveau_event_get(pfifo->uevent, 0, &handler); if (fence->timeout) { unsigned long timeout = fence->timeout - jiffies; @@ -224,7 +218,7 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr) } } - nouveau_event_put(pfifo->uevent, 0, &uevent.handler); + nouveau_event_put(pfifo->uevent, 0, &handler); if (unlikely(ret < 0)) return ret; |