]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu/display: fix warnings when CONFIG_DRM_AMD_DC_DCN is not set
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 27 Oct 2020 15:02:26 +0000 (11:02 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 2 Nov 2020 20:34:33 +0000 (15:34 -0500)
Properly protect the relevant code with CONFIG_DRM_AMD_DC_DCN.

Fixes: c4075c7ad6c9 ("drm/amd/display: Fix the display corruption issue on Navi10")
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 170beee67ccf24a0309bc19509df2f6d7cc9cc08..f51a1a6160b3457806ba8942a7f7d8424323f145 100644 (file)
@@ -894,6 +894,7 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
        return 0;
 }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_addr_space_config *pa_config)
 {
        uint64_t pt_base;
@@ -946,6 +947,7 @@ static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_
        pa_config->is_hvm_enabled = 0;
 
 }
+#endif
 
 static int amdgpu_dm_init(struct amdgpu_device *adev)
 {
@@ -953,7 +955,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 #ifdef CONFIG_DRM_AMD_DC_HDCP
        struct dc_callback_init init_params;
 #endif
-       struct dc_phy_addr_space_config pa_config;
        int r;
 
        adev->dm.ddev = adev_to_drm(adev);
@@ -1059,6 +1060,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
 #if defined(CONFIG_DRM_AMD_DC_DCN)
        if (adev->asic_type == CHIP_RENOIR) {
+               struct dc_phy_addr_space_config pa_config;
+
                mmhub_read_system_context(adev, &pa_config);
 
                // Call the DC init_memory func