diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-18 12:17:09 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-18 17:36:57 -0400 |
commit | cd3127d684f027f7c85aec57e284dcecd033dccf (patch) | |
tree | 0cbe626d99e158a591652213709af8ed13114ac5 | |
parent | 383d5823e938129fe10c76e0032a22734849049c (diff) |
drm/i915: Stop discarding GTT cache-domain on unbind vma
Since commit 43566dedde54 ("drm/i915: Broaden application of
set-domain(GTT)") we allowed objects to be in the GTT domain, but unbound.
Therefore removing the GTT cache domain when removing the GGTT vma is no
longer semantically correct.
An unfortunate side-effect is we lose the wondrously named
i915_gem_object_finish_gtt(), not to be confused with
i915_gem_gtt_finish_object()!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Akash Goel <akash.goel@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160818161718.27187-30-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 14c624ee6dbf..0e1f5dde2e87 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2857,27 +2857,6 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj, | |||
2857 | return 0; | 2857 | return 0; |
2858 | } | 2858 | } |
2859 | 2859 | ||
2860 | static void i915_gem_object_finish_gtt(struct drm_i915_gem_object *obj) | ||
2861 | { | ||
2862 | u32 old_write_domain, old_read_domains; | ||
2863 | |||
2864 | /* Force a pagefault for domain tracking on next user access */ | ||
2865 | i915_gem_release_mmap(obj); | ||
2866 | |||
2867 | if ((obj->base.read_domains & I915_GEM_DOMAIN_GTT) == 0) | ||
2868 | return; | ||
2869 | |||
2870 | old_read_domains = obj->base.read_domains; | ||
2871 | old_write_domain = obj->base.write_domain; | ||
2872 | |||
2873 | obj->base.read_domains &= ~I915_GEM_DOMAIN_GTT; | ||
2874 | obj->base.write_domain &= ~I915_GEM_DOMAIN_GTT; | ||
2875 | |||
2876 | trace_i915_gem_object_change_domain(obj, | ||
2877 | old_read_domains, | ||
2878 | old_write_domain); | ||
2879 | } | ||
2880 | |||
2881 | static void __i915_vma_iounmap(struct i915_vma *vma) | 2860 | static void __i915_vma_iounmap(struct i915_vma *vma) |
2882 | { | 2861 | { |
2883 | GEM_BUG_ON(i915_vma_is_pinned(vma)); | 2862 | GEM_BUG_ON(i915_vma_is_pinned(vma)); |
@@ -2933,13 +2912,14 @@ int i915_vma_unbind(struct i915_vma *vma) | |||
2933 | GEM_BUG_ON(!obj->pages); | 2912 | GEM_BUG_ON(!obj->pages); |
2934 | 2913 | ||
2935 | if (i915_vma_is_map_and_fenceable(vma)) { | 2914 | if (i915_vma_is_map_and_fenceable(vma)) { |
2936 | i915_gem_object_finish_gtt(obj); | ||
2937 | |||
2938 | /* release the fence reg _after_ flushing */ | 2915 | /* release the fence reg _after_ flushing */ |
2939 | ret = i915_vma_put_fence(vma); | 2916 | ret = i915_vma_put_fence(vma); |
2940 | if (ret) | 2917 | if (ret) |
2941 | return ret; | 2918 | return ret; |
2942 | 2919 | ||
2920 | /* Force a pagefault for domain tracking on next user access */ | ||
2921 | i915_gem_release_mmap(obj); | ||
2922 | |||
2943 | __i915_vma_iounmap(vma); | 2923 | __i915_vma_iounmap(vma); |
2944 | vma->flags &= ~I915_VMA_CAN_FENCE; | 2924 | vma->flags &= ~I915_VMA_CAN_FENCE; |
2945 | } | 2925 | } |