[PATCH 2/2] drm/amdgpu: use exiting amdgput_ctx_total_num_entities function

Christian König ckoenig.leichtzumerken at gmail.com
Tue Aug 13 09:44:07 UTC 2019


Am 13.08.19 um 11:08 schrieb Wang, Kevin(Yang):
> simplify driver code.
>
> Signed-off-by: Kevin Wang <kevin1.wang at amd.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 95d8201a738e..89c26bb0f05c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -290,10 +290,7 @@ static void amdgpu_ctx_do_release(struct kref *ref)
>   
>   	ctx = container_of(ref, struct amdgpu_ctx, refcount);
>   
> -	num_entities = 0;
> -	for (i = 0; i < AMDGPU_HW_IP_NUM; i++)
> -		num_entities += amdgpu_ctx_num_entities[i];
> -
> +	num_entities = amdgpu_ctx_total_num_entities();
>   	for (i = 0; i < num_entities; i++)
>   		drm_sched_entity_destroy(&ctx->entities[0][i].entity);
>   



More information about the amd-gfx mailing list