diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2009-03-06 09:03:27 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2009-03-06 09:09:08 +1000 |
commit | baf814d1f26b377e313099b7794c435671ac15c2 (patch) | |
tree | 7efb837ddbfc299f88bcd42942788b98dbba1de6 /shared-core | |
parent | 7946b7615fbfaffbb40914db94e094bca7325541 (diff) |
nouveau: unbreak <nv50 and any ppc cards after instmem changes
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/nouveau_object.c | 4 | ||||
-rw-r--r-- | shared-core/nouveau_state.c | 53 | ||||
-rw-r--r-- | shared-core/nv04_instmem.c | 2 |
3 files changed, 34 insertions, 25 deletions
diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c index bcd82052..b64a58a3 100644 --- a/shared-core/nouveau_object.c +++ b/shared-core/nouveau_object.c @@ -1066,9 +1066,9 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, chan->vm_vram_pt[i]->instance | 0x61); INSTANCE_WR(chan->vm_pd, pde++, 0x00000000); } - } - instmem->finish_access(dev); + instmem->finish_access(dev); + } /* RAMHT */ if (dev_priv->card_type < NV_50) { diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index a8f9bc6a..9be69559 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -461,29 +461,6 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) nv_wr32(NV03_PMC_BOOT_1,0x00000001); DRM_MEMORYBARRIER(); - - /* if we have an OF card, copy vbios to RAMIN */ - dn = pci_device_to_OF_node(dev->pdev); - if (dn) - { - int size; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) - const uint32_t *bios = of_get_property(dn, "NVDA,BMP", &size); -#else - const uint32_t *bios = get_property(dn, "NVDA,BMP", &size); -#endif - if (bios) - { - int i; - for(i=0;i<size;i+=4) - nv_wi32(i, bios[i/4]); - DRM_INFO("OF bios successfully copied (%d bytes)\n",size); - } - else - DRM_INFO("Unable to get the OF bios\n"); - } - else - DRM_INFO("Unable to get the OF node\n"); #endif /* Time to determine the card architecture */ @@ -570,6 +547,32 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) } } +#if defined(__powerpc__) + /* if we have an OF card, copy vbios to RAMIN */ + dn = pci_device_to_OF_node(dev->pdev); + if (dn) + { + int size; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + const uint32_t *bios = of_get_property(dn, "NVDA,BMP", &size); +#else + const uint32_t *bios = get_property(dn, "NVDA,BMP", &size); +#endif + if (bios) + { + int i; + dev_priv->engine.instmem.prepare_access(dev, true); + for(i=0;i<size;i+=4) + nv_wi32(i, bios[i/4]); + dev_priv->engine.instmem.finish_access(dev); + DRM_INFO("OF bios successfully copied (%d bytes)\n",size); + } + else + DRM_INFO("Unable to get the OF bios\n"); + } + else + DRM_INFO("Unable to get the OF node\n"); +#endif /* For those who think they want to be funny. */ if (dev_priv->card_type < NV_50) @@ -865,8 +868,10 @@ static int nouveau_resume(struct drm_device *dev) } } + dev_priv->engine.instmem.prepare_access(dev, true); for (i = 0; i < susres->ramin_size / 4; i++) nv_wi32(i << 2, susres->ramin_copy[i]); + dev_priv->engine.instmem.finish_access(dev); engine->mc.init(dev); engine->timer.init(dev); @@ -885,8 +890,10 @@ static int nouveau_resume(struct drm_device *dev) /* PMC power cycling PFIFO in init clobbers some of the stuff stored in * PRAMIN (such as NV04_PFIFO_CACHE1_DMA_INSTANCE). this is unhelpful */ + dev_priv->engine.instmem.prepare_access(dev, true); for (i = 0; i < susres->ramin_size / 4; i++) nv_wi32(i << 2, susres->ramin_copy[i]); + dev_priv->engine.instmem.finish_access(dev); engine->fifo.load_context(dev_priv->fifos[0]); nv_wr32(NV04_PFIFO_MODE, susres->fifo_mode); diff --git a/shared-core/nv04_instmem.c b/shared-core/nv04_instmem.c index 7d902d86..33f92147 100644 --- a/shared-core/nv04_instmem.c +++ b/shared-core/nv04_instmem.c @@ -35,8 +35,10 @@ nv04_instmem_determine_amount(struct drm_device *dev) DRM_DEBUG("RAMIN size: %dKiB\n", dev_priv->ramin_rsvd_vram>>10); /* Clear all of it, except the BIOS image that's in the first 64KiB */ + dev_priv->engine.instmem.prepare_access(dev, true); for (i=(64*1024); i<dev_priv->ramin_rsvd_vram; i+=4) nv_wi32(i, 0x00000000); + dev_priv->engine.instmem.finish_access(dev); } static void |