summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_object.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-03-31 05:40:43 (GMT)
committerBen Skeggs <bskeggs@redhat.com>2011-05-16 00:48:01 (GMT)
commit6dfdd7a61e8fc25552d9de1cb25272324dfc4c13 (patch)
treed158037ace54303d33323a14bafc8a2ef27a85b5 /drivers/gpu/drm/nouveau/nouveau_object.c
parent2d7b919c9b0ca3df1da2498bb0cede25ddd97e00 (diff)
downloadlinux-6dfdd7a61e8fc25552d9de1cb25272324dfc4c13.tar.xz
drm/nouveau: working towards a common way to represent engines
There's lots of more-or-less independant engines present on NVIDIA GPUs these days, and we generally want to perform the same operations on them. Implementing new ones requires hooking into lots of different places, the aim of this work is to make this simpler and cleaner. NV84:NV98 PCRYPT moved over as a test. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_object.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_object.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index f7b806f..4fb05b6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -621,7 +621,6 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
{
struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
- struct nouveau_crypt_engine *pcrypt = &dev_priv->engine.crypt;
struct drm_device *dev = chan->dev;
struct nouveau_gpuobj_class *oc;
int ret;
@@ -649,17 +648,15 @@ found:
}
return pgraph->object_new(chan, handle, class);
- case NVOBJ_ENGINE_CRYPT:
- if (!chan->crypt_ctx) {
- ret = pcrypt->create_context(chan);
- if (ret)
- return ret;
- }
+ }
- return pcrypt->object_new(chan, handle, class);
+ if (!chan->engctx[oc->engine]) {
+ ret = dev_priv->eng[oc->engine]->context_new(chan, oc->engine);
+ if (ret)
+ return ret;
}
- BUG_ON(1);
+ return dev_priv->eng[oc->engine]->object_new(chan, oc->engine, handle, class);
}
static int