drm/nv50: use correct PRAMIN flush register on original nv50
authorBen Skeggs <bskeggs@redhat.com>
Thu, 15 Jul 2010 01:02:54 +0000 (11:02 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 26 Jul 2010 01:41:36 +0000 (11:41 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nv50_instmem.c

index 587a0ab1fe67b6900ec6d27f6b0227e6a6062ccc..16856e0354f8bfc3f4f751d1d2b139f8a8ed73ea 100644 (file)
@@ -1028,6 +1028,7 @@ extern void nv50_instmem_clear(struct drm_device *, struct nouveau_gpuobj *);
 extern int  nv50_instmem_bind(struct drm_device *, struct nouveau_gpuobj *);
 extern int  nv50_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *);
 extern void nv50_instmem_flush(struct drm_device *);
+extern void nv84_instmem_flush(struct drm_device *);
 extern void nv50_vm_flush(struct drm_device *, int engine);
 
 /* nv04_mc.c */
index c58ff9c48603e38529d732f70d24c99796491490..0bf79bf8e61acace38a13480da73c5b978a7f63c 100644 (file)
@@ -266,7 +266,10 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
                engine->instmem.clear           = nv50_instmem_clear;
                engine->instmem.bind            = nv50_instmem_bind;
                engine->instmem.unbind          = nv50_instmem_unbind;
-               engine->instmem.flush           = nv50_instmem_flush;
+               if (dev_priv->chipset == 0x50)
+                       engine->instmem.flush   = nv50_instmem_flush;
+               else
+                       engine->instmem.flush   = nv84_instmem_flush;
                engine->mc.init                 = nv50_mc_init;
                engine->mc.takedown             = nv50_mc_takedown;
                engine->timer.init              = nv04_timer_init;
index 2a5ec887291c4432f1516d1ad5289540afbe41b3..2ed893cbff69881268e49f1122db29bb042dac95 100644 (file)
@@ -485,6 +485,14 @@ nv50_instmem_unbind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj)
 
 void
 nv50_instmem_flush(struct drm_device *dev)
+{
+       nv_wr32(dev, 0x00330c, 0x00000001);
+       if (!nv_wait(0x00330c, 0x00000001, 0x00000000))
+               NV_ERROR(dev, "PRAMIN flush timeout\n");
+}
+
+void
+nv84_instmem_flush(struct drm_device *dev)
 {
        nv_wr32(dev, 0x070000, 0x00000001);
        if (!nv_wait(0x070000, 0x00000001, 0x00000000))