<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);">
Hi Alex,</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);">
Sorry, I misunderstand your meaning, I will refine it.</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);">
Thanks!</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> Alex Deucher <alexdeucher@gmail.com><br>
<b>Sent:</b> Thursday, October 22, 2020 11:16<br>
<b>To:</b> Yin, Tianci (Rico) <Tianci.Yin@amd.com><br>
<b>Cc:</b> amd-gfx list <amd-gfx@lists.freedesktop.org>; Long, Gang <Gang.Long@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Cui, Flora <Flora.Cui@amd.com>;
Zhang, Hawking <Hawking.Zhang@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 Wed, Oct 21, 2020 at 11:04 PM Tianci Yin <tianci.yin@amd.com> wrote:<br>
><br>
> From: "Tianci.Yin" <tianci.yin@amd.com><br>
><br>
> The blockchain SKU has no display support, remove it.<br>
><br>
> Change-Id: Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd<br>
> Reviewed-by: Guchun Chen <guchun.chen@amd.com><br>
> Signed-off-by: Tianci.Yin <tianci.yin@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++-<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 28 +++++++++++++++++++--<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +-<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-<br>
> 4 files changed, 30 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> index f8f3e375c93e..3c63fb8904de 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> @@ -1051,7 +1051,8 @@ 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_is_blockchain_sku(struct pci_dev *pdev);<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..5dd05e72ed9e 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> @@ -2954,15 +2954,32 @@ static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)<br>
> }<br>
> }<br>
><br>
> +/**<br>
> + * amdgpu_device_asic_is_blockchain_sku - determine if the asic is blockchain<br>
> + * SKU<br>
> + *<br>
> + * @pdev: pointer to pci_dev instance<br>
> + *<br>
> + * returns true if the asic is blockchain SKU, false if not.<br>
> + */<br>
> +bool amdgpu_device_asic_is_blockchain_sku(struct pci_dev *pdev)<br>
> +{<br>
> + if (pdev->device == 0x731E &&<br>
> + (pdev->revision == 0xC6 || pdev->revision == 0xC7))<br>
> + return true;<br>
> + return false;<br>
> +}<br>
<br>
I don't think this makes sense to have a navi specific function in<br>
amdgpu_device.c. Also, I said said previously, wouldn't it be easier<br>
to just check in nv.c? E.g.,<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c<br>
index 1ce741a0c6a7..e661e796fb4c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/nv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c<br>
@@ -483,8 +483,12 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)<br>
if (adev->enable_virtual_display || amdgpu_sriov_vf(adev))<br>
amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);<br>
#if defined(CONFIG_DRM_AMD_DC)<br>
- else if (amdgpu_device_has_dc_support(adev))<br>
- amdgpu_device_ip_block_add(adev, &dm_ip_block);<br>
+ else if (amdgpu_device_has_dc_support(adev)) {<br>
+ if (adev->pdev->device != 0x731E ||<br>
+ (adev->pdev->revision != 0xC6 &&<br>
+ adev->pdev->revision != 0xC7))<br>
+ amdgpu_device_ip_block_add(adev, &dm_ip_block);<br>
+ }<br>
#endif<br>
amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);<br>
amdgpu_device_ip_block_add(adev, &sdma_v5_0_ip_block);<br>
<br>
<br>
> +<br>
> /**<br>
> * amdgpu_device_asic_has_dc_support - determine if DC supports the asic<br>
> *<br>
> * @asic_type: AMD asic type<br>
> + * @pdev: pointer to pci_dev instance<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>
> @@ -2999,6 +3016,13 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)<br>
> #if defined(CONFIG_DRM_AMD_DC_DCN)<br>
> case CHIP_RAVEN:<br>
> case CHIP_NAVI10:<br>
> + if (amdgpu_device_asic_is_blockchain_sku(pdev)) {<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>
> + }<br>
> + return amdgpu_dc != 0;<br>
> case CHIP_NAVI14:<br>
> case CHIP_NAVI12:<br>
> case CHIP_RENOIR:<br>
> @@ -3031,7 +3055,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>
> 2.17.1<br>
><br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Ctianci.yin%40amd.com%7C8677b036e861492f653808d87638e56d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637389334030603034%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SnaKO7Xvvtrgqn%2BxmqQDomL%2B1gUW3GmKiIFWGyUS3jI%3D&reserved=0">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Ctianci.yin%40amd.com%7C8677b036e861492f653808d87638e56d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637389334030603034%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SnaKO7Xvvtrgqn%2BxmqQDomL%2B1gUW3GmKiIFWGyUS3jI%3D&reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>