[PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU
Alex Deucher
alexdeucher at gmail.com
Wed Oct 21 12:59:07 UTC 2020
On Wed, Oct 21, 2020 at 3:56 AM Tianci Yin <tianci.yin at amd.com> wrote:
>
> From: "Tianci.Yin" <tianci.yin at amd.com>
>
> 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 <tianci.yin at amd.com>
> ---
> 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) {
> --
> 2.17.1
>
> _______________________________________________
> 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