diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f0f8c6ff684f..9297143447cf 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2931,6 +2931,9 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write) | |||
2931 | if (obj->gtt_space == NULL) | 2931 | if (obj->gtt_space == NULL) |
2932 | return -EINVAL; | 2932 | return -EINVAL; |
2933 | 2933 | ||
2934 | if (obj->base.write_domain == I915_GEM_DOMAIN_GTT) | ||
2935 | return 0; | ||
2936 | |||
2934 | ret = i915_gem_object_flush_gpu_write_domain(obj); | 2937 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
2935 | if (ret) | 2938 | if (ret) |
2936 | return ret; | 2939 | return ret; |
@@ -3033,6 +3036,9 @@ i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write) | |||
3033 | uint32_t old_write_domain, old_read_domains; | 3036 | uint32_t old_write_domain, old_read_domains; |
3034 | int ret; | 3037 | int ret; |
3035 | 3038 | ||
3039 | if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) | ||
3040 | return 0; | ||
3041 | |||
3036 | ret = i915_gem_object_flush_gpu_write_domain(obj); | 3042 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
3037 | if (ret) | 3043 | if (ret) |
3038 | return ret; | 3044 | return ret; |