summaryrefslogtreecommitdiff
path: root/shared-core/nv04_fifo.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-07-05 00:12:33 +1000
committerBen Skeggs <skeggsb@gmail.com>2007-07-09 16:16:44 +1000
commitc806bba4665bb369168ee0b453fa28e2e0bf2a5d (patch)
treec3ded5cfc4048301654769a6fa224c3abb57c707 /shared-core/nv04_fifo.c
parent3324342e42b78aef8e90e11273776dd2b3b92074 (diff)
nouveau/nv50: Initial channel/object support
Should be OK on G84 for a single channel, multiple channels *almost* work. Untested on G80.
Diffstat (limited to 'shared-core/nv04_fifo.c')
-rw-r--r--shared-core/nv04_fifo.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/shared-core/nv04_fifo.c b/shared-core/nv04_fifo.c
index b84f74c1..e2e934d7 100644
--- a/shared-core/nv04_fifo.c
+++ b/shared-core/nv04_fifo.c
@@ -39,7 +39,7 @@ int
nv04_fifo_create_context(drm_device_t *dev, int channel)
{
drm_nouveau_private_t *dev_priv = dev->dev_private;
- struct nouveau_fifo *chan = &dev_priv->fifos[channel];
+ struct nouveau_fifo *chan = dev_priv->fifos[channel];
int ret;
if ((ret = nouveau_gpuobj_new_fake(dev, NV04_RAMFC(channel),
@@ -60,6 +60,9 @@ nv04_fifo_create_context(drm_device_t *dev, int channel)
NV_PFIFO_CACHE1_BIG_ENDIAN |
#endif
0));
+
+ /* enable the fifo dma operation */
+ NV_WRITE(NV04_PFIFO_MODE,NV_READ(NV04_PFIFO_MODE)|(1<<channel));
return 0;
}
@@ -67,7 +70,9 @@ void
nv04_fifo_destroy_context(drm_device_t *dev, int channel)
{
drm_nouveau_private_t *dev_priv = dev->dev_private;
- struct nouveau_fifo *chan = &dev_priv->fifos[channel];
+ struct nouveau_fifo *chan = dev_priv->fifos[channel];
+
+ NV_WRITE(NV04_PFIFO_MODE, NV_READ(NV04_PFIFO_MODE)&~(1<<channel));
if (chan->ramfc)
nouveau_gpuobj_ref_del(dev, &chan->ramfc);
@@ -77,7 +82,7 @@ int
nv04_fifo_load_context(drm_device_t *dev, int channel)
{
drm_nouveau_private_t *dev_priv = dev->dev_private;
- struct nouveau_fifo *chan = &dev_priv->fifos[channel];
+ struct nouveau_fifo *chan = dev_priv->fifos[channel];
uint32_t tmp;
NV_WRITE(NV03_PFIFO_CACHE1_PUSH1, (1<<8) | channel);
@@ -105,7 +110,7 @@ int
nv04_fifo_save_context(drm_device_t *dev, int channel)
{
drm_nouveau_private_t *dev_priv = dev->dev_private;
- struct nouveau_fifo *chan = &dev_priv->fifos[channel];
+ struct nouveau_fifo *chan = dev_priv->fifos[channel];
uint32_t tmp;
RAMFC_WR(DMA_PUT, NV04_PFIFO_CACHE1_DMA_PUT);