Re: [Dali] Raven 2 detection Patch
On Thu, Feb 6, 2020 at 1:00 PM Tawfik, Aly wrote: > > > ***Reattached patch with corrections*** > > From b828a2b3df3057461dfceb4d1394fe858ced9d03 Mon Sep 17 00:00:00 2001 > From: Ali-Tawfik > Date: Thu, 6 Feb 2020 12:53:02 -0500 > Subject: [PATCH] drm/amdgpu: [DALI] Dali Variant Detection > > Problem Description: > > Currently we are checking internal fused rev id with pci rev id. However, > fused internal rev id is the same on all raven2 parts (in which Dali was > based on too), thus Dali detection fails > > Fix: > > To detect this chip we need to use pci rev id but it is not defined in the > scope of DC. To workaround this issue alter the fused > rev id using pcie id for all dali chips before DC init, > then use the internal fused id for chip detection in DC. > > Signed-off-by: Ali-Tawfik Reviewed-by: Alex Deucher Once it's reviewed, feel free to commit it. Alex > --- > drivers/gpu/drm/amd/amdgpu/soc15.c| 9 - > drivers/gpu/drm/amd/display/include/dal_asic_id.h | 4 ++-- > 2 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c > b/drivers/gpu/drm/amd/amdgpu/soc15.c > index 317803f6a561..f85c27fbe64c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/soc15.c > +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c > @@ -1094,8 +1094,15 @@ static int soc15_common_early_init(void *handle) > break; > case CHIP_RAVEN: > adev->asic_funcs = _asic_funcs; > - if (adev->rev_id >= 0x8) > + if (adev->rev_id >= 0x8) { > + if ((adev->pdev->device == 0x15d8) && > +((adev->pdev->revision == 0xCF) || > +(adev->pdev->revision == 0xE3)|| > +(adev->pdev->revision == 0xE4))) { > + adev->rev_id = 0x10; > + } > adev->external_rev_id = adev->rev_id + 0x79; > + } > else if (adev->pdev->device == 0x15d8) > adev->external_rev_id = adev->rev_id + 0x41; > else if (adev->rev_id == 1) > diff --git a/drivers/gpu/drm/amd/display/include/dal_asic_id.h > b/drivers/gpu/drm/amd/display/include/dal_asic_id.h > index a2903985b9e8..0329f26bfacd 100644 > --- a/drivers/gpu/drm/amd/display/include/dal_asic_id.h > +++ b/drivers/gpu/drm/amd/display/include/dal_asic_id.h > @@ -143,6 +143,7 @@ > #define RAVEN2_15D8_REV_EB 0xEB > #define RAVEN1_F0 0xF0 > #define RAVEN_UNKNOWN 0xFF > +#define RAVEN2_15D8_B0_LW 0x89 > #ifndef ASICREV_IS_RAVEN > #define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < > RAVEN_UNKNOWN) > #endif > @@ -152,8 +153,7 @@ > #define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < > RAVEN1_F0)) > #endif > #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < > RAVEN_UNKNOWN)) > -#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \ > - || (eChipRev == RAVEN2_15D8_REV_E4)) > +#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_B0_LW)) > #define ASICREV_IS_POLLOCK(eChipRev) (eChipRev == RAVEN2_15D8_REV_94 \ > || eChipRev == RAVEN2_15D8_REV_95 \ > || eChipRev == RAVEN2_15D8_REV_E9 \ > -- > 2.17.1 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [Dali] Raven 2 detection Patch
***Reattached patch with corrections*** From b828a2b3df3057461dfceb4d1394fe858ced9d03 Mon Sep 17 00:00:00 2001 From: Ali-Tawfik Date: Thu, 6 Feb 2020 12:53:02 -0500 Subject: [PATCH] drm/amdgpu: [DALI] Dali Variant Detection Problem Description: Currently we are checking internal fused rev id with pci rev id. However, fused internal rev id is the same on all raven2 parts (in which Dali was based on too), thus Dali detection fails Fix: To detect this chip we need to use pci rev id but it is not defined in the scope of DC. To workaround this issue alter the fused rev id using pcie id for all dali chips before DC init, then use the internal fused id for chip detection in DC. Signed-off-by: Ali-Tawfik --- drivers/gpu/drm/amd/amdgpu/soc15.c| 9 - drivers/gpu/drm/amd/display/include/dal_asic_id.h | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index 317803f6a561..f85c27fbe64c 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -1094,8 +1094,15 @@ static int soc15_common_early_init(void *handle) break; case CHIP_RAVEN: adev->asic_funcs = _asic_funcs; - if (adev->rev_id >= 0x8) + if (adev->rev_id >= 0x8) { + if ((adev->pdev->device == 0x15d8) && +((adev->pdev->revision == 0xCF) || +(adev->pdev->revision == 0xE3)|| +(adev->pdev->revision == 0xE4))) { + adev->rev_id = 0x10; + } adev->external_rev_id = adev->rev_id + 0x79; + } else if (adev->pdev->device == 0x15d8) adev->external_rev_id = adev->rev_id + 0x41; else if (adev->rev_id == 1) diff --git a/drivers/gpu/drm/amd/display/include/dal_asic_id.h b/drivers/gpu/drm/amd/display/include/dal_asic_id.h index a2903985b9e8..0329f26bfacd 100644 --- a/drivers/gpu/drm/amd/display/include/dal_asic_id.h +++ b/drivers/gpu/drm/amd/display/include/dal_asic_id.h @@ -143,6 +143,7 @@ #define RAVEN2_15D8_REV_EB 0xEB #define RAVEN1_F0 0xF0 #define RAVEN_UNKNOWN 0xFF +#define RAVEN2_15D8_B0_LW 0x89 #ifndef ASICREV_IS_RAVEN #define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN) #endif @@ -152,8 +153,7 @@ #define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0)) #endif #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN)) -#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \ - || (eChipRev == RAVEN2_15D8_REV_E4)) +#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_B0_LW)) #define ASICREV_IS_POLLOCK(eChipRev) (eChipRev == RAVEN2_15D8_REV_94 \ || eChipRev == RAVEN2_15D8_REV_95 \ || eChipRev == RAVEN2_15D8_REV_E9 \ -- 2.17.1 0001-drm-amdgpu-DALI-Dali-Variant-Detection.patch Description: 0001-drm-amdgpu-DALI-Dali-Variant-Detection.patch ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [Dali] Raven 2 detection Patch
just a couple of typos in the patch title: drm\amdgpu: [DALI] Dali Varient Detection It should be: drm/amdgpu: [DALI] Dali Variant Detection With that fixed, patch is: Reviewed-by: Alex Deucher On Wed, Feb 5, 2020 at 9:59 AM Tawfik, Aly wrote: > > Hi, > > > > Dali is a raven2 based asic that drives at a lower (6W) TDP than other raven > 2 chips. Currently the fused internal id is the same on all raven 2 boards, > this means that the detection process must be done through PCIE REV ID. > > Unfortunately PCIE REV ID is not defined inside the scope of display. I > created a patch to alter the fused value for internal rev_id if the chip is > detected as dali through PCIE REV ID. So that detection of the chip will be > possible inside of Display core. > > > > Can you kindly provide feedback on this workaround. > > > > Best Regards, > > Aly Tawfik > > > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx