Commit 1c5ea40c authored by Yao Wang1's avatar Yao Wang1 Committed by Alex Deucher
Browse files

drm/amd/display: add a func to disable accelerated mode



[Why]
When driver disabled, we driver force the YCbCr420 to RGB,
which means some register will be changed, such as
RDPCS_PHY_DP_MPLLB_TX_CLK_DIV changed from 1 to 0
When driver re-enabled, OS will Set Mode YCbCr420 again,
which means the register RDPCS_PHY_DP_MPLLB_TX_CLK_DIV
should to be 1 again, but dmub fw can’t update the
register to 1 due to the mpll is not off

[How]
Adds an interface to disable accelerated mode bit,
which allows DM to decide to call during driver
disable/unload scenarios.

Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarYao Wang1 <Yao.Wang1@amd.com>
Reviewed-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Acked-by: default avatarSolomon Chiu <solomon.chiu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 443dfba0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -64,9 +64,10 @@ bool bios_is_accelerated_mode(


void bios_set_scratch_acc_mode_change(
	struct dc_bios *bios)
	struct dc_bios *bios,
	uint32_t state)
{
	REG_UPDATE(BIOS_SCRATCH_6, S6_ACC_MODE, 1);
	REG_UPDATE(BIOS_SCRATCH_6, S6_ACC_MODE, state);
}


+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ uint8_t *bios_get_image(struct dc_bios *bp, uint32_t offset,
	uint32_t size);

bool bios_is_accelerated_mode(struct dc_bios *bios);
void bios_set_scratch_acc_mode_change(struct dc_bios *bios);
void bios_set_scratch_acc_mode_change(struct dc_bios *bios, uint32_t state);
void bios_set_scratch_critical_state(struct dc_bios *bios, bool state);
uint32_t bios_get_vga_enabled_displays(struct dc_bios *bios);

+18 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include "dc_bios_types.h"

#include "bios_parser_interface.h"
#include "bios/bios_parser_helper.h"
#include "include/irq_service_interface.h"
#include "transform.h"
#include "dmcu.h"
@@ -3372,3 +3373,20 @@ bool dc_process_dmub_aux_transfer_async(struct dc *dc,

	return true;
}

/**
 *****************************************************************************
 *  Function: dc_disable_accelerated_mode
 *
 *  @brief
 *		disable accelerated mode
 *
 *  @param
 *		[in] dc: dc structure
 *
 *****************************************************************************
 */
void dc_disable_accelerated_mode(struct dc *dc)
{
	bios_set_scratch_acc_mode_change(dc->ctx->dc_bios, 0);
}
+6 −0
Original line number Diff line number Diff line
@@ -1313,4 +1313,10 @@ bool dc_process_dmub_aux_transfer_async(struct dc *dc,
 * DSC Interfaces
 ******************************************************************************/
#include "dc_dsc.h"

/*******************************************************************************
 * Disable acc mode Interfaces
 ******************************************************************************/
void dc_disable_accelerated_mode(struct dc *dc);

#endif /* DC_INTERFACE_H_ */
+1 −1
Original line number Diff line number Diff line
@@ -1750,7 +1750,7 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
		if (edp_link_with_sink && !keep_edp_vdd_on)
			dc->hwss.edp_power_control(edp_link_with_sink, false);
	}
	bios_set_scratch_acc_mode_change(dc->ctx->dc_bios);
	bios_set_scratch_acc_mode_change(dc->ctx->dc_bios, 1);
}

static uint32_t compute_pstate_blackout_duration(