Skip to content

Commit

Permalink
drm/i915/gem: Merge GGTT vma flush into a single loop
Browse files Browse the repository at this point in the history
We only need the one loop to find the dirty vma flush them and their
chipset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191119100929.2628356-6-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Nov 19, 2019
1 parent 42d7025 commit 62d1c85
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/gpu/drm/i915/gem/i915_gem_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,12 @@ i915_gem_object_flush_write_domain(struct drm_i915_gem_object *obj,

switch (obj->write_domain) {
case I915_GEM_DOMAIN_GTT:
for_each_ggtt_vma(vma, obj)
intel_gt_flush_ggtt_writes(vma->vm->gt);

intel_frontbuffer_flush(obj->frontbuffer, ORIGIN_CPU);

for_each_ggtt_vma(vma, obj) {
if (vma->iomap)
continue;

i915_vma_unset_ggtt_write(vma);
if (i915_vma_unset_ggtt_write(vma))
intel_gt_flush_ggtt_writes(vma->vm->gt);
}

intel_frontbuffer_flush(obj->frontbuffer, ORIGIN_CPU);
break;

case I915_GEM_DOMAIN_WC:
Expand Down

0 comments on commit 62d1c85

Please sign in to comment.