[Intel-gfx] [PATCH 23/33] drm/i915: Convert i915_gem_flush_ggtt_writes to intel_gt

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 18 13:08:40 UTC 2019


Quoting Tvrtko Ursulin (2019-06-18 14:03:35)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Having introduced struct intel_gt (named the anonymous structure in i915)
> we can start using it to compartmentalize our code better. It makes more
> sense logically to have the code internally like this and it will also
> help with future split between gt and display in i915.
> 
> v2:
>  * Keep ggtt flush before fb obj flush. (Chris)
> 
> v3:
>  * Fix refactoring fail.
>  * Always flush ggtt writes. (Chris)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_object.c    |  7 ++--
>  .../drm/i915/gem/selftests/i915_gem_mman.c    |  3 +-
>  drivers/gpu/drm/i915/gt/intel_gt.c            | 41 +++++++++++++++++++
>  drivers/gpu/drm/i915/gt/intel_gt.h            |  2 +
>  drivers/gpu/drm/i915/i915_drv.h               |  2 -
>  drivers/gpu/drm/i915/i915_gem.c               | 40 ------------------
>  drivers/gpu/drm/i915/i915_vma.c               |  3 +-
>  drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |  2 +-
>  8 files changed, 52 insertions(+), 48 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> index 272ce30ce1d3..f94c8b2d85d3 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> @@ -23,7 +23,7 @@
>   */
>  
>  #include "display/intel_frontbuffer.h"
> -
> +#include "gt/intel_gt.h"
>  #include "i915_drv.h"
>  #include "i915_gem_clflush.h"
>  #include "i915_gem_context.h"
> @@ -368,7 +368,6 @@ void
>  i915_gem_object_flush_write_domain(struct drm_i915_gem_object *obj,
>                                    unsigned int flush_domains)
>  {
> -       struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
>         struct i915_vma *vma;
>  
>         assert_object_held(obj);
> @@ -378,7 +377,8 @@ i915_gem_object_flush_write_domain(struct drm_i915_gem_object *obj,
>  
>         switch (obj->write_domain) {
>         case I915_GEM_DOMAIN_GTT:
> -               i915_gem_flush_ggtt_writes(dev_priv);
> +               for_each_ggtt_vma(vma, obj)
> +                       intel_gt_flush_ggtt_writes(vma->vm->gt);

The repetition still bothers me, but
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list