aboutsummaryrefslogtreecommitdiff
path: root/shared-core/nouveau_fifo.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-06-24 18:56:40 +1000
committerBen Skeggs <skeggsb@gmail.com>2007-06-24 18:56:40 +1000
commitacb710d1a59788a0205cd0daf0859864e683fbd2 (patch)
treede244245178a60039c58bfd9a8c8e1aaddee7876 /shared-core/nouveau_fifo.c
parentf2e64d527699751d6b64698495ae1d48eeee6cf7 (diff)
nouveau: NV4X PGRAPH engtab functions
Diffstat (limited to 'shared-core/nouveau_fifo.c')
-rw-r--r--shared-core/nouveau_fifo.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c
index 50f094b9..527a71ae 100644
--- a/shared-core/nouveau_fifo.c
+++ b/shared-core/nouveau_fifo.c
@@ -473,18 +473,17 @@ static int nouveau_fifo_alloc(drm_device_t* dev, int *chan_ret, DRMFILE filp)
return ret;
}
break;
- case NV_40:
- case NV_44:
- ret = nv40_graph_context_create(dev, channel);
+ default:
+ if (!engine->graph.create_context) {
+ DRM_ERROR("graph.create_context == NULL\n");
+ return DRM_ERR(EINVAL);
+ }
+ ret = engine->graph.create_context(dev, channel);
if (ret) {
nouveau_fifo_free(dev, channel);
return ret;
}
break;
- default:
- DRM_ERROR("grctx: unknown card type\n");
- nouveau_fifo_free(dev, channel);
- return DRM_ERR(EINVAL);
}
/* Construct inital RAMFC for new channel */
@@ -532,6 +531,13 @@ static int nouveau_fifo_alloc(drm_device_t* dev, int *chan_ret, DRMFILE filp)
else
nouveau_fifo_context_restore(dev, channel);
+ if (engine->graph.load_context) {
+ ret = engine->graph.load_context(dev, channel);
+ if (ret) {
+ nouveau_fifo_free(dev, channel);
+ return ret;
+ }
+ } else
if (dev_priv->card_type >= NV_30) {
uint32_t inst;
@@ -594,8 +600,8 @@ void nouveau_fifo_free(drm_device_t* dev, int channel)
}
/* Cleanup PGRAPH state */
- if (dev_priv->card_type >= NV_40)
- nouveau_instmem_free(dev, chan->ramin_grctx);
+ if (engine->graph.destroy_context)
+ engine->graph.destroy_context(dev, channel);
else if (dev_priv->card_type >= NV_30) {
}
else if (dev_priv->card_type >= NV_20) {