drm/nouveau: implement NVOBJ_FLAG_ZERO_FREE

Not really necessary it seems as we've been dealing without it for a while
now.  But, it's useful to be sure that we don't end up with stale bits
of state laying around.
This commit is contained in:
Ben Skeggs 2009-03-09 08:06:30 +10:00
parent 6f76c1480c
commit 54a66c3b44

View file

@ -349,6 +349,7 @@ nouveau_gpuobj_del(struct drm_device *dev, struct nouveau_gpuobj **pgpuobj)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_engine *engine = &dev_priv->engine;
struct nouveau_gpuobj *gpuobj;
int i;
DRM_DEBUG("gpuobj %p\n", pgpuobj ? *pgpuobj : NULL);
@ -361,6 +362,13 @@ nouveau_gpuobj_del(struct drm_device *dev, struct nouveau_gpuobj **pgpuobj)
return -EINVAL;
}
if (gpuobj->flags & NVOBJ_FLAG_ZERO_FREE) {
engine->instmem.prepare_access(dev, true);
for (i = 0; i < gpuobj->im_pramin->size; i += 4)
INSTANCE_WR(gpuobj, i/4, 0);
engine->instmem.finish_access(dev);
}
if (gpuobj->dtor)
gpuobj->dtor(dev, gpuobj);