#define NV10_PGRAPH_DMA_PITCH 0x00400770
#define NV10_PGRAPH_DVD_COLORFMT 0x00400774
#define NV10_PGRAPH_SCALED_FORMAT 0x00400778
-#define NV10_PGRAPH_CHANNEL_CTX_TABLE 0x00400780
-#define NV10_PGRAPH_CHANNEL_CTX_SIZE 0x00400784
+#define NV20_PGRAPH_CHANNEL_CTX_TABLE 0x00400780
#define NV20_PGRAPH_CHANNEL_CTX_POINTER 0x00400784
-#define NV10_PGRAPH_CHANNEL_CTX_POINTER 0x00400788
#define NV20_PGRAPH_CHANNEL_CTX_XFER 0x00400788
#define NV20_PGRAPH_CHANNEL_CTX_XFER_LOAD 0x00000001
#define NV20_PGRAPH_CHANNEL_CTX_XFER_SAVE 0x00000002
INSTANCE_WR(dev_priv->ctx_table->gpuobj, chan->id, 0);
}
-static int
-nouveau_graph_wait_idle(struct drm_device *dev)
-{
- struct drm_nouveau_private *dev_priv = dev->dev_private;
- int tv = 1000;
-
- while (tv--) {
- if (NV_READ(NV04_PGRAPH_STATUS) == 0)
- break;
- }
-
- if (NV_READ(NV04_PGRAPH_STATUS)) {
- DRM_ERROR("timeout!\n");
- return -EBUSY;
- }
- return 0;
-}
-
int nv20_graph_load_context(struct nouveau_channel *chan)
{
struct drm_device *dev = chan->dev;
NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_XFER,
NV20_PGRAPH_CHANNEL_CTX_XFER_LOAD);
- return nouveau_graph_wait_idle(dev);
+ nouveau_wait_for_idle(dev);
+ return 0;
}
int nv20_graph_save_context(struct nouveau_channel *chan)
NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_XFER,
NV20_PGRAPH_CHANNEL_CTX_XFER_SAVE);
- return nouveau_graph_wait_idle(dev);
+ nouveau_wait_for_idle(dev);
+ return 0;
}
static void nv20_graph_rdi(struct drm_device *dev) {
&dev_priv->ctx_table)))
return ret;
- NV_WRITE(NV10_PGRAPH_CHANNEL_CTX_TABLE,
+ NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_TABLE,
dev_priv->ctx_table->instance >> 4);
//XXX need to be done and save/restore for each fifo ???
&dev_priv->ctx_table)))
return ret;
- NV_WRITE(NV10_PGRAPH_CHANNEL_CTX_TABLE,
+ NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_TABLE,
dev_priv->ctx_table->instance >> 4);
NV_WRITE(NV03_PGRAPH_INTR , 0xFFFFFFFF);
NV_WRITE(0x400B84, 0x0c000000);
NV_WRITE(NV04_PGRAPH_DEBUG_2, 0x62ff0f7f);
NV_WRITE(0x4000c0, 0x00000016);
- NV_WRITE(NV10_PGRAPH_CHANNEL_CTX_TABLE, 0x000014e4);
+ NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_TABLE, 0x000014e4);
/* copy tile info from PFB */
for (i=0; i<NV10_PFB_TILE__SIZE; i++) {