diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2009-03-09 08:06:30 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2009-03-09 08:06:30 +1000 |
commit | 54a66c3b4483e9f5def9d749705edb5a97ef161d (patch) | |
tree | 57534547e31b42f66ffd9576e41001d014b38624 | |
parent | 6f76c1480ce501442a5e876f0841c5407dd90c58 (diff) |
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.
-rw-r--r-- | shared-core/nouveau_object.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c index 79e3a8fb..36a559d9 100644 --- a/shared-core/nouveau_object.c +++ b/shared-core/nouveau_object.c @@ -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); |