[PATCH 1/2] drm/amdgpu: only deinitialize initialized ib's.

Christian K├Ânig deathsimple at vodafone.de
Fri Aug 21 01:13:03 PDT 2015


On 20.08.2015 22:51, Bas Nieuwenhuizen wrote:
> Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

Thanks for the help, but I've addressed both bugs internally already and 
they are just waiting for public release.

Not sure which patches Alex are going to pick now.

In general it looks like we should probably move our internal 
discussions and patches to the public.

Going to kick this of,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h    | 1 +
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++-
>   2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 2fc58e6..454d4e2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1250,6 +1250,7 @@ struct amdgpu_cs_parser {
>   
>   	struct amdgpu_ib	*ibs;
>   	uint32_t		num_ibs;
> +	uint32_t		num_initialized_ibs;
>   
>   	struct ww_acquire_ctx	ticket;
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index e4424b4..2c49dd4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -509,7 +509,7 @@ static void amdgpu_cs_parser_fini_late(struct amdgpu_cs_parser *parser)
>   		drm_free_large(parser->chunks[i].kdata);
>   	kfree(parser->chunks);
>   	if (parser->ibs)
> -		for (i = 0; i < parser->num_ibs; i++)
> +		for (i = 0; i < parser->num_initialized_ibs; i++)
>   			amdgpu_ib_free(parser->adev, &parser->ibs[i]);
>   	kfree(parser->ibs);
>   	if (parser->uf.bo)
> @@ -708,6 +708,7 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev,
>   		ib->length_dw = chunk_ib->ib_bytes / 4;
>   		ib->flags = chunk_ib->flags;
>   		ib->ctx = parser->ctx;
> +                parser->num_initialized_ibs++;
>   		j++;
>   	}
>   



More information about the dri-devel mailing list