Skip to content

Commit

Permalink
drm/i915: Skip the no-op domain changes when already in CPU|GTT domains
Browse files Browse the repository at this point in the history
Removes some superfluous fluff from tracing...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Chris Wilson committed Feb 7, 2011
1 parent db53a30 commit 8d7e3de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,9 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
if (obj->gtt_space == NULL)
return -EINVAL;

if (obj->base.write_domain == I915_GEM_DOMAIN_GTT)
return 0;

ret = i915_gem_object_flush_gpu_write_domain(obj);
if (ret)
return ret;
Expand Down Expand Up @@ -3033,6 +3036,9 @@ i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write)
uint32_t old_write_domain, old_read_domains;
int ret;

if (obj->base.write_domain == I915_GEM_DOMAIN_CPU)
return 0;

ret = i915_gem_object_flush_gpu_write_domain(obj);
if (ret)
return ret;
Expand Down

0 comments on commit 8d7e3de

Please sign in to comment.