aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBen Skeggs2012-08-19 15:58:38 +1000
committerBen Skeggs2012-10-03 13:13:06 +1000
commit1971f04e16172db79b8b0eed75fb2cb82adfbb83 (patch)
tree7e3f7782366249cc25ee3ddf1479cfdfbd0873ba /drivers
parent9456f7d1beb8f7cfd99300e6028b3b2667c2ebd5 (diff)
drm/nouveau/dmaobj: reject unsupported parent types instead of half-succeeding
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c13
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/dmaobj/nv50.c13
2 files changed, 16 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c
index 848aa3bdacd1..5ad76f74416f 100644
--- a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c
+++ b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv04.c
@@ -23,6 +23,7 @@
*/
#include <core/gpuobj.h>
+#include <core/class.h>
#include <subdev/fb.h>
#include <subdev/vm/nv04.h>
@@ -118,16 +119,18 @@ nv04_dmaobj_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return ret;
switch (nv_mclass(parent)) {
- case 0x006b:
- case 0x006e:
- case 0x176e:
- case 0x406e:
+ case NV_DEVICE_CLASS:
+ break;
+ case NV03_CHANNEL_DMA_CLASS:
+ case NV10_CHANNEL_DMA_CLASS:
+ case NV17_CHANNEL_DMA_CLASS:
+ case NV40_CHANNEL_DMA_CLASS:
ret = dmaeng->bind(dmaeng, *pobject, &dmaobj->base, &gpuobj);
nouveau_object_ref(NULL, pobject);
*pobject = nv_object(gpuobj);
break;
default:
- break;
+ return -EINVAL;
}
return ret;
diff --git a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv50.c b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv50.c
index be5c0df644db..045d2565e289 100644
--- a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nv50.c
@@ -23,6 +23,7 @@
*/
#include <core/gpuobj.h>
+#include <core/class.h>
#include <subdev/fb.h>
#include <engine/dmaobj.h>
@@ -109,16 +110,18 @@ nv50_dmaobj_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return ret;
switch (nv_mclass(parent)) {
- case 0x506e:
- case 0x506f:
- case 0x826e:
- case 0x826f:
+ case NV_DEVICE_CLASS:
+ break;
+ case NV50_CHANNEL_DMA_CLASS:
+ case NV84_CHANNEL_DMA_CLASS:
+ case NV50_CHANNEL_IND_CLASS:
+ case NV84_CHANNEL_IND_CLASS:
ret = dmaeng->bind(dmaeng, *pobject, &dmaobj->base, &gpuobj);
nouveau_object_ref(NULL, pobject);
*pobject = nv_object(gpuobj);
break;
default:
- break;
+ return -EINVAL;
}
return ret;