]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu/disply: set num_crtc earlier
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Dec 2020 21:06:26 +0000 (16:06 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Dec 2020 15:03:59 +0000 (10:03 -0500)
To avoid a recently added warning:
 Bogus possible_crtcs: [ENCODER:65:TMDS-65] possible_crtcs=0xf (full crtc mask=0x7)
 WARNING: CPU: 3 PID: 439 at drivers/gpu/drm/drm_mode_config.c:617 drm_mode_config_validate+0x178/0x200 [drm]
In this case the warning is harmless, but confusing to users.

Fixes: 0df108237433 ("drm: Validate encoder->possible_crtcs")
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=209123
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 9b6809f309f44c936905a5e6028902d583fa23f6..0f7749e9424d4170edc04c1e3b1be2182aa19849 100644 (file)
@@ -1058,9 +1058,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
                goto error;
        }
 
-       /* Update the actual used number of crtc */
-       adev->mode_info.num_crtc = adev->dm.display_indexes_num;
-
        /* create fake encoders for MST */
        dm_dp_create_fake_mst_encoders(adev);
 
@@ -3251,6 +3248,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
        enum dc_connection_type new_connection_type = dc_connection_none;
        const struct dc_plane_cap *plane;
 
+       dm->display_indexes_num = dm->dc->caps.max_streams;
+       /* Update the actual used number of crtc */
+       adev->mode_info.num_crtc = adev->dm.display_indexes_num;
+
        link_cnt = dm->dc->caps.max_links;
        if (amdgpu_dm_mode_config_init(dm->adev)) {
                DRM_ERROR("DM: Failed to initialize mode config\n");
@@ -3312,8 +3313,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
                        goto fail;
                }
 
-       dm->display_indexes_num = dm->dc->caps.max_streams;
-
        /* loops over all connectors on the board */
        for (i = 0; i < link_cnt; i++) {
                struct dc_link *link = NULL;