Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260159
b: refs/heads/master
c: b5ffc9b
h: refs/heads/master
i:
  260157: 0960837
  260155: ea28cb1
  260151: c84549d
  260143: 35538aa
  260127: 6031063
  260095: f5fe194
v: v3
  • Loading branch information
Chris Wilson authored and Keith Packard committed Jun 10, 2011
1 parent a0eeeba commit c5774c1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8198eea156df47e0e843ac5c7d4c8774e121c42
refs/heads/master: b5ffc9bc38a4766d586c3aca6830ed2bd6952e5b
27 changes: 25 additions & 2 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2149,6 +2149,30 @@ i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj)
return 0;
}

static void i915_gem_object_finish_gtt(struct drm_i915_gem_object *obj)
{
u32 old_write_domain, old_read_domains;

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

/* Act a barrier for all accesses through the GTT */
mb();

/* Force a pagefault for domain tracking on next user access */
i915_gem_release_mmap(obj);

old_read_domains = obj->base.read_domains;
old_write_domain = obj->base.write_domain;

obj->base.read_domains &= ~I915_GEM_DOMAIN_GTT;
obj->base.write_domain &= ~I915_GEM_DOMAIN_GTT;

trace_i915_gem_object_change_domain(obj,
old_read_domains,
old_write_domain);
}

/**
* Unbinds an object from the GTT aperture.
*/
Expand All @@ -2173,8 +2197,7 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
* cause memory corruption through use-after-free.
*/

/* blow away mappings if mapped through GTT */
i915_gem_release_mmap(obj);
i915_gem_object_finish_gtt(obj);

/* Move the object to the CPU domain to ensure that
* any possible CPU writes while it's not in the GTT
Expand Down

0 comments on commit c5774c1

Please sign in to comment.