drm/amdgpu: simplify CZ/ST and KV/KB/ML checks
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 18 May 2020 21:10:11 +0000 (17:10 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 May 2020 18:00:49 +0000 (14:00 -0400)
Just check for APU.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c

index e036c868e354323565e9c630c2cb82886a8f98d8..80a6c3156766a5f64d9aa873cd0e1f15bda42ddb 100644 (file)
@@ -1699,7 +1699,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
        case CHIP_VEGAM:
        case CHIP_CARRIZO:
        case CHIP_STONEY:
-               if (adev->asic_type == CHIP_CARRIZO || adev->asic_type == CHIP_STONEY)
+               if (adev->flags & AMD_IS_APU)
                        adev->family = AMDGPU_FAMILY_CZ;
                else
                        adev->family = AMDGPU_FAMILY_VI;
@@ -1726,10 +1726,10 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
        case CHIP_KAVERI:
        case CHIP_KABINI:
        case CHIP_MULLINS:
-               if ((adev->asic_type == CHIP_BONAIRE) || (adev->asic_type == CHIP_HAWAII))
-                       adev->family = AMDGPU_FAMILY_CI;
-               else
+               if (adev->flags & AMD_IS_APU)
                        adev->family = AMDGPU_FAMILY_KV;
+               else
+                       adev->family = AMDGPU_FAMILY_CI;
 
                r = cik_set_ip_blocks(adev);
                if (r)
index 2584ff74423bc391e9971a514ef641ec7185c13d..0a6be88ebad949473ebf36cc3c3a21c44db9a3d5 100644 (file)
@@ -2342,7 +2342,7 @@ static u32 dce_v11_0_pick_pll(struct drm_crtc *crtc)
 
        /* XXX need to determine what plls are available on each DCE11 part */
        pll_in_use = amdgpu_pll_get_use_mask(crtc);
-       if (adev->asic_type == CHIP_CARRIZO || adev->asic_type == CHIP_STONEY) {
+       if (adev->flags & AMD_IS_APU) {
                if (!(pll_in_use & (1 << ATOM_PPLL1)))
                        return ATOM_PPLL1;
                if (!(pll_in_use & (1 << ATOM_PPLL0)))