Skip to content

Commit

Permalink
i915/drm: Remove two redundant agp_chipset_flushes
Browse files Browse the repository at this point in the history
agp_chipset_flush() is for flushing the intel GMCH write cache via the
IFP, these two uses are for when we're getting the object into the cpu
READ domain, and thus should not be needed. This confused me when I was
getting my head around the code.

With thanks to airlied for helping me check my mental picture of how the
flushes and clflushes are supposed to be used.

Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
  • Loading branch information
Owain G. Ainsworth authored and Eric Anholt committed Mar 27, 2009
1 parent a6172a8 commit ad086c8
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,6 @@ i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write)
static int
i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write)
{
struct drm_device *dev = obj->dev;
int ret;

i915_gem_object_flush_gpu_write_domain(obj);
Expand All @@ -2400,7 +2399,6 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write)
/* Flush the CPU cache if it's still invalid. */
if ((obj->read_domains & I915_GEM_DOMAIN_CPU) == 0) {
i915_gem_clflush_object(obj);
drm_agp_chipset_flush(dev);

obj->read_domains |= I915_GEM_DOMAIN_CPU;
}
Expand Down Expand Up @@ -2612,7 +2610,6 @@ i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj)
static void
i915_gem_object_set_to_full_cpu_read_domain(struct drm_gem_object *obj)
{
struct drm_device *dev = obj->dev;
struct drm_i915_gem_object *obj_priv = obj->driver_private;

if (!obj_priv->page_cpu_valid)
Expand All @@ -2628,7 +2625,6 @@ i915_gem_object_set_to_full_cpu_read_domain(struct drm_gem_object *obj)
continue;
drm_clflush_pages(obj_priv->pages + i, 1);
}
drm_agp_chipset_flush(dev);
}

/* Free the page_cpu_valid mappings which are now stale, whether
Expand Down

0 comments on commit ad086c8

Please sign in to comment.