summaryrefslogtreecommitdiff
path: root/drm/nouveau_fence.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-08-10 04:10:25 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-08-10 05:26:57 +1000
commit5f297946df6d87ea788462e20b2e28fc03ea79a5 (patch)
tree4c940d5116761cdee41821a92c3314fa50f0d254 /drm/nouveau_fence.c
parentfea516ed2a9a198bca882615ec5e23e1b770fbfb (diff)
downloadnouveau-5f297946df6d87ea788462e20b2e28fc03ea79a5.tar.gz
fifo: implement nvif event source
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drm/nouveau_fence.c')
-rw-r--r--drm/nouveau_fence.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drm/nouveau_fence.c b/drm/nouveau_fence.c
index ace42ec92..0a9311415 100644
--- a/drm/nouveau_fence.c
+++ b/drm/nouveau_fence.c
@@ -29,6 +29,9 @@
#include <linux/ktime.h>
#include <linux/hrtimer.h>
+#include <nvif/notify.h>
+#include <nvif/event.h>
+
#include "nouveau_drm.h"
#include "nouveau_dma.h"
#include "nouveau_fence.h"
@@ -165,16 +168,16 @@ nouveau_fence_done(struct nouveau_fence *fence)
struct nouveau_fence_wait {
struct nouveau_fence_priv *priv;
- struct nvkm_notify notify;
+ struct nvif_notify notify;
};
static int
-nouveau_fence_wait_uevent_handler(struct nvkm_notify *notify)
+nouveau_fence_wait_uevent_handler(struct nvif_notify *notify)
{
struct nouveau_fence_wait *wait =
container_of(notify, typeof(*wait), notify);
wake_up_all(&wait->priv->waiting);
- return NVKM_NOTIFY_KEEP;
+ return NVIF_NOTIFY_KEEP;
}
static int
@@ -182,18 +185,22 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr)
{
struct nouveau_channel *chan = fence->channel;
- struct nouveau_fifo *pfifo = nvkm_fifo(chan->device);
struct nouveau_fence_priv *priv = chan->drm->fence;
struct nouveau_fence_wait wait = { .priv = priv };
int ret = 0;
- ret = nvkm_notify_init(&pfifo->uevent,
+ ret = nvif_notify_init(chan->object, NULL,
nouveau_fence_wait_uevent_handler, false,
- NULL, 0, 0, &wait.notify);
+ G82_CHANNEL_DMA_V0_NTFY_UEVENT,
+ &(struct nvif_notify_uevent_req) {
+ },
+ sizeof(struct nvif_notify_uevent_req),
+ sizeof(struct nvif_notify_uevent_rep),
+ &wait.notify);
if (ret)
return ret;
- nvkm_notify_get(&wait.notify);
+ nvif_notify_get(&wait.notify);
if (fence->timeout) {
unsigned long timeout = fence->timeout - jiffies;
@@ -225,7 +232,7 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr)
}
}
- nvkm_notify_fini(&wait.notify);
+ nvif_notify_fini(&wait.notify);
if (unlikely(ret < 0))
return ret;