Lines Matching refs:dmcu
34 #define TO_DCE_DMCU(dmcu)\ argument
35 container_of(dmcu, struct dce_dmcu, base)
72 static bool dce_dmcu_init(struct dmcu *dmcu) in dce_dmcu_init() argument
78 static bool dce_dmcu_load_iram(struct dmcu *dmcu, in dce_dmcu_load_iram() argument
83 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dce_dmcu_load_iram()
106 static void dce_get_dmcu_psr_state(struct dmcu *dmcu, enum dc_psr_state *state) in dce_get_dmcu_psr_state() argument
108 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dce_get_dmcu_psr_state()
129 static void dce_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable, bool wait) in dce_dmcu_set_psr_enable() argument
131 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dce_dmcu_set_psr_enable()
155 dce_get_dmcu_psr_state(dmcu, &state); in dce_dmcu_set_psr_enable()
168 static bool dce_dmcu_setup_psr(struct dmcu *dmcu, in dce_dmcu_setup_psr() argument
172 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dce_dmcu_setup_psr()
250 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG1), in dce_dmcu_setup_psr()
262 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG2), in dce_dmcu_setup_psr()
267 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG3), in dce_dmcu_setup_psr()
280 static bool dce_is_dmcu_initialized(struct dmcu *dmcu) in dce_is_dmcu_initialized() argument
282 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dce_is_dmcu_initialized()
296 struct dmcu *dmcu, in dce_psr_wait_loop() argument
299 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dce_psr_wait_loop()
302 if (dmcu->cached_wait_loop_number == wait_loop_number) in dce_psr_wait_loop()
306 if (!dce_is_dmcu_initialized(dmcu)) in dce_psr_wait_loop()
314 dmcu->cached_wait_loop_number = wait_loop_number; in dce_psr_wait_loop()
315 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG1), masterCmdData1.u32); in dce_psr_wait_loop()
325 struct dmcu *dmcu, unsigned int *psr_wait_loop_number) in dce_get_psr_wait_loop() argument
327 *psr_wait_loop_number = dmcu->cached_wait_loop_number; in dce_get_psr_wait_loop()
331 static void dcn10_get_dmcu_version(struct dmcu *dmcu) in dcn10_get_dmcu_version() argument
333 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_get_dmcu_version()
345 dmcu->dmcu_version.interface_version = REG_READ(DMCU_IRAM_RD_DATA); in dcn10_get_dmcu_version()
346 dmcu->dmcu_version.abm_version = REG_READ(DMCU_IRAM_RD_DATA); in dcn10_get_dmcu_version()
347 dmcu->dmcu_version.psr_version = REG_READ(DMCU_IRAM_RD_DATA); in dcn10_get_dmcu_version()
348 dmcu->dmcu_version.build_version = ((REG_READ(DMCU_IRAM_RD_DATA) << 8) | in dcn10_get_dmcu_version()
357 static void dcn10_dmcu_enable_fractional_pwm(struct dmcu *dmcu, in dcn10_dmcu_enable_fractional_pwm() argument
360 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_dmcu_enable_fractional_pwm()
379 static bool dcn10_dmcu_init(struct dmcu *dmcu) in dcn10_dmcu_init() argument
381 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_dmcu_init()
382 const struct dc_config *config = &dmcu->ctx->dc->config; in dcn10_dmcu_init()
384 struct dc_context *ctx = dmcu->ctx; in dcn10_dmcu_init()
396 dmcu->dmcu_state = REG_READ(DC_DMCU_SCRATCH); in dcn10_dmcu_init()
407 switch (dmcu->dmcu_state) { in dcn10_dmcu_init()
434 dmcu->dmcu_state = REG_READ(DC_DMCU_SCRATCH); in dcn10_dmcu_init()
437 if (dmcu->dmcu_state == DMCU_RUNNING) { in dcn10_dmcu_init()
439 dcn10_get_dmcu_version(dmcu); in dcn10_dmcu_init()
442 dcn10_dmcu_enable_fractional_pwm(dmcu, in dcn10_dmcu_init()
462 static bool dcn21_dmcu_init(struct dmcu *dmcu) in dcn21_dmcu_init() argument
464 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn21_dmcu_init()
467 if (dmcu->auto_load_dmcu && dmcub_psp_version == 0) { in dcn21_dmcu_init()
471 return dcn10_dmcu_init(dmcu); in dcn21_dmcu_init()
474 static bool dcn10_dmcu_load_iram(struct dmcu *dmcu, in dcn10_dmcu_load_iram() argument
479 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_dmcu_load_iram()
483 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_dmcu_load_iram()
519 static void dcn10_get_dmcu_psr_state(struct dmcu *dmcu, enum dc_psr_state *state) in dcn10_get_dmcu_psr_state() argument
521 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_get_dmcu_psr_state()
526 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_get_dmcu_psr_state()
546 static void dcn10_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable, bool wait) in dcn10_dmcu_set_psr_enable() argument
548 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_dmcu_set_psr_enable()
556 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_dmcu_set_psr_enable()
581 dcn10_get_dmcu_psr_state(dmcu, &state); in dcn10_dmcu_set_psr_enable()
599 static bool dcn10_dmcu_setup_psr(struct dmcu *dmcu, in dcn10_dmcu_setup_psr() argument
603 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_dmcu_setup_psr()
613 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_dmcu_setup_psr()
689 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG1), in dcn10_dmcu_setup_psr()
701 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG2), in dcn10_dmcu_setup_psr()
706 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG3), in dcn10_dmcu_setup_psr()
724 struct dmcu *dmcu, in dcn10_psr_wait_loop() argument
727 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_psr_wait_loop()
731 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_psr_wait_loop()
740 dmcu->cached_wait_loop_number = wait_loop_number; in dcn10_psr_wait_loop()
741 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG1), masterCmdData1.u32); in dcn10_psr_wait_loop()
752 struct dmcu *dmcu, unsigned int *psr_wait_loop_number) in dcn10_get_psr_wait_loop() argument
754 *psr_wait_loop_number = dmcu->cached_wait_loop_number; in dcn10_get_psr_wait_loop()
758 static bool dcn10_is_dmcu_initialized(struct dmcu *dmcu) in dcn10_is_dmcu_initialized() argument
761 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_is_dmcu_initialized()
768 static bool dcn20_lock_phy(struct dmcu *dmcu) in dcn20_lock_phy() argument
770 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn20_lock_phy()
773 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn20_lock_phy()
791 static bool dcn20_unlock_phy(struct dmcu *dmcu) in dcn20_unlock_phy() argument
793 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn20_unlock_phy()
796 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn20_unlock_phy()
814 static bool dcn10_send_edid_cea(struct dmcu *dmcu, in dcn10_send_edid_cea() argument
820 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_send_edid_cea()
824 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_send_edid_cea()
855 static bool dcn10_get_scp_results(struct dmcu *dmcu, in dcn10_get_scp_results() argument
861 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_get_scp_results()
864 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_get_scp_results()
878 static bool dcn10_recv_amd_vsdb(struct dmcu *dmcu, in dcn10_recv_amd_vsdb() argument
886 if (!dcn10_get_scp_results(dmcu, &data[0], &data[1], &data[2], &data[3])) in dcn10_recv_amd_vsdb()
906 static bool dcn10_recv_edid_cea_ack(struct dmcu *dmcu, int *offset) in dcn10_recv_edid_cea_ack() argument
911 if (!dcn10_get_scp_results(dmcu, in dcn10_recv_edid_cea_ack()
930 static void dcn10_forward_crc_window(struct dmcu *dmcu, in dcn10_forward_crc_window() argument
934 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_forward_crc_window()
941 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_forward_crc_window()
963 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG1), in dcn10_forward_crc_window()
966 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG2), in dcn10_forward_crc_window()
969 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG3), in dcn10_forward_crc_window()
980 static void dcn10_stop_crc_win_update(struct dmcu *dmcu, in dcn10_stop_crc_win_update() argument
983 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); in dcn10_stop_crc_win_update()
989 if (dmcu->dmcu_state != DMCU_RUNNING) in dcn10_stop_crc_win_update()
1001 dm_write_reg(dmcu->ctx, REG(MASTER_COMM_DATA_REG1), in dcn10_stop_crc_win_update()
1075 struct dmcu *base = &dmcu_dce->base; in dce_dmcu_construct()
1102 struct dmcu *dce_dmcu_create( in dce_dmcu_create()
1123 struct dmcu *dcn10_dmcu_create( in dcn10_dmcu_create()
1144 struct dmcu *dcn20_dmcu_create( in dcn20_dmcu_create()
1165 struct dmcu *dcn21_dmcu_create( in dcn21_dmcu_create()
1186 void dce_dmcu_destroy(struct dmcu **dmcu) in dce_dmcu_destroy() argument
1188 struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(*dmcu); in dce_dmcu_destroy()
1191 *dmcu = NULL; in dce_dmcu_destroy()