drm/amdgpu: enable amdgpu_dc module parameter
authorLang Yu <Lang.Yu@amd.com>
Thu, 20 Jan 2022 06:01:29 +0000 (14:01 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jan 2022 23:00:32 +0000 (18:00 -0500)
It doesn't work under IP discovery mode. Make it work!

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Alex Deucher <aleander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index e6a26b5542545cb8b50d131bafc592dd9cd8ff14..8dd15a7b8dcc41eb90d6faa9f8139323727f68a1 100644 (file)
@@ -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,8 +888,8 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
                                adev->ip_versions[DCI_HWIP][0]);
                        return -EINVAL;
                }
-#endif
        }
+#endif
        return 0;
 }