[PATCH 17/18] drm/amdgpu:fix uvd ring fini routine

Christian König ckoenig.leichtzumerken at gmail.com
Mon Sep 18 09:25:46 UTC 2017


Am 18.09.2017 um 08:12 schrieb Monk Liu:
> fix missing finish uvd enc_ring and wrongly finish uvd ring
>
> Change-Id: Ib74237ca5adcb3b128c9b751fced0b7db7b09e86
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index 331e34a..63b00eb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -269,6 +269,8 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
>   
>   int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
>   {
> +	struct amdgpu_ring *ring;
> +	int i;

A newline should be between declaration and code.

>   	kfree(adev->uvd.saved_bo);
>   
>   	amd_sched_entity_fini(&adev->uvd.ring.sched, &adev->uvd.entity);
> @@ -277,7 +279,15 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
>   			      &adev->uvd.gpu_addr,
>   			      (void **)&adev->uvd.cpu_addr);
>   
> -	amdgpu_ring_fini(&adev->uvd.ring);
> +	ring = &adev->uvd.ring;
> +	if (ring->adev)

No need for that, the first thing that amdgpu_ring_fini() does is 
checking ring->adev, so that is just duplicated.

Reviewed-by: Christian König <christian.koenig at amd.com> with those two 
minor issues fixed.

Regards,
Christian.

> +		amdgpu_ring_fini(ring);
> +
> +	for (i = 0; i < AMDGPU_MAX_UVD_ENC_RINGS; ++i) {
> +		ring = &adev->uvd.ring_enc[i];
> +		if (ring->adev)
> +			amdgpu_ring_fini(ring);
> +	}
>   
>   	release_firmware(adev->uvd.fw);
>   




More information about the amd-gfx mailing list