aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_object.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-03-31 01:40:43 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-05-15 20:48:01 -0400
commit6dfdd7a61e8fc25552d9de1cb25272324dfc4c13 (patch)
treed158037ace54303d33323a14bafc8a2ef27a85b5 /drivers/gpu/drm/nouveau/nouveau_object.c
parent2d7b919c9b0ca3df1da2498bb0cede25ddd97e00 (diff)
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 f7b806f26f2f..4fb05b6c6985 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)
621{ 621{
622 struct drm_nouveau_private *dev_priv = chan->dev->dev_private; 622 struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
623 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; 623 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
624 struct nouveau_crypt_engine *pcrypt = &dev_priv->engine.crypt;
625 struct drm_device *dev = chan->dev; 624 struct drm_device *dev = chan->dev;
626 struct nouveau_gpuobj_class *oc; 625 struct nouveau_gpuobj_class *oc;
627 int ret; 626 int ret;
@@ -649,17 +648,15 @@ found:
649 } 648 }
650 649
651 return pgraph->object_new(chan, handle, class); 650 return pgraph->object_new(chan, handle, class);
652 case NVOBJ_ENGINE_CRYPT: 651 }
653 if (!chan->crypt_ctx) {
654 ret = pcrypt->create_context(chan);
655 if (ret)
656 return ret;
657 }
658 652
659 return pcrypt->object_new(chan, handle, class); 653 if (!chan->engctx[oc->engine]) {
654 ret = dev_priv->eng[oc->engine]->context_new(chan, oc->engine);
655 if (ret)
656 return ret;
660 } 657 }
661 658
662 BUG_ON(1); 659 return dev_priv->eng[oc->engine]->object_new(chan, oc->engine, handle, class);
663} 660}
664 661
665static int 662static int