mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 22:58:29 +00:00
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>
This commit is contained in:
parent
8d9c07b0eb
commit
8d26334d1c
2 changed files with 23 additions and 10 deletions
|
@ -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);
|
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,
|
bool dmcu_load_iram(struct dmcu *dmcu,
|
||||||
struct dmcu_iram_parameters params)
|
struct dmcu_iram_parameters params)
|
||||||
{
|
{
|
||||||
unsigned char ram_table[IRAM_SIZE];
|
unsigned char ram_table[IRAM_SIZE];
|
||||||
bool result = false;
|
bool result = false;
|
||||||
struct abm *abm = dmcu->ctx->dc->res_pool->abm;
|
|
||||||
|
|
||||||
if (dmcu == NULL && abm == NULL)
|
if (dmcu == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (dmcu && !dmcu->funcs->is_dmcu_initialized(dmcu))
|
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));
|
memset(&ram_table, 0, sizeof(ram_table));
|
||||||
|
|
||||||
// In the case where abm is implemented on dmcub,
|
if (dmcu->dmcu_version.abm_version == 0x24) {
|
||||||
// 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) {
|
|
||||||
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params);
|
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params);
|
||||||
result = dmcu->funcs->load_iram(
|
result = dmcu->funcs->load_iram(
|
||||||
dmcu, 0, (char *)(&ram_table), IRAM_RESERVE_AREA_START_V2_2);
|
dmcu, 0, (char *)(&ram_table), IRAM_RESERVE_AREA_START_V2_2);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#define MODULES_POWER_POWER_HELPERS_H_
|
#define MODULES_POWER_POWER_HELPERS_H_
|
||||||
|
|
||||||
#include "dc/inc/hw/dmcu.h"
|
#include "dc/inc/hw/dmcu.h"
|
||||||
|
#include "dc/inc/hw/abm.h"
|
||||||
|
|
||||||
|
|
||||||
enum abm_defines {
|
enum abm_defines {
|
||||||
|
@ -44,5 +45,7 @@ struct dmcu_iram_parameters {
|
||||||
|
|
||||||
bool dmcu_load_iram(struct dmcu *dmcu,
|
bool dmcu_load_iram(struct dmcu *dmcu,
|
||||||
struct dmcu_iram_parameters params);
|
struct dmcu_iram_parameters params);
|
||||||
|
bool dmub_init_abm_config(struct abm *abm,
|
||||||
|
struct dmcu_iram_parameters params);
|
||||||
|
|
||||||
#endif /* MODULES_POWER_POWER_HELPERS_H_ */
|
#endif /* MODULES_POWER_POWER_HELPERS_H_ */
|
||||||
|
|
Loading…
Add table
Reference in a new issue