summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_fence.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-08-09 22:10:25 +0400
committerBen Skeggs <bskeggs@redhat.com>2014-08-09 23:28:05 +0400
commit867920f8c920bcaa5a6fa5ebad4596669b82ba80 (patch)
tree063aebcdfdeba309f3921d9fe2a8463aec64ff7c /drivers/gpu/drm/nouveau/nouveau_fence.c
parent6c6ae061b61c1fd0d1823765299bcc009ddc21c8 (diff)
downloadlinux-867920f8c920bcaa5a6fa5ebad4596669b82ba80.tar.xz
drm/nouveau/fifo: implement nvif event source
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_fence.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fence.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index ace42ec92a72..0a93114158cd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/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;