aboutsummaryrefslogtreecommitdiff
path: root/shared-core/nv40_graph.c
diff options
context:
space:
mode:
authorBen Skeggs <darktama@iinet.net.au>2007-01-28 23:48:33 +1100
committerBen Skeggs <darktama@iinet.net.au>2007-01-28 23:48:33 +1100
commitee4ac5c897faa499ad24c148b4f065bc770b529d (patch)
tree96a993e79f628539d47530d5f84fc3a62b4e59b6 /shared-core/nv40_graph.c
parentc744bfde2de1713f0c15a185538a003d64c52d80 (diff)
nouveau: determine chipset type at startup, instead of every time we use it.
Diffstat (limited to 'shared-core/nv40_graph.c')
-rw-r--r--shared-core/nv40_graph.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/shared-core/nv40_graph.c b/shared-core/nv40_graph.c
index 00583cdc..71434e5b 100644
--- a/shared-core/nv40_graph.c
+++ b/shared-core/nv40_graph.c
@@ -611,10 +611,9 @@ nv40_graph_context_create(drm_device_t *dev, int channel)
struct nouveau_fifo *chan = &dev_priv->fifos[channel];
void (*ctx_init)(drm_device_t *, struct mem_block *);
unsigned int ctx_size;
- int i, chipset;
+ int i;
- chipset = (NV_READ(NV_PMC_BOOT_0) & 0x0ff00000) >> 20;
- switch (chipset) {
+ switch (dev_priv->chipset) {
case 0x40:
ctx_size = NV40_GRCTX_SIZE;
ctx_init = nv40_graph_context_init;
@@ -896,17 +895,16 @@ nv40_graph_init(drm_device_t *dev)
(drm_nouveau_private_t *)dev->dev_private;
uint32_t *ctx_voodoo;
uint32_t pg0220_inst;
- int i, chipset;
+ int i;
- chipset = (NV_READ(NV_PMC_BOOT_0) & 0x0ff00000) >> 20;
- DRM_DEBUG("chipset (from PMC_BOOT_0): NV%02X\n", chipset);
- switch (chipset) {
+ switch (dev_priv->chipset) {
case 0x40: ctx_voodoo = nv40_ctx_voodoo; break;
case 0x43: ctx_voodoo = nv43_ctx_voodoo; break;
case 0x4a: ctx_voodoo = nv4a_ctx_voodoo; break;
case 0x4e: ctx_voodoo = nv4e_ctx_voodoo; break;
default:
- DRM_ERROR("Unknown ctx_voodoo for chipset 0x%02x\n", chipset);
+ DRM_ERROR("Unknown ctx_voodoo for chipset 0x%02x\n",
+ dev_priv->chipset);
ctx_voodoo = NULL;
break;
}