Skip to content

Commit 5cb3241

Browse files
Roman Lialexdeucher
authored andcommitted
drm/amd/display: Decouple ABM init from dmcu
[Why] With ABM implemented on DMUB the ABM enablement shoudn't be solely rely on dmcu. Otherwise it won't work if dmcu is disabled. [How] 1. Decouple dmcub config copy from dmcu iram copy. 2. Set abm connector property if either dmcu or dmub enabled. Signed-off-by: Roman Li <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]> Acked-by: Qingqing Zhuo <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 831010d commit 5cb3241

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ static int dm_late_init(void *handle)
13761376
unsigned int linear_lut[16];
13771377
int i;
13781378
struct dmcu *dmcu = NULL;
1379-
bool ret;
1379+
bool ret = true;
13801380

13811381
if (!adev->dm.fw_dmcu)
13821382
return detect_mst_link_for_all_connectors(adev->ddev);
@@ -1397,7 +1397,14 @@ static int dm_late_init(void *handle)
13971397
*/
13981398
params.min_abm_backlight = 0x28F;
13991399

1400-
ret = dmcu_load_iram(dmcu, params);
1400+
/* In the case where abm is implemented on dmcub,
1401+
* dmcu object will be null.
1402+
* ABM 2.4 and up are implemented on dmcub.
1403+
*/
1404+
if (dmcu)
1405+
ret = dmcu_load_iram(dmcu, params);
1406+
else if (adev->dm.dc->ctx->dmub_srv)
1407+
ret = dmub_init_abm_config(adev->dm.dc->res_pool->abm, params);
14011408

14021409
if (!ret)
14031410
return -EINVAL;
@@ -6226,7 +6233,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
62266233
aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc;
62276234

62286235
if (connector_type == DRM_MODE_CONNECTOR_eDP &&
6229-
dc_is_dmcu_initialized(adev->dm.dc)) {
6236+
(dc_is_dmcu_initialized(adev->dm.dc) || adev->dm.dc->ctx->dmub_srv)) {
62306237
drm_object_attach_property(&aconnector->base.base,
62316238
adev->mode_info.abm_level_property, 0);
62326239
}

0 commit comments

Comments
 (0)