[PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
From: "Tianci.Yin" The blockchain SKU has no display support, so the DCN ip block should be disabled. Add DID/RID as display supporting dependence, it potentially disable DCN block. Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd Signed-off-by: Tianci.Yin --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index f8f3e375c93e..04e906386b5b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1051,7 +1051,7 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device *adev, u32 pcie_index, u32 pcie_data, u32 reg_addr, u64 reg_data); -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct pci_dev *pdev); bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); int emu_soc_asic_init(struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index c567f20b9d1f..fa522cffdd64 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2958,11 +2958,12 @@ static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev) * amdgpu_device_asic_has_dc_support - determine if DC supports the asic * * @asic_type: AMD asic type + * @pdev: pointer of pci_dev instance * * Check if there is DC (new modesetting infrastructre) support for an asic. * returns true if DC has support, false if not. */ -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct pci_dev *pdev) { switch (asic_type) { #if defined(CONFIG_DRM_AMD_DC) @@ -2998,7 +2999,6 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) case CHIP_VEGA20: #if defined(CONFIG_DRM_AMD_DC_DCN) case CHIP_RAVEN: - case CHIP_NAVI10: case CHIP_NAVI14: case CHIP_NAVI12: case CHIP_RENOIR: @@ -3011,6 +3011,20 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) #endif return amdgpu_dc != 0; #endif +#if defined(CONFIG_DRM_AMD_DC_DCN) + case CHIP_NAVI10: + if (pdev->device == 0x731E && + (pdev->revision == 0xC6 || +pdev->revision == 0xC7)) { + DRM_INFO("(%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X) has no dc support.\n", +amdgpu_asic_name[asic_type], pdev->vendor, pdev->device, +pdev->subsystem_vendor, pdev->subsystem_device, pdev->revision); + return false; + } else { + return amdgpu_dc != 0; + } +#endif + default: if (amdgpu_dc > 0) DRM_INFO("Display Core has been requested via kernel parameter " @@ -3031,7 +3045,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device *adev) if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display) return false; - return amdgpu_device_asic_has_dc_support(adev->asic_type); + return amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 9e92d2a070ac..97014458d7de 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -516,7 +516,7 @@ uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev, */ if ((bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) && amdgpu_bo_support_uswc(bo_flags) && - amdgpu_device_asic_has_dc_support(adev->asic_type)) { + amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev)) { switch (adev->asic_type) { case CHIP_CARRIZO: case CHIP_STONEY: diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 13723914fa9f..97fda825e0d3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1109,7 +1109,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, bool supports_atomic = false; if (!amdgpu_virtual_display && - amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK)) + amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK, pdev)) supports_atomic = true; if ((flags & AMD_EXP_HW_SUPPORT) && !amdgpu_exp_hw_support) { -
[PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
From: "Tianci.Yin" The blockchain SKU has no display support, remove it. Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd Reviewed-by: Guchun Chen Signed-off-by: Tianci.Yin --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 28 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index f8f3e375c93e..3c63fb8904de 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1051,7 +1051,8 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device *adev, u32 pcie_index, u32 pcie_data, u32 reg_addr, u64 reg_data); -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); +bool amdgpu_device_asic_is_blockchain_sku(struct pci_dev *pdev); +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct pci_dev *pdev); bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); int emu_soc_asic_init(struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index c567f20b9d1f..5dd05e72ed9e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2954,15 +2954,32 @@ static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev) } } +/** + * amdgpu_device_asic_is_blockchain_sku - determine if the asic is blockchain + * SKU + * + * @pdev: pointer to pci_dev instance + * + * returns true if the asic is blockchain SKU, false if not. + */ +bool amdgpu_device_asic_is_blockchain_sku(struct pci_dev *pdev) +{ + if (pdev->device == 0x731E && + (pdev->revision == 0xC6 || pdev->revision == 0xC7)) + return true; + return false; +} + /** * amdgpu_device_asic_has_dc_support - determine if DC supports the asic * * @asic_type: AMD asic type + * @pdev: pointer to pci_dev instance * * Check if there is DC (new modesetting infrastructre) support for an asic. * returns true if DC has support, false if not. */ -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct pci_dev *pdev) { switch (asic_type) { #if defined(CONFIG_DRM_AMD_DC) @@ -2999,6 +3016,13 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) #if defined(CONFIG_DRM_AMD_DC_DCN) case CHIP_RAVEN: case CHIP_NAVI10: + if (amdgpu_device_asic_is_blockchain_sku(pdev)) { + DRM_INFO("(%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X) has no dc support.\n", +amdgpu_asic_name[asic_type], pdev->vendor, pdev->device, +pdev->subsystem_vendor, pdev->subsystem_device, pdev->revision); + return false; + } + return amdgpu_dc != 0; case CHIP_NAVI14: case CHIP_NAVI12: case CHIP_RENOIR: @@ -3031,7 +3055,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device *adev) if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display) return false; - return amdgpu_device_asic_has_dc_support(adev->asic_type); + return amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 9e92d2a070ac..97014458d7de 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -516,7 +516,7 @@ uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev, */ if ((bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) && amdgpu_bo_support_uswc(bo_flags) && - amdgpu_device_asic_has_dc_support(adev->asic_type)) { + amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev)) { switch (adev->asic_type) { case CHIP_CARRIZO: case CHIP_STONEY: diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 13723914fa9f..97fda825e0d3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1109,7 +1109,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, bool supports_atomic = false; if (!amdgpu_virtual_display && - amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK)) + amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK, pdev)) supports_atomic = true; if ((flags & AMD_EXP_HW_SUPPORT) && !amdgpu_exp_hw_support) { -- 2.17.1 ___
Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
On Wed, Oct 21, 2020 at 3:56 AM Tianci Yin wrote: > > From: "Tianci.Yin" > > The blockchain SKU has no display support, so the DCN ip > block should be disabled. Add DID/RID as display > supporting dependence, it potentially disable DCN block. Wouldn't it be cleaner to just not add the DCN block like you did in patch 3? Alex > > Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd > Signed-off-by: Tianci.Yin > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +--- > drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > 4 files changed, 20 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index f8f3e375c93e..04e906386b5b 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -1051,7 +1051,7 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device > *adev, >u32 pcie_index, u32 pcie_data, >u32 reg_addr, u64 reg_data); > > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev); > bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); > > int emu_soc_asic_init(struct amdgpu_device *adev); > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index c567f20b9d1f..fa522cffdd64 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2958,11 +2958,12 @@ static void amdgpu_device_detect_sriov_bios(struct > amdgpu_device *adev) > * amdgpu_device_asic_has_dc_support - determine if DC supports the asic > * > * @asic_type: AMD asic type > + * @pdev: pointer of pci_dev instance > * > * Check if there is DC (new modesetting infrastructre) support for an asic. > * returns true if DC has support, false if not. > */ > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev) > { > switch (asic_type) { > #if defined(CONFIG_DRM_AMD_DC) > @@ -2998,7 +2999,6 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) > case CHIP_VEGA20: > #if defined(CONFIG_DRM_AMD_DC_DCN) > case CHIP_RAVEN: > - case CHIP_NAVI10: > case CHIP_NAVI14: > case CHIP_NAVI12: > case CHIP_RENOIR: > @@ -3011,6 +3011,20 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) > #endif > return amdgpu_dc != 0; > #endif > +#if defined(CONFIG_DRM_AMD_DC_DCN) > + case CHIP_NAVI10: > + if (pdev->device == 0x731E && > + (pdev->revision == 0xC6 || > +pdev->revision == 0xC7)) { > + DRM_INFO("(%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X) has > no dc support.\n", > +amdgpu_asic_name[asic_type], pdev->vendor, > pdev->device, > +pdev->subsystem_vendor, > pdev->subsystem_device, pdev->revision); > + return false; > + } else { > + return amdgpu_dc != 0; > + } > +#endif > + > default: > if (amdgpu_dc > 0) > DRM_INFO("Display Core has been requested via kernel > parameter " > @@ -3031,7 +3045,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device > *adev) > if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display) > return false; > > - return amdgpu_device_asic_has_dc_support(adev->asic_type); > + return amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev); > } > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > index 9e92d2a070ac..97014458d7de 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > @@ -516,7 +516,7 @@ uint32_t amdgpu_display_supported_domains(struct > amdgpu_device *adev, > */ > if ((bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) && > amdgpu_bo_support_uswc(bo_flags) && > - amdgpu_device_asic_has_dc_support(adev->asic_type)) { > + amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev)) { > switch (adev->asic_type) { > case CHIP_CARRIZO: > case CHIP_STONEY: > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > index 13723914fa9f..97fda825e0d3 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > @@ -1109,7 +1109,7 @@ static int amdgpu_pci_prob
Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
On 2020-10-21 03:56, Tianci Yin wrote: > From: "Tianci.Yin" > > The blockchain SKU has no display support, so the DCN ip "DCN IP" to stand for Intellectual Property. > block should be disabled. Add DID/RID as display > supporting dependence, it potentially disable DCN block. > > Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd > Signed-off-by: Tianci.Yin > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +--- > drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > 4 files changed, 20 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index f8f3e375c93e..04e906386b5b 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -1051,7 +1051,7 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device > *adev, > u32 pcie_index, u32 pcie_data, > u32 reg_addr, u64 reg_data); > > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev); > bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); > > int emu_soc_asic_init(struct amdgpu_device *adev); > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index c567f20b9d1f..fa522cffdd64 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2958,11 +2958,12 @@ static void amdgpu_device_detect_sriov_bios(struct > amdgpu_device *adev) > * amdgpu_device_asic_has_dc_support - determine if DC supports the asic > * > * @asic_type: AMD asic type > + * @pdev: pointer of pci_dev instance "pointer to ... instance", or, "pointer of ... type". > * > * Check if there is DC (new modesetting infrastructre) support for an asic. > * returns true if DC has support, false if not. > */ > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev) > { > switch (asic_type) { > #if defined(CONFIG_DRM_AMD_DC) > @@ -2998,7 +2999,6 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) > case CHIP_VEGA20: > #if defined(CONFIG_DRM_AMD_DC_DCN) > case CHIP_RAVEN: > - case CHIP_NAVI10: > case CHIP_NAVI14: > case CHIP_NAVI12: > case CHIP_RENOIR: > @@ -3011,6 +3011,20 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) > #endif > return amdgpu_dc != 0; > #endif > +#if defined(CONFIG_DRM_AMD_DC_DCN) > + case CHIP_NAVI10: > + if (pdev->device == 0x731E && > + (pdev->revision == 0xC6 || > + pdev->revision == 0xC7)) { > + DRM_INFO("(%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X) has > no dc support.\n", > + amdgpu_asic_name[asic_type], pdev->vendor, > pdev->device, > + pdev->subsystem_vendor, > pdev->subsystem_device, pdev->revision); > + return false; > + } else { > + return amdgpu_dc != 0; > + } > +#endif > + Why not leave the placing of the original CHIP_NAVI10 label, and add the if () under it, and drop the "else { ..."? Regards, Luben > default: > if (amdgpu_dc > 0) > DRM_INFO("Display Core has been requested via kernel > parameter " > @@ -3031,7 +3045,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device > *adev) > if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display) > return false; > > - return amdgpu_device_asic_has_dc_support(adev->asic_type); > + return amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev); > } > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > index 9e92d2a070ac..97014458d7de 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c > @@ -516,7 +516,7 @@ uint32_t amdgpu_display_supported_domains(struct > amdgpu_device *adev, >*/ > if ((bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) && > amdgpu_bo_support_uswc(bo_flags) && > - amdgpu_device_asic_has_dc_support(adev->asic_type)) { > + amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev)) { > switch (adev->asic_type) { > case CHIP_CARRIZO: > case CHIP_STONEY: > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > index 13723914fa9f..97fda825e0d3 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu
Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
[AMD Official Use Only - Internal Distribution Only] Thanks very much Alex and Luben! I refine the patches, please review again. Rico From: Tuikov, Luben Sent: Thursday, October 22, 2020 1:40 To: Yin, Tianci (Rico) ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Zhang, Hawking ; Chen, Guchun ; Cui, Flora ; Xu, Feifei ; Long, Gang Subject: Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU On 2020-10-21 03:56, Tianci Yin wrote: > From: "Tianci.Yin" > > The blockchain SKU has no display support, so the DCN ip "DCN IP" to stand for Intellectual Property. > block should be disabled. Add DID/RID as display > supporting dependence, it potentially disable DCN block. > > Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd > Signed-off-by: Tianci.Yin > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +--- > drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > 4 files changed, 20 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index f8f3e375c93e..04e906386b5b 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -1051,7 +1051,7 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device > *adev, > u32 pcie_index, u32 pcie_data, > u32 reg_addr, u64 reg_data); > > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev); > bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); > > int emu_soc_asic_init(struct amdgpu_device *adev); > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index c567f20b9d1f..fa522cffdd64 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2958,11 +2958,12 @@ static void amdgpu_device_detect_sriov_bios(struct > amdgpu_device *adev) > * amdgpu_device_asic_has_dc_support - determine if DC supports the asic > * > * @asic_type: AMD asic type > + * @pdev: pointer of pci_dev instance "pointer to ... instance", or, "pointer of ... type". > * > * Check if there is DC (new modesetting infrastructre) support for an asic. > * returns true if DC has support, false if not. > */ > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev) > { >switch (asic_type) { > #if defined(CONFIG_DRM_AMD_DC) > @@ -2998,7 +2999,6 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) >case CHIP_VEGA20: > #if defined(CONFIG_DRM_AMD_DC_DCN) >case CHIP_RAVEN: > - case CHIP_NAVI10: >case CHIP_NAVI14: >case CHIP_NAVI12: >case CHIP_RENOIR: > @@ -3011,6 +3011,20 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) > #endif >return amdgpu_dc != 0; > #endif > +#if defined(CONFIG_DRM_AMD_DC_DCN) > + case CHIP_NAVI10: > + if (pdev->device == 0x731E && > + (pdev->revision == 0xC6 || > + pdev->revision == 0xC7)) { > + DRM_INFO("(%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X) has > no dc support.\n", > + amdgpu_asic_name[asic_type], pdev->vendor, > pdev->device, > + pdev->subsystem_vendor, > pdev->subsystem_device, pdev->revision); > + return false; > + } else { > + return amdgpu_dc != 0; > + } > +#endif > + Why not leave the placing of the original CHIP_NAVI10 label, and add the if () under it, and drop the "else { ..."? Regards, Luben >default: >if (amdgpu_dc > 0) >DRM_INFO("Display Core has been requested via kernel > parameter " > @@ -3031,7 +3045,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device > *adev) >if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display) >return false; > > - return amdgpu_device_asic_has_dc_support(adev->asic_type); > + return amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev); > } > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_displa
Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
On Wed, Oct 21, 2020 at 11:04 PM Tianci Yin wrote: > > From: "Tianci.Yin" > > The blockchain SKU has no display support, remove it. > > Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd > Reviewed-by: Guchun Chen > Signed-off-by: Tianci.Yin > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 28 +++-- > drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > 4 files changed, 30 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index f8f3e375c93e..3c63fb8904de 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -1051,7 +1051,8 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device > *adev, >u32 pcie_index, u32 pcie_data, >u32 reg_addr, u64 reg_data); > > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); > +bool amdgpu_device_asic_is_blockchain_sku(struct pci_dev *pdev); > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev); > bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); > > int emu_soc_asic_init(struct amdgpu_device *adev); > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index c567f20b9d1f..5dd05e72ed9e 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2954,15 +2954,32 @@ static void amdgpu_device_detect_sriov_bios(struct > amdgpu_device *adev) > } > } > > +/** > + * amdgpu_device_asic_is_blockchain_sku - determine if the asic is blockchain > + * SKU > + * > + * @pdev: pointer to pci_dev instance > + * > + * returns true if the asic is blockchain SKU, false if not. > + */ > +bool amdgpu_device_asic_is_blockchain_sku(struct pci_dev *pdev) > +{ > + if (pdev->device == 0x731E && > + (pdev->revision == 0xC6 || pdev->revision == 0xC7)) > + return true; > + return false; > +} I don't think this makes sense to have a navi specific function in amdgpu_device.c. Also, I said said previously, wouldn't it be easier to just check in nv.c? E.g., diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 1ce741a0c6a7..e661e796fb4c 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -483,8 +483,12 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) if (adev->enable_virtual_display || amdgpu_sriov_vf(adev)) amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block); #if defined(CONFIG_DRM_AMD_DC) - else if (amdgpu_device_has_dc_support(adev)) - amdgpu_device_ip_block_add(adev, &dm_ip_block); + else if (amdgpu_device_has_dc_support(adev)) { + if (adev->pdev->device != 0x731E || + (adev->pdev->revision != 0xC6 && +adev->pdev->revision != 0xC7)) + amdgpu_device_ip_block_add(adev, &dm_ip_block); + } #endif amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block); amdgpu_device_ip_block_add(adev, &sdma_v5_0_ip_block); > + > /** > * amdgpu_device_asic_has_dc_support - determine if DC supports the asic > * > * @asic_type: AMD asic type > + * @pdev: pointer to pci_dev instance > * > * Check if there is DC (new modesetting infrastructre) support for an asic. > * returns true if DC has support, false if not. > */ > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev) > { > switch (asic_type) { > #if defined(CONFIG_DRM_AMD_DC) > @@ -2999,6 +3016,13 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) > #if defined(CONFIG_DRM_AMD_DC_DCN) > case CHIP_RAVEN: > case CHIP_NAVI10: > + if (amdgpu_device_asic_is_blockchain_sku(pdev)) { > + DRM_INFO("(%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X) has > no dc support.\n", > +amdgpu_asic_name[asic_type], pdev->vendor, > pdev->device, > +pdev->subsystem_vendor, > pdev->subsystem_device, pdev->revision); > + return false; > + } > + return amdgpu_dc != 0; > case CHIP_NAVI14: > case CHIP_NAVI12: > case CHIP_RENOIR: > @@ -3031,7 +3055,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device > *adev) > if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display) > return false; > > - return amdgpu_device_asic_has_dc_support(adev->asic_type); > +
Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
[AMD Official Use Only - Internal Distribution Only] Hi Alex, Sorry, I misunderstand your meaning, I will refine it. Thanks! Rico From: Alex Deucher Sent: Thursday, October 22, 2020 11:16 To: Yin, Tianci (Rico) Cc: amd-gfx list ; Long, Gang ; Chen, Guchun ; Xu, Feifei ; Tuikov, Luben ; Deucher, Alexander ; Cui, Flora ; Zhang, Hawking Subject: Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU On Wed, Oct 21, 2020 at 11:04 PM Tianci Yin wrote: > > From: "Tianci.Yin" > > The blockchain SKU has no display support, remove it. > > Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd > Reviewed-by: Guchun Chen > Signed-off-by: Tianci.Yin > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 28 +++-- > drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > 4 files changed, 30 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index f8f3e375c93e..3c63fb8904de 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -1051,7 +1051,8 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device > *adev, >u32 pcie_index, u32 pcie_data, >u32 reg_addr, u64 reg_data); > > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); > +bool amdgpu_device_asic_is_blockchain_sku(struct pci_dev *pdev); > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev); > bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); > > int emu_soc_asic_init(struct amdgpu_device *adev); > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index c567f20b9d1f..5dd05e72ed9e 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2954,15 +2954,32 @@ static void amdgpu_device_detect_sriov_bios(struct > amdgpu_device *adev) > } > } > > +/** > + * amdgpu_device_asic_is_blockchain_sku - determine if the asic is blockchain > + * SKU > + * > + * @pdev: pointer to pci_dev instance > + * > + * returns true if the asic is blockchain SKU, false if not. > + */ > +bool amdgpu_device_asic_is_blockchain_sku(struct pci_dev *pdev) > +{ > + if (pdev->device == 0x731E && > + (pdev->revision == 0xC6 || pdev->revision == 0xC7)) > + return true; > + return false; > +} I don't think this makes sense to have a navi specific function in amdgpu_device.c. Also, I said said previously, wouldn't it be easier to just check in nv.c? E.g., diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 1ce741a0c6a7..e661e796fb4c 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -483,8 +483,12 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) if (adev->enable_virtual_display || amdgpu_sriov_vf(adev)) amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block); #if defined(CONFIG_DRM_AMD_DC) - else if (amdgpu_device_has_dc_support(adev)) - amdgpu_device_ip_block_add(adev, &dm_ip_block); + else if (amdgpu_device_has_dc_support(adev)) { + if (adev->pdev->device != 0x731E || + (adev->pdev->revision != 0xC6 && +adev->pdev->revision != 0xC7)) + amdgpu_device_ip_block_add(adev, &dm_ip_block); + } #endif amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block); amdgpu_device_ip_block_add(adev, &sdma_v5_0_ip_block); > + > /** > * amdgpu_device_asic_has_dc_support - determine if DC supports the asic > * > * @asic_type: AMD asic type > + * @pdev: pointer to pci_dev instance > * > * Check if there is DC (new modesetting infrastructre) support for an asic. > * returns true if DC has support, false if not. > */ > -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) > +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct > pci_dev *pdev) > { > switch (asic_type) { > #if defined(CONFIG_DRM_AMD_DC) > @@ -2999,6 +3016,13 @@ bool amdgpu_device_asic_has_dc_support(enum > amd_asic_type asic_type) > #if defined(CONFIG_DRM_AMD_DC_DCN) > case CHIP_RAVEN: > case CHIP_NAVI10: > + if (amdgpu_device_asic_i