diff mbox series

[2/7] drm/ttm: minor cleanup to move to system

Message ID 20201020010319.1692445-3-airlied@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/ttm: get rid of bind/unbind | expand

Commit Message

Dave Airlie Oct. 20, 2020, 1:03 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

resource free already sets the domain to system, and old_mem
isn't really needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Christian König Oct. 20, 2020, 10:22 a.m. UTC | #1
Am 20.10.20 um 03:03 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> resource free already sets the domain to system, and old_mem
> isn't really needed.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

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

> ---
>   drivers/gpu/drm/ttm/ttm_bo_util.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index c8ca6694cc1c..b730e624a220 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -68,10 +68,9 @@ int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
>   int ttm_bo_move_to_system(struct ttm_buffer_object *bo,
>   			  struct ttm_operation_ctx *ctx)
>   {
> -	struct ttm_resource *old_mem = &bo->mem;
>   	int ret;
>   
> -	if (old_mem->mem_type == TTM_PL_SYSTEM)
> +	if (bo->mem.mem_type == TTM_PL_SYSTEM)
>   		return 0;
>   
>   	ret = ttm_bo_wait_ctx(bo, ctx);
> @@ -83,7 +82,6 @@ int ttm_bo_move_to_system(struct ttm_buffer_object *bo,
>   
>   	ttm_bo_tt_unbind(bo);
>   	ttm_resource_free(bo, &bo->mem);
> -	old_mem->mem_type = TTM_PL_SYSTEM;
>   	return 0;
>   }
>   EXPORT_SYMBOL(ttm_bo_move_to_system);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index c8ca6694cc1c..b730e624a220 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -68,10 +68,9 @@  int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
 int ttm_bo_move_to_system(struct ttm_buffer_object *bo,
 			  struct ttm_operation_ctx *ctx)
 {
-	struct ttm_resource *old_mem = &bo->mem;
 	int ret;
 
-	if (old_mem->mem_type == TTM_PL_SYSTEM)
+	if (bo->mem.mem_type == TTM_PL_SYSTEM)
 		return 0;
 
 	ret = ttm_bo_wait_ctx(bo, ctx);
@@ -83,7 +82,6 @@  int ttm_bo_move_to_system(struct ttm_buffer_object *bo,
 
 	ttm_bo_tt_unbind(bo);
 	ttm_resource_free(bo, &bo->mem);
-	old_mem->mem_type = TTM_PL_SYSTEM;
 	return 0;
 }
 EXPORT_SYMBOL(ttm_bo_move_to_system);