@@ -879,6 +879,8 @@ struct drm_i915_gem_object {
* reaches 0, dev_priv->pending_flip_queue will be woken up.
*/
atomic_t pending_flip;
+
+ atomic_t always_cpu_dirty;
};
#define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
@@ -179,6 +179,12 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj,
invalidate_domains |=
obj->base.pending_read_domains & ~obj->base.write_domain;
}
+
+ if (atomic_read(&obj->always_cpu_dirty)) {
+ flush_domains |= I915_GEM_DOMAIN_CPU;
+ cd->flush_domains |= I915_GEM_DOMAIN_CPU;
+ }
+
/*
* Invalidate any read caches which may have
* stale data. That is, any new read domains.
@@ -201,6 +207,7 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj,
cd->invalidate_domains |= invalidate_domains;
cd->flush_domains |= flush_domains;
+
if (flush_domains & I915_GEM_GPU_DOMAINS)
cd->flush_rings |= obj->ring->id;
if (invalidate_domains & I915_GEM_GPU_DOMAINS)
Oops. The previous patch was the wrong one. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> --- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 +++++++ 2 files changed, 9 insertions(+), 0 deletions(-)