]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/i915: Clear GPU read domains on reset
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 19 Sep 2010 11:31:36 +0000 (12:31 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 21 Sep 2010 10:19:53 +0000 (11:19 +0100)
Clear the GPU read domain for the inactive objects on a reset so that
they are correctly invalidated on reuse.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c

index cb1ddc6af6a6351df1494e57ba319f4a4f6af43a..38e889bfd99c7bdc93b805bf1414636a31284499 100644 (file)
@@ -391,6 +391,11 @@ int i965_reset(struct drm_device *dev, u8 flags)
         */
        i915_gem_reset_flushing_list(dev);
 
+       /* Move everything out of the GPU domains to ensure we do any
+        * necessary invalidation upon reuse.
+        */
+       i915_gem_reset_inactive_gpu_domains(dev);
+
        /*
         * Set the domains we want to reset (GRDOM/bits 2 and 3) as
         * well as the reset bit (GR/bit 0).  Setting the GR bit
index 50fcb91218e8efc826ee376ef6816acf6b28fbc8..ae05008a5900d6a60fb8d3e26bd7ea443b6230f4 100644 (file)
@@ -998,6 +998,7 @@ int i915_gem_object_put_fence_reg(struct drm_gem_object *obj,
                                  bool interruptible);
 void i915_gem_retire_requests(struct drm_device *dev);
 void i915_gem_reset_flushing_list(struct drm_device *dev);
+void i915_gem_reset_inactive_gpu_domains(struct drm_device *dev);
 void i915_gem_clflush_object(struct drm_gem_object *obj);
 int i915_gem_object_set_domain(struct drm_gem_object *obj,
                               uint32_t read_domains,
index 4e978e4044a3b81e6ae0f35af8fc171bc2684c41..325f52bc1401326cd4d10e829e586b0ef7bd6735 100644 (file)
@@ -1699,6 +1699,19 @@ void i915_gem_reset_flushing_list(struct drm_device *dev)
        }
 }
 
+void i915_gem_reset_inactive_gpu_domains(struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       struct drm_i915_gem_object *obj_priv;
+
+       list_for_each_entry(obj_priv,
+                           &dev_priv->mm.inactive_list,
+                           list)
+       {
+               obj_priv->base.read_domains &= ~I915_GEM_GPU_DOMAINS;
+       }
+}
+
 /**
  * This function clears the request list as sequence numbers are passed.
  */