Skip to content

Commit

Permalink
drm/nvc0: gpuobj_new need only check validity and init the relevant e…
Browse files Browse the repository at this point in the history
…ngine

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Dec 21, 2010
1 parent 587107b commit 7460d70
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/gpu/drm/nouveau/nouveau_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,13 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
found:
switch (oc->engine) {
case NVOBJ_ENGINE_SW:
ret = nouveau_gpuobj_sw_new(chan, class, &gpuobj);
if (ret)
return ret;
goto insert;
if (dev_priv->card_type < NV_C0) {
ret = nouveau_gpuobj_sw_new(chan, class, &gpuobj);
if (ret)
return ret;
goto insert;
}
break;
case NVOBJ_ENGINE_GR:
if (dev_priv->card_type >= NV_50 && !chan->ramin_grctx) {
struct nouveau_pgraph_engine *pgraph =
Expand All @@ -669,6 +672,10 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
break;
}

/* we're done if this is fermi */
if (dev_priv->card_type >= NV_C0)
return 0;

ret = nouveau_gpuobj_new(dev, chan,
nouveau_gpuobj_class_instmem_size(dev, class),
16,
Expand Down

0 comments on commit 7460d70

Please sign in to comment.