nouveau: Use PMC_BOOT_0 to determine which ctx_voodoo to load.

This commit is contained in:
Ben Skeggs 2007-01-06 17:50:00 +11:00
parent 528ab8ce40
commit dbb0d979cc
2 changed files with 7 additions and 3 deletions

View file

@ -45,6 +45,7 @@
# define NV03_FIFO_REGS_DMAPUT(i) (NV03_FIFO_REGS(i)+0x40)
# define NV03_FIFO_REGS_DMAGET(i) (NV03_FIFO_REGS(i)+0x44)
#define NV_PMC_BOOT_0 0x00000000
#define NV_PMC_INTSTAT 0x00000100
# define NV_PMC_INTSTAT_PFIFO_PENDING (1<< 8)
# define NV_PMC_INTSTAT_PGRAPH_PENDING (1<<12)

View file

@ -427,13 +427,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;
int i, chipset;
switch (dev_priv->card_type) {
case NV_40:
chipset = (NV_READ(NV_PMC_BOOT_0) & 0x0ff00000) >> 20;
DRM_DEBUG("chipset (from PMC_BOOT_0): NV0x%02X\n", chipset);
switch (chipset) {
case 0x40:
ctx_voodoo = nv40_ctx_voodoo;
break;
default:
DRM_ERROR("Unknown ctx_voodoo for chipset 0x%02x\n", chipset);
ctx_voodoo = NULL;
break;
}