summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
diff options
context:
space:
mode:
authorWyatt Wood <wyatt.wood@amd.com>2020-04-05 16:40:52 -0400
committerAlex Deucher <alexander.deucher@amd.com>2020-04-09 10:43:16 -0400
commit8d26334d1ccdae26f2ed6457d36cc8ae99e98fc7 (patch)
treefcc3fe1bb7d1da34d73f25c12fda447c4f1633d0 /drivers/gpu/drm/amd/display/modules/power/power_helpers.c
parent8d9c07b0eb099a0bda247d0206acb3a76410914d (diff)
downloadlwn-8d26334d1ccdae26f2ed6457d36cc8ae99e98fc7.tar.gz
lwn-8d26334d1ccdae26f2ed6457d36cc8ae99e98fc7.zip
drm/amd/display: Fix ABM config copy for dmcub
Decouple dmcub config copy from dmcu iram copy. Signed-off-by: Wyatt Wood <wyatt.wood@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/power/power_helpers.c')
-rw-r--r--drivers/gpu/drm/amd/display/modules/power/power_helpers.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
index c1a95da6706f..dd1517684c90 100644
--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
@@ -651,14 +651,31 @@ void fill_iram_v_2_3(struct iram_table_v_2_2 *ram_table, struct dmcu_iram_parame
params, ram_table);
}
+bool dmub_init_abm_config(struct abm *abm,
+ struct dmcu_iram_parameters params)
+{
+ unsigned char ram_table[IRAM_SIZE];
+ bool result = false;
+
+ if (abm == NULL)
+ return false;
+
+ memset(&ram_table, 0, sizeof(ram_table));
+
+ fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params);
+ result = abm->funcs->init_abm_config(
+ abm, (char *)(&ram_table), IRAM_RESERVE_AREA_START_V2_2);
+
+ return result;
+}
+
bool dmcu_load_iram(struct dmcu *dmcu,
struct dmcu_iram_parameters params)
{
unsigned char ram_table[IRAM_SIZE];
bool result = false;
- struct abm *abm = dmcu->ctx->dc->res_pool->abm;
- if (dmcu == NULL && abm == NULL)
+ if (dmcu == NULL)
return false;
if (dmcu && !dmcu->funcs->is_dmcu_initialized(dmcu))
@@ -666,14 +683,7 @@ bool dmcu_load_iram(struct dmcu *dmcu,
memset(&ram_table, 0, sizeof(ram_table));
- // In the case where abm is implemented on dmcub,
- // dmcu object will be null.
- // ABM 2.4 and up are implemented on dmcub
- if (dmcu == NULL) {
- fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params);
- result = abm->funcs->init_abm_config(
- abm, (char *)(&ram_table), IRAM_RESERVE_AREA_START_V2_2);
- } else if (dmcu->dmcu_version.abm_version == 0x24) {
+ if (dmcu->dmcu_version.abm_version == 0x24) {
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params);
result = dmcu->funcs->load_iram(
dmcu, 0, (char *)(&ram_table), IRAM_RESERVE_AREA_START_V2_2);