Skip to contentSkip to conversation

drm/amdgpu: add DID for navi10 blockchain SKU

PATCH In review Tianci Yin 4 participants 9 messages Oct 21, 2020 – Oct 22, 2020

Subsystems (2)
lore
Share & tools
lore

Tianci Yin

author
#0 lore raw

PATCH 1/3 drm/amdgpu: add DID for navi10 blockchain SKU

From: "Tianci.Yin" <[email protected]>

Change-Id I58129e3aa88369c85929e4dde002cf43c3ff288a
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
index 564336c2ee66..13723914fa9f 100644
@@ -1066,6 +1066,7 @@ static const struct pci_device_id pciidlist[] = {
 	{0x1002, 0x7319, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	{0x1002, 0x731A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	{0x1002, 0x731B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
+	{0x1002, 0x731E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	{0x1002, 0x731F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	/* Navi14 */
 	{0x1002, 0x7340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14},
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#1 lore raw

PATCH 2/3 drm/amdgpu: disable DCN for navi10 blockchain SKU

From: "Tianci.Yin" <[email protected]>

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
---
 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
index f8f3e375c93e..04e906386b5b 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +17 -3
index c567f20b9d1f..fa522cffdd64 100644
@@ -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);
 }
 
 
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -1
index 9e92d2a070ac..97014458d7de 100644
@@ -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:
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -1
index 13723914fa9f..97fda825e0d3 100644
@@ -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) {
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw

Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU

Quoted 6 lines · Tianci Yin

From: "Tianci.Yin" <[email protected]>

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

Quoted 108 lines
Change-Id Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd
---
 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
index f8f3e375c93e..04e906386b5b 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +17 -3
index c567f20b9d1f..fa522cffdd64 100644
@@ -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);
 }
 
 
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -1
index 9e92d2a070ac..97014458d7de 100644
@@ -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:
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -2
index 13723914fa9f..97fda825e0d3 100644
@@ -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

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw

Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU

In reply to Tianci Yin
Quoted 3 lines · Tianci Yin

From: "Tianci.Yin" <[email protected]>

The blockchain SKU has no display support, so the DCN ip

"DCN IP" to stand for Intellectual Property.

Quoted 30 lines

block should be disabled. Add DID/RID as display supporting dependence, it potentially disable DCN block.

Change-Id Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd
---
 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
index f8f3e375c93e..04e906386b5b 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index c567f20b9d1f..fa522cffdd64 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev) · line 2961

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -0
@@ -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".

Quoted 25 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -2
  *
  * 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 ||

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) · line 3027

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +10 -0
+		     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

Quoted 31 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
 	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);
 }
 
 
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -1
index 9e92d2a070ac..97014458d7de 100644
@@ -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:
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index 13723914fa9f..97fda825e0d3 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c static int amdgpu_pci_probe(struct pci_dev *pdev, · line 1115

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -1
@@ -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) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw

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 <[email protected]>
Sent: Thursday, October 22, 2020 1:40
To: Yin, Tianci (Rico) <[email protected]>; [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Chen, Guchun <[email protected]>; Cui, Flora <[email protected]>; Xu, Feifei <[email protected]>; Long, Gang <[email protected]>
Subject: Re: [PATCH 2/3] drm/amdgpu: disable DCN for navi10 blockchain SKU

Quoted 3 lines · Tianci Yin

From: "Tianci.Yin" <[email protected]>

The blockchain SKU has no display support, so the DCN ip

"DCN IP" to stand for Intellectual Property.

Quoted 30 lines

block should be disabled. Add DID/RID as display supporting dependence, it potentially disable DCN block.

Change-Id Ia83bef1499708dfd0113fe2dbb3eb4143452c1cd
---
 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
index f8f3e375c93e..04e906386b5b 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index c567f20b9d1f..fa522cffdd64 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev) · line 2961

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -0
@@ -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".

Quoted 25 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -2
  *
  * 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 ||

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) · line 3027

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +10 -0
+                  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

Quoted 31 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
       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);
 }
 
 
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -1
index 9e92d2a070ac..97014458d7de 100644
@@ -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:
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index 13723914fa9f..97fda825e0d3 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c static int amdgpu_pci_probe(struct pci_dev *pdev, · line 1115

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -1
@@ -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) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#5 lore raw

PATCH 3/3 drm/amdgpu: disable VCN for navi10 blockchain SKU

In reply to Tianci Yin

From: "Tianci.Yin" <[email protected]>

The blockchain SKU has no VCN support, remove it.

Change-Id I26fbdabdf67aada24c5aebef999ee8b5f9c0bfe2
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/nv.c +4 -1
index ce787489aaeb..ffe4c2b3ea5f 100644
@@ -538,7 +538,10 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
 		    !amdgpu_sriov_vf(adev))
 			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
-		amdgpu_device_ip_block_add(adev, &vcn_v2_0_ip_block);
+		if (adev->pdev->device != 0x731E ||
+		    (adev->pdev->revision != 0xC6 &&
+		     adev->pdev->revision != 0xC7))
+			amdgpu_device_ip_block_add(adev, &vcn_v2_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &jpeg_v2_0_ip_block);
 		if (adev->enable_mes)
 			amdgpu_device_ip_block_add(adev, &mes_v10_1_ip_block);
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

Re: [PATCH 3/3] drm/amdgpu: disable VCN for navi10 blockchain SKU

Quoted 15 lines · Tianci Yin

From: "Tianci.Yin" <[email protected]>

The blockchain SKU has no VCN support, remove it.

Change-Id I26fbdabdf67aada24c5aebef999ee8b5f9c0bfe2
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/nv.c +0 -0
index ce787489aaeb..ffe4c2b3ea5f 100644

drivers/gpu/drm/amd/amdgpu/nv.c int nv_set_ip_blocks(struct amdgpu_device *adev) · line 544

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/nv.c +4 -1
@@ -538,7 +538,10 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
 		    !amdgpu_sriov_vf(adev))
 			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
-		amdgpu_device_ip_block_add(adev, &vcn_v2_0_ip_block);
+		if (adev->pdev->device != 0x731E ||
+		    (adev->pdev->revision != 0xC6 &&
+		     adev->pdev->revision != 0xC7))
+			amdgpu_device_ip_block_add(adev, &vcn_v2_0_ip_block);

It would be much easier to read and understand this conditional, if you'd copy the conditional you have in patch 2, and add an inversion to the front:

		if (!(device is block-chain SKU))
			add IP block header vcn2;

And you'd maintain similarity to an already introduced conditional, for instance of someone is doing a search through the code.

Regards,
Luben

drivers/gpu/drm/amd/amdgpu/nv.c int nv_set_ip_blocks(struct amdgpu_device *adev) · line 547

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/nv.c +0 -0
 		amdgpu_device_ip_block_add(adev, &jpeg_v2_0_ip_block);
 		if (adev->enable_mes)
 			amdgpu_device_ip_block_add(adev, &mes_v10_1_ip_block);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#7 lore raw
In reply to Tianci Yin

[AMD Public Use]

Series is: Reviewed-by: Guchun Chen <[email protected]>

Regards,
Guchun

-----Original Message-----
From: Tianci Yin <[email protected]>
Sent: Wednesday, October 21, 2020 3:56 PM
To: [email protected]
Cc: Tuikov, Luben <[email protected]>; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Chen, Guchun <[email protected]>; Cui, Flora <[email protected]>; Xu, Feifei <[email protected]>; Long, Gang <[email protected]>; Yin, Tianci (Rico) <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu: add DID for navi10 blockchain SKU

From: "Tianci.Yin" <[email protected]>

Change-Id I58129e3aa88369c85929e4dde002cf43c3ff288a
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
index 564336c2ee66..13723914fa9f 100644
@@ -1066,6 +1066,7 @@ static const struct pci_device_id pciidlist[] = {
 	{0x1002, 0x7319, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	{0x1002, 0x731A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	{0x1002, 0x731B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
+	{0x1002, 0x731E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	{0x1002, 0x731F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	/* Navi14 */
 	{0x1002, 0x7340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14},
Signature · 5 lines
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#8 lore raw

[AMD Public Use]

Thanks Guchun!
________________________________
From: Chen, Guchun <[email protected]>
Sent: Wednesday, October 21, 2020 16:01
To: Yin, Tianci (Rico) <[email protected]>; [email protected] <[email protected]>
Cc: Tuikov, Luben <[email protected]>; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Cui, Flora <[email protected]>; Xu, Feifei <[email protected]>; Long, Gang <[email protected]>; Yin, Tianci (Rico) <[email protected]>
Subject: RE: [PATCH 1/3] drm/amdgpu: add DID for navi10 blockchain SKU

[AMD Public Use]

Series is: Reviewed-by: Guchun Chen <[email protected]>

Regards,
Guchun

-----Original Message-----
From: Tianci Yin <[email protected]>
Sent: Wednesday, October 21, 2020 3:56 PM
To: [email protected]
Cc: Tuikov, Luben <[email protected]>; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Chen, Guchun <[email protected]>; Cui, Flora <[email protected]>; Xu, Feifei <[email protected]>; Long, Gang <[email protected]>; Yin, Tianci (Rico) <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu: add DID for navi10 blockchain SKU

From: "Tianci.Yin" <[email protected]>

Change-Id I58129e3aa88369c85929e4dde002cf43c3ff288a
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
index 564336c2ee66..13723914fa9f 100644
@@ -1066,6 +1066,7 @@ static const struct pci_device_id pciidlist[] = {
         {0x1002, 0x7319, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
         {0x1002, 0x731A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
         {0x1002, 0x731B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
+       {0x1002, 0x731E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
         {0x1002, 0x731F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
         /* Navi14 */
         {0x1002, 0x7340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14},

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx