Re: [PATCH 24/59] drm/ttm: pass man around instead of mem_type in some places

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

 



On Tue, 4 Aug 2020 at 12:57, Dave Airlie <airlied@xxxxxxxxx> wrote:
>
> From: Dave Airlie <airlied@xxxxxxxxxx>
>
> This makes it easier to cleanup things
>
> Reviewed-by: Christian König <christian.koenig@xxxxxxx>
> Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx>
Reviewed-by: Ben Skeggs <bskeggs@xxxxxxxxxx>

> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index da88ea6cb814..af1b1c3f6ed2 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -769,13 +769,12 @@ static int ttm_mem_evict_wait_busy(struct ttm_buffer_object *busy_bo,
>  }
>
>  static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
> -                              uint32_t mem_type,
> +                              struct ttm_mem_type_manager *man,
>                                const struct ttm_place *place,
>                                struct ttm_operation_ctx *ctx,
>                                struct ww_acquire_ctx *ticket)
>  {
>         struct ttm_buffer_object *bo = NULL, *busy_bo = NULL;
> -       struct ttm_mem_type_manager *man = &bdev->man[mem_type];
>         bool locked = false;
>         unsigned i;
>         int ret;
> @@ -924,7 +923,7 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
>                         break;
>                 if (unlikely(ret != -ENOSPC))
>                         return ret;
> -               ret = ttm_mem_evict_first(bdev, mem->mem_type, place, ctx,
> +               ret = ttm_mem_evict_first(bdev, man, place, ctx,
>                                           ticket);
>                 if (unlikely(ret != 0))
>                         return ret;
> @@ -1409,14 +1408,13 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
>  EXPORT_SYMBOL(ttm_bo_create);
>
>  static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
> -                                  unsigned mem_type)
> +                                  struct ttm_mem_type_manager *man)
>  {
>         struct ttm_operation_ctx ctx = {
>                 .interruptible = false,
>                 .no_wait_gpu = false,
>                 .flags = TTM_OPT_FLAG_FORCE_ALLOC
>         };
> -       struct ttm_mem_type_manager *man = &bdev->man[mem_type];
>         struct ttm_bo_global *glob = &ttm_bo_glob;
>         struct dma_fence *fence;
>         int ret;
> @@ -1430,7 +1428,7 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
>         for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
>                 while (!list_empty(&man->lru[i])) {
>                         spin_unlock(&glob->lru_lock);
> -                       ret = ttm_mem_evict_first(bdev, mem_type, NULL, &ctx,
> +                       ret = ttm_mem_evict_first(bdev, man, NULL, &ctx,
>                                                   NULL);
>                         if (ret)
>                                 return ret;
> @@ -1475,7 +1473,7 @@ int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type)
>
>         ret = 0;
>         if (mem_type > 0) {
> -               ret = ttm_bo_force_list_clean(bdev, mem_type);
> +               ret = ttm_bo_force_list_clean(bdev, man);
>                 if (ret) {
>                         pr_err("Cleanup eviction failed\n");
>                         return ret;
> @@ -1505,7 +1503,7 @@ int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type)
>                 return 0;
>         }
>
> -       return ttm_bo_force_list_clean(bdev, mem_type);
> +       return ttm_bo_force_list_clean(bdev, man);
>  }
>  EXPORT_SYMBOL(ttm_bo_evict_mm);
>
> --
> 2.26.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux