diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-10-03 07:02:29 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-11-05 16:15:42 +1000 |
commit | 74ee03e19fa6a28e44fc38aef563c591682e59dc (patch) | |
tree | c3493d67d4e65eb8174c24b2d200b3ad8a8d6318 /drm/nouveau_fence.c | |
parent | cd1bb7c8aa26ae25e3740ed21962a4d08b132124 (diff) | |
download | nouveau-74ee03e19fa6a28e44fc38aef563c591682e59dc.tar.gz |
core: convert event handler apis to split create/enable semantics
This is a necessary step towards being able to work with the insane locking
requirements of the DRM core's vblank routines, and a nice cleanup as a
side-effect.
This is similar in spirit to the interfaces that Peter Hurley arrived at
with his nouveau_event rcu conversion series.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drm/nouveau_fence.c')
-rw-r--r-- | drm/nouveau_fence.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drm/nouveau_fence.c b/drm/nouveau_fence.c index c2e31677d..34b82711e 100644 --- a/drm/nouveau_fence.c +++ b/drm/nouveau_fence.c @@ -166,9 +166,9 @@ nouveau_fence_done(struct nouveau_fence *fence) } static int -nouveau_fence_wait_uevent_handler(struct nouveau_eventh *handler, int index) +nouveau_fence_wait_uevent_handler(void *data, int index) { - struct nouveau_fence_priv *priv = handler->priv; + struct nouveau_fence_priv *priv = data; wake_up_all(&priv->waiting); return NVKM_EVENT_KEEP; } @@ -180,13 +180,16 @@ 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_eventh handler = { - .func = nouveau_fence_wait_uevent_handler, - .priv = priv, - }; + struct nouveau_eventh *handler; int ret = 0; - nouveau_event_get(pfifo->uevent, 0, &handler); + ret = nouveau_event_new(pfifo->uevent, 0, + nouveau_fence_wait_uevent_handler, + priv, &handler); + if (ret) + return ret; + + nouveau_event_get(handler); if (fence->timeout) { unsigned long timeout = fence->timeout - jiffies; @@ -218,7 +221,7 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr) } } - nouveau_event_put(pfifo->uevent, 0, &handler); + nouveau_event_ref(NULL, &handler); if (unlikely(ret < 0)) return ret; |