[PATCH] drm/amdgpu/gfx9: rework lbpw enable code

Quan, Evan Evan.Quan at amd.com
Fri Nov 9 01:45:31 UTC 2018


Reviewed-by: Evan Quan <evan.quan at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: 2018年11月9日 5:38
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
> Subject: [PATCH] drm/amdgpu/gfx9: rework lbpw enable code
> 
> To avoid changing the global lbpw module parameter directly.
> 
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 29 ++++++++++++---------------
> --
>  1 file changed, 12 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 7abefb80f93d..138cc6c2caec 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -2499,26 +2499,21 @@ static int gfx_v9_0_rlc_resume(struct
> amdgpu_device *adev)
>  			return r;
>  	}
> 
> -	if (amdgpu_lbpw == -1) {
> -		switch (adev->asic_type) {
> -		case CHIP_RAVEN:
> -			amdgpu_lbpw = 1;
> -			break;
> -		case CHIP_VEGA20:
> -			amdgpu_lbpw = 0;
> -			break;
> -		default:
> -			amdgpu_lbpw = 0;
> -			break;
> -		}
> -	}
> -
> -	if (adev->asic_type == CHIP_RAVEN ||
> -	    adev->asic_type == CHIP_VEGA20) {
> -		if (amdgpu_lbpw != 0)
> +	switch (adev->asic_type) {
> +	case CHIP_RAVEN:
> +		if (amdgpu_lbpw == 0)
> +			gfx_v9_0_enable_lbpw(adev, false);
> +		else
> +			gfx_v9_0_enable_lbpw(adev, true);
> +		break;
> +	case CHIP_VEGA20:
> +		if (amdgpu_lbpw > 0)
>  			gfx_v9_0_enable_lbpw(adev, true);
>  		else
>  			gfx_v9_0_enable_lbpw(adev, false);
> +		break;
> +	default:
> +		break;
>  	}
> 
>  	gfx_v9_0_rlc_start(adev);
> --
> 2.13.6
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list