Commit a25f83ba authored by Peter Hurley's avatar Peter Hurley Committed by Ben Skeggs

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ca356222
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
struct nouveau_eventh { struct nouveau_eventh {
struct list_head head; struct list_head head;
void *priv;
int (*func)(struct nouveau_eventh *, int index); int (*func)(struct nouveau_eventh *, int index);
}; };
......
...@@ -165,17 +165,11 @@ nouveau_fence_done(struct nouveau_fence *fence) ...@@ -165,17 +165,11 @@ nouveau_fence_done(struct nouveau_fence *fence)
return !fence->channel; return !fence->channel;
} }
struct nouveau_fence_uevent {
struct nouveau_eventh handler;
struct nouveau_fence_priv *priv;
};
static int 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 = struct nouveau_fence_priv *priv = handler->priv;
container_of(event, struct nouveau_fence_uevent, handler); wake_up_all(&priv->waiting);
wake_up_all(&uevent->priv->waiting);
return NVKM_EVENT_KEEP; return NVKM_EVENT_KEEP;
} }
...@@ -186,13 +180,13 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr) ...@@ -186,13 +180,13 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr)
struct nouveau_channel *chan = fence->channel; struct nouveau_channel *chan = fence->channel;
struct nouveau_fifo *pfifo = nouveau_fifo(chan->drm->device); struct nouveau_fifo *pfifo = nouveau_fifo(chan->drm->device);
struct nouveau_fence_priv *priv = chan->drm->fence; struct nouveau_fence_priv *priv = chan->drm->fence;
struct nouveau_fence_uevent uevent = { struct nouveau_eventh handler = {
.handler.func = nouveau_fence_wait_uevent_handler, .func = nouveau_fence_wait_uevent_handler,
.priv = priv, .priv = priv,
}; };
int ret = 0; int ret = 0;
nouveau_event_get(pfifo->uevent, 0, &uevent.handler); nouveau_event_get(pfifo->uevent, 0, &handler);
if (fence->timeout) { if (fence->timeout) {
unsigned long timeout = fence->timeout - jiffies; unsigned long timeout = fence->timeout - jiffies;
...@@ -224,7 +218,7 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr) ...@@ -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)) if (unlikely(ret < 0))
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment