Re: [PATCH] drm/i915/vma: Move the bind_count vs pin_count assertion to a helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Chris Wilson (2018-06-05 10:34:20)
> To spare ourselves a long line later, refactor the repeated check of
> bind_count vs pin_count to a helper.
> 
> Suggested-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
> Cc: Matthew Auld <matthew.william.auld@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_vma.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 9324d476e0a7..0b3de2f19e1c 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -459,6 +459,17 @@ bool i915_gem_valid_gtt_space(struct i915_vma *vma, unsigned long cache_level)
>         return true;
>  }
>  
> +static void assert_bind_count(struct drm_i915_gem_object *obj)
> +{
> +       /*
> +        * Combine the assertion that the object is bound and that we have
> +        * pinned its pages. But we should never have pinned the pages

bound the object more than we have pinned its pages.

That makes more sense.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux