summaryrefslogtreecommitdiff
path: root/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-12-09 09:18:35 +1000
committerBen Skeggs <bskeggs@redhat.com>2010-12-21 12:46:50 +1000
commitba731e7b58911e8caa4e37f0075a677d7ac2afc6 (patch)
tree0baa771480a82d365b7e4011c6a25907a81545c9 /nouveau
parent0184bb1c6d946bcaf198f7680b3405adca676790 (diff)
nouveau: nvc0 drm has no concept of "notifier block"
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/nouveau_channel.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/nouveau/nouveau_channel.c b/nouveau/nouveau_channel.c
index ded54241..96fa03bd 100644
--- a/nouveau/nouveau_channel.c
+++ b/nouveau/nouveau_channel.c
@@ -75,20 +75,23 @@ nouveau_channel_alloc(struct nouveau_device *dev, uint32_t fb_ctxdma,
nvchan->base.subc[i].gr = &gr->base;
}
- ret = nouveau_bo_wrap(dev, nvchan->drm.notifier_handle,
- &nvchan->notifier_bo);
- if (!ret)
- ret = nouveau_bo_map(nvchan->notifier_bo, NOUVEAU_BO_RDWR);
- if (ret) {
- nouveau_channel_free((void *)&nvchan);
- return ret;
- }
-
- ret = nouveau_grobj_alloc(&nvchan->base, 0x00000000, 0x0030,
- &nvchan->base.nullobj);
- if (ret) {
- nouveau_channel_free((void *)&nvchan);
- return ret;
+ if (dev->chipset < 0xc0) {
+ ret = nouveau_bo_wrap(dev, nvchan->drm.notifier_handle,
+ &nvchan->notifier_bo);
+ if (!ret)
+ ret = nouveau_bo_map(nvchan->notifier_bo,
+ NOUVEAU_BO_RDWR);
+ if (ret) {
+ nouveau_channel_free((void *)&nvchan);
+ return ret;
+ }
+
+ ret = nouveau_grobj_alloc(&nvchan->base, 0x00000000, 0x0030,
+ &nvchan->base.nullobj);
+ if (ret) {
+ nouveau_channel_free((void *)&nvchan);
+ return ret;
+ }
}
ret = nouveau_pushbuf_init(&nvchan->base, pushbuf_size);
@@ -119,8 +122,10 @@ nouveau_channel_free(struct nouveau_channel **chan)
FIRE_RING(&nvchan->base);
nouveau_pushbuf_fini(&nvchan->base);
- nouveau_bo_unmap(nvchan->notifier_bo);
- nouveau_bo_ref(NULL, &nvchan->notifier_bo);
+ if (nvchan->notifier_bo) {
+ nouveau_bo_unmap(nvchan->notifier_bo);
+ nouveau_bo_ref(NULL, &nvchan->notifier_bo);
+ }
for (i = 0; i < nvchan->drm.nr_subchan; i++)
free(nvchan->base.subc[i].gr);