<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks very much Alex and Luben!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I refine the patches, please review again.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Rico<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Tuikov, Luben <Luben.Tuikov@amd.com><br>
<b>Sent:</b> Thursday, October 22, 2020 1:40<br>
<b>To:</b> Yin, Tianci (Rico) <Tianci.Yin@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Cui, Flora <Flora.Cui@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; Long, Gang <Gang.Long@amd.com><br>
<b>Subject:</b> Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 2020-10-21 03:56, Tianci Yin wrote:<br>
> From: "Tianci.Yin" <tianci.yin@amd.com><br>
> <br>
> The blockchain SKU has no display support, so the DCN ip<br>
<br>
"DCN IP" to stand for Intellectual Property.<br>
<br>
> block should be disabled. Add DID/RID as display<br>
> supporting dependence, it potentially disable DCN block.<br>
> <br>
> Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd<br>
> Signed-off-by: Tianci.Yin <tianci.yin@amd.com><br>
> ---<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h         |  2 +-<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c  | 20 +++++++++++++++++---<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c |  2 +-<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     |  2 +-<br>
>  4 files changed, 20 insertions(+), 6 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> index f8f3e375c93e..04e906386b5b 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> @@ -1051,7 +1051,7 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device *adev,<br>
>                                   u32 pcie_index, u32 pcie_data,<br>
>                                   u32 reg_addr, u64 reg_data);<br>
>  <br>
> -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type);<br>
> +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct pci_dev *pdev);<br>
>  bool amdgpu_device_has_dc_support(struct amdgpu_device *adev);<br>
>  <br>
>  int emu_soc_asic_init(struct amdgpu_device *adev);<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> index c567f20b9d1f..fa522cffdd64 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> @@ -2958,11 +2958,12 @@ static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)<br>
>   * amdgpu_device_asic_has_dc_support - determine if DC supports the asic<br>
>   *<br>
>   * @asic_type: AMD asic type<br>
> + * @pdev: pointer of pci_dev instance<br>
<br>
"pointer to ... instance", or,<br>
"pointer of ... type".<br>
<br>
>   *<br>
>   * Check if there is DC (new modesetting infrastructre) support for an asic.<br>
>   * returns true if DC has support, false if not.<br>
>   */<br>
> -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)<br>
> +bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type, struct pci_dev *pdev)<br>
>  {<br>
>        switch (asic_type) {<br>
>  #if defined(CONFIG_DRM_AMD_DC)<br>
> @@ -2998,7 +2999,6 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)<br>
>        case CHIP_VEGA20:<br>
>  #if defined(CONFIG_DRM_AMD_DC_DCN)<br>
>        case CHIP_RAVEN:<br>
> -     case CHIP_NAVI10:<br>
>        case CHIP_NAVI14:<br>
>        case CHIP_NAVI12:<br>
>        case CHIP_RENOIR:<br>
> @@ -3011,6 +3011,20 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)<br>
>  #endif<br>
>                return amdgpu_dc != 0;<br>
>  #endif<br>
> +#if defined(CONFIG_DRM_AMD_DC_DCN)<br>
> +     case CHIP_NAVI10:<br>
> +             if (pdev->device == 0x731E &&<br>
> +                 (pdev->revision == 0xC6 ||<br>
> +                  pdev->revision == 0xC7)) {<br>
> +                     DRM_INFO("(%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X) has no dc support.\n",<br>
> +                              amdgpu_asic_name[asic_type], pdev->vendor, pdev->device,<br>
> +                              pdev->subsystem_vendor, pdev->subsystem_device, pdev->revision);<br>
> +                     return false;<br>
> +             } else {<br>
> +                     return amdgpu_dc != 0;<br>
> +             }<br>
> +#endif<br>
> +<br>
<br>
Why not leave the placing of the original CHIP_NAVI10 label,<br>
and add the if () under it, and drop the "else { ..."?<br>
<br>
Regards,<br>
Luben<br>
<br>
<br>
>        default:<br>
>                if (amdgpu_dc > 0)<br>
>                        DRM_INFO("Display Core has been requested via kernel parameter "<br>
> @@ -3031,7 +3045,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device *adev)<br>
>        if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display)<br>
>                return false;<br>
>  <br>
> -     return amdgpu_device_asic_has_dc_support(adev->asic_type);<br>
> +     return amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev);<br>
>  }<br>
>  <br>
>  <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br>
> index 9e92d2a070ac..97014458d7de 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br>
> @@ -516,7 +516,7 @@ uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,<br>
>         */<br>
>        if ((bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) &&<br>
>            amdgpu_bo_support_uswc(bo_flags) &&<br>
> -         amdgpu_device_asic_has_dc_support(adev->asic_type)) {<br>
> +         amdgpu_device_asic_has_dc_support(adev->asic_type, adev->pdev)) {<br>
>                switch (adev->asic_type) {<br>
>                case CHIP_CARRIZO:<br>
>                case CHIP_STONEY:<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
> index 13723914fa9f..97fda825e0d3 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
> @@ -1109,7 +1109,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,<br>
>        bool supports_atomic = false;<br>
>  <br>
>        if (!amdgpu_virtual_display &&<br>
> -         amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))<br>
> +         amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK, pdev))<br>
>                supports_atomic = true;<br>
>  <br>
>        if ((flags & AMD_EXP_HW_SUPPORT) && !amdgpu_exp_hw_support) {<br>
> <br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>