[PATCH] drm/amdgpu: make cyan skillfish support code more consistent

Huang Rui ray.huang at amd.com
Tue Feb 15 07:10:30 UTC 2022


On Mon, Feb 14, 2022 at 03:48:47PM -0500, Alex Deucher wrote:
> Since this is an existing asic, adjust the code to follow
> the same logic as previously so the driver state is consistent.
> 
> No functional change intended.
> 
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>

Acked-by: Huang Rui <ray.huang at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    | 3 +--
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c     | 4 +---
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c     | 3 +--
>  5 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index ff3b57fe5232..9f1b2ee54706 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1452,7 +1452,8 @@ static int amdgpu_device_init_apu_flags(struct amdgpu_device *adev)
>  	case CHIP_YELLOW_CARP:
>  		break;
>  	case CHIP_CYAN_SKILLFISH:
> -		if (adev->pdev->device == 0x13FE)
> +		if ((adev->pdev->device == 0x13FE) ||
> +		    (adev->pdev->device == 0x143F))
>  			adev->apu_flags |= AMD_APU_IS_CYAN_SKILLFISH2;
>  		break;
>  	default:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 5cdafdcfec59..a0b5cf9a41cc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1923,6 +1923,7 @@ static const struct pci_device_id pciidlist[] = {
>  
>  	/* CYAN_SKILLFISH */
>  	{0x1002, 0x13FE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU},
> +	{0x1002, 0x143F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU},
>  
>  	/* BEIGE_GOBY */
>  	{0x1002, 0x7420, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 9bc9155cbf06..f2806959736a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -137,8 +137,7 @@ static int psp_early_init(void *handle)
>  		psp->autoload_supported = true;
>  		break;
>  	case IP_VERSION(11, 0, 8):
> -		if (adev->apu_flags & AMD_APU_IS_CYAN_SKILLFISH2 ||
> -		    adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 1, 4)) {
> +		if (adev->apu_flags & AMD_APU_IS_CYAN_SKILLFISH2) {
>  			psp_v11_0_8_set_psp_funcs(psp);
>  			psp->autoload_supported = false;
>  		}
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index 8fb4528c741f..dfbe65c1ae0b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -3956,14 +3956,12 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
>  		chip_name = "yellow_carp";
>  		break;
>  	case IP_VERSION(10, 1, 3):
> +	case IP_VERSION(10, 1, 4):
>  		if (adev->apu_flags & AMD_APU_IS_CYAN_SKILLFISH2)
>  			chip_name = "cyan_skillfish2";
>  		else
>  			chip_name = "cyan_skillfish";
>  		break;
> -	case IP_VERSION(10, 1, 4):
> -		chip_name = "cyan_skillfish2";
> -		break;
>  	default:
>  		BUG();
>  	}
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index 45e10d5028c5..81e033549dda 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -264,8 +264,7 @@ static int sdma_v5_0_init_microcode(struct amdgpu_device *adev)
>  		chip_name = "navi12";
>  		break;
>  	case IP_VERSION(5, 0, 1):
> -		if (adev->apu_flags & AMD_APU_IS_CYAN_SKILLFISH2 ||
> -		    adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 1, 4))
> +		if (adev->apu_flags & AMD_APU_IS_CYAN_SKILLFISH2)
>  			chip_name = "cyan_skillfish2";
>  		else
>  			chip_name = "cyan_skillfish";
> -- 
> 2.34.1
> 


More information about the amd-gfx mailing list