Skip to contentSkip to conversation

drm/amdgpu: enable amdgpu_dc module parameter

PATCH In review Lang Yu 2 participants 3 messages Jan 20, 2022 – Jan 21, 2022

Subsystems (2)
lore
Share & tools
lore

Lang Yu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: enable amdgpu_dc module parameter

It doesn't work under IP discovery mode. Make it work!

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +8 -2
index 07965ac6381b..1ad137499e38 100644
@@ -846,8 +846,14 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
 {
 	if (adev->enable_virtual_display || amdgpu_sriov_vf(adev)) {
 		amdgpu_device_ip_block_add(adev, &amdgpu_vkms_ip_block);
+		return 0;
+	}
+
+	if (!amdgpu_device_has_dc_support(adev))
+		return 0;
+
 #if defined(CONFIG_DRM_AMD_DC)
-	} else if (adev->ip_versions[DCE_HWIP][0]) {
+	if (adev->ip_versions[DCE_HWIP][0]) {
 		switch (adev->ip_versions[DCE_HWIP][0]) {
 		case IP_VERSION(1, 0, 0):
 		case IP_VERSION(1, 0, 1):
@@ -882,9 +888,9 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
 				adev->ip_versions[DCI_HWIP][0]);
 			return -EINVAL;
 		}
-#endif
 	}
 	return 0;
+#endif
 }
 
 static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Lang Yu

It doesn't work under IP discovery mode. Make it work!

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +7 -1
index 07965ac6381b..1ad137499e38 100644
@@ -846,8 +846,14 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
 {
        if (adev->enable_virtual_display || amdgpu_sriov_vf(adev)) {
                amdgpu_device_ip_block_add(adev, &amdgpu_vkms_ip_block);
+               return 0;
+       }
+
+       if (!amdgpu_device_has_dc_support(adev))
+               return 0;
+
 #if defined(CONFIG_DRM_AMD_DC)
-       } else if (adev->ip_versions[DCE_HWIP][0]) {
+       if (adev->ip_versions[DCE_HWIP][0]) {
                switch (adev->ip_versions[DCE_HWIP][0]) {
                case IP_VERSION(1, 0, 0):
                case IP_VERSION(1, 0, 1):

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev) · line 893

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -1
@@ -882,9 +888,9 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
                                adev->ip_versions[DCI_HWIP][0]);
                        return -EINVAL;
                }
-#endif
        }
        return 0;
+#endif

I think the compiler will complain about this. If you move the #endif before the return, the patch is:

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -1
 }
 
 static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)
--

2.25.1

author
#2 lore raw
Quoted 40 lines · Alex Deucher
Quoted 29 lines · Lang Yu

It doesn't work under IP discovery mode. Make it work!

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +7 -1
index 07965ac6381b..1ad137499e38 100644
@@ -846,8 +846,14 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
 {
        if (adev->enable_virtual_display || amdgpu_sriov_vf(adev)) {
                amdgpu_device_ip_block_add(adev, &amdgpu_vkms_ip_block);
+               return 0;
+       }
+
+       if (!amdgpu_device_has_dc_support(adev))
+               return 0;
+
 #if defined(CONFIG_DRM_AMD_DC)
-       } else if (adev->ip_versions[DCE_HWIP][0]) {
+       if (adev->ip_versions[DCE_HWIP][0]) {
                switch (adev->ip_versions[DCE_HWIP][0]) {
                case IP_VERSION(1, 0, 0):
                case IP_VERSION(1, 0, 1):

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev) · line 893

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -1
@@ -882,9 +888,9 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
                                adev->ip_versions[DCI_HWIP][0]);
                        return -EINVAL;
                }
-#endif
        }
        return 0;
+#endif

I think the compiler will complain about this. If you move the #endif before the return, the patch is:

Quoted 1 line

Thanks. I got it.

Regards,
Lang

Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -1
 }
 
 static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)
--

2.25.1