dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Dave Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 5/7] drm/ttm: remove move to new and inline into remainging place.
Date: Tue, 20 Oct 2020 14:06:01 +0200	[thread overview]
Message-ID: <abb5fd9c-ad63-b1d7-2268-1b8834e60fce@amd.com> (raw)
In-Reply-To: <20201020010319.1692445-6-airlied@gmail.com>

Am 20.10.20 um 03:03 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> This show the remaining bind callback, which my next series of
> patches will aim to remove.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/ttm/ttm_bo.c      | 16 +++++++++-------
>   drivers/gpu/drm/ttm/ttm_bo_util.c | 20 --------------------
>   include/drm/ttm/ttm_bo_driver.h   |  4 ----
>   3 files changed, 9 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 358d09ef852a..705ea3ef91f9 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -252,9 +252,15 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
>   		if (ret)
>   			goto out_err;
>   
> -		ret = ttm_bo_move_to_new_tt_mem(bo, ctx, mem);
> -		if (ret)
> -			goto out_err;
> +		if (mem->mem_type != TTM_PL_SYSTEM) {
> +			ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
> +			if (ret)
> +				goto out_err;
> +
> +			ret = bdev->driver->ttm_tt_bind(bo->bdev, bo->ttm, mem);
> +			if (ret)
> +				goto out_err;
> +		}
>   	}
>   
>   	if (bdev->driver->move_notify)
> @@ -1489,7 +1495,3 @@ void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
>   	bo->ttm = NULL;
>   }
>   
> -int ttm_bo_tt_bind(struct ttm_buffer_object *bo, struct ttm_resource *mem)
> -{
> -	return bo->bdev->driver->ttm_tt_bind(bo->bdev, bo->ttm, mem);
> -}
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 21811bbda2e4..fae31f7f5c35 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -45,26 +45,6 @@ struct ttm_transfer_obj {
>   	struct ttm_buffer_object *bo;
>   };
>   
> -int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
> -			      struct ttm_operation_ctx *ctx,
> -			      struct ttm_resource *new_mem)
> -{
> -	int ret;
> -
> -	if (new_mem->mem_type == TTM_PL_SYSTEM)
> -		return 0;
> -
> -	ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
> -	if (unlikely(ret != 0))
> -		return ret;
> -
> -	ret = ttm_bo_tt_bind(bo, new_mem);
> -	if (unlikely(ret != 0))
> -		return ret;
> -
> -	return 0;
> -}
> -
>   int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
>   		       struct ttm_resource *mem)
>   {
> diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
> index fbbcf10670c1..0c4efc169f46 100644
> --- a/include/drm/ttm/ttm_bo_driver.h
> +++ b/include/drm/ttm/ttm_bo_driver.h
> @@ -560,10 +560,6 @@ int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
>   void ttm_mem_io_free(struct ttm_bo_device *bdev,
>   		     struct ttm_resource *mem);
>   
> -int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
> -			      struct ttm_operation_ctx *ctx,
> -			      struct ttm_resource *new_mem);
> -
>   /**
>    * ttm_bo_move_memcpy
>    *

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-10-20 12:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20  1:03 [PATCH 0/7] drm/ttm: get rid of bind/unbind Dave Airlie
2020-10-20  1:03 ` [PATCH 1/7] drm/ttm: move some move binds into the drivers Dave Airlie
2020-10-20 10:20   ` Christian König
2020-10-20  1:03 ` [PATCH 2/7] drm/ttm: minor cleanup to move to system Dave Airlie
2020-10-20 10:22   ` Christian König
2020-10-20  1:03 ` [PATCH 3/7] drm/ttm: add move to system into drivers Dave Airlie
2020-10-20 12:03   ` Christian König
2020-10-20  1:03 ` [PATCH 4/7] drm/ttm: drop unbind callback Dave Airlie
2020-10-20 12:04   ` Christian König
2020-10-20  1:03 ` [PATCH 5/7] drm/ttm: remove move to new and inline into remainging place Dave Airlie
2020-10-20 12:06   ` Christian König [this message]
2020-10-20  1:03 ` [PATCH 6/7] drm/ttm: drop move notify around move Dave Airlie
2020-10-20 12:15   ` Christian König
2020-10-20  1:03 ` [PATCH 7/7] drm/ttm: move last binding into the drivers Dave Airlie
2020-10-20 12:16   ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abb5fd9c-ad63-b1d7-2268-1b8834e60fce@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox