aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-11-23 19:10:23 -0500
committerBen Skeggs <bskeggs@redhat.com>2010-12-21 02:17:26 -0500
commit7460d70355eb568817296d6d3364f72d72eeba70 (patch)
tree45906ffcaa9c99c1ccea36f8d84d67aa4a9bbac4
parent587107b690f567690982fb504047e7b0a6590344 (diff)
drm/nvc0: gpuobj_new need only check validity and init the relevant engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_object.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index 55c9fdcfa67f..c64fd971b867 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -643,10 +643,13 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
643found: 643found:
644 switch (oc->engine) { 644 switch (oc->engine) {
645 case NVOBJ_ENGINE_SW: 645 case NVOBJ_ENGINE_SW:
646 ret = nouveau_gpuobj_sw_new(chan, class, &gpuobj); 646 if (dev_priv->card_type < NV_C0) {
647 if (ret) 647 ret = nouveau_gpuobj_sw_new(chan, class, &gpuobj);
648 return ret; 648 if (ret)
649 goto insert; 649 return ret;
650 goto insert;
651 }
652 break;
650 case NVOBJ_ENGINE_GR: 653 case NVOBJ_ENGINE_GR:
651 if (dev_priv->card_type >= NV_50 && !chan->ramin_grctx) { 654 if (dev_priv->card_type >= NV_50 && !chan->ramin_grctx) {
652 struct nouveau_pgraph_engine *pgraph = 655 struct nouveau_pgraph_engine *pgraph =
@@ -669,6 +672,10 @@ found:
669 break; 672 break;
670 } 673 }
671 674
675 /* we're done if this is fermi */
676 if (dev_priv->card_type >= NV_C0)
677 return 0;
678
672 ret = nouveau_gpuobj_new(dev, chan, 679 ret = nouveau_gpuobj_new(dev, chan,
673 nouveau_gpuobj_class_instmem_size(dev, class), 680 nouveau_gpuobj_class_instmem_size(dev, class),
674 16, 681 16,