diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-10-20 03:47:09 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-03 06:10:44 +0100 |
commit | f4512e6579ddaa9b1f8ab1d5659131243ffc421f (patch) | |
tree | 8e2a5b4457ce9eaf8e7ac6d619f7cf69074e0d66 /drivers/gpu/drm/nouveau/nouveau_object.c | |
parent | drm/nv50: remove excessive alignment of graph/crypt contexts (diff) | |
download | linux-f4512e6579ddaa9b1f8ab1d5659131243ffc421f.tar.xz linux-f4512e6579ddaa9b1f8ab1d5659131243ffc421f.zip |
drm/nv50: create graph and crypt contexts on demand
This really needs cleaning up somehow, and probably investigate what's
needed to do this on earlier generations. NVIDIA do something similar
there too.
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.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index ee526534c6f4..54078186fe65 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c @@ -634,6 +634,29 @@ found: if (oc->engine == NVOBJ_ENGINE_SW) return nouveau_gpuobj_sw_new(chan, class, gpuobj); + switch (oc->engine) { + case NVOBJ_ENGINE_GR: + if (dev_priv->card_type >= NV_50 && !chan->ramin_grctx) { + struct nouveau_pgraph_engine *pgraph = + &dev_priv->engine.graph; + + ret = pgraph->create_context(chan); + if (ret) + return ret; + } + break; + case NVOBJ_ENGINE_CRYPT: + if (!chan->crypt_ctx) { + struct nouveau_crypt_engine *pcrypt = + &dev_priv->engine.crypt; + + ret = pcrypt->create_context(chan); + if (ret) + return ret; + } + break; + } + ret = nouveau_gpuobj_new(dev, chan, nouveau_gpuobj_class_instmem_size(dev, class), 16, |