Commit 8e054b0f authored by ChunTao Tso's avatar ChunTao Tso Committed by Alex Deucher
Browse files

drm/amd/display: Amend coasting vtotal for replay low hz



[WHY]
The original coasting vtotal is 2 bytes, and it need to
be amended to 4 bytes because low hz case.

[HOW]
Amend coasting vtotal from 2 bytes to 4 bytes.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarAlvin Lee <alvin.lee2@amd.com>
Acked-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarChunTao Tso <chuntao.tso@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3d066f95
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1085,9 +1085,9 @@ struct replay_settings {
	/* SMU optimization is enabled */
	bool replay_smu_opt_enable;
	/* Current Coasting vtotal */
	uint16_t coasting_vtotal;
	uint32_t coasting_vtotal;
	/* Coasting vtotal table */
	uint16_t coasting_vtotal_table[PR_COASTING_TYPE_NUM];
	uint32_t coasting_vtotal_table[PR_COASTING_TYPE_NUM];
	/* Maximum link off frame count */
	enum replay_link_off_frame_count_level link_off_frame_count_level;
	/* Replay pseudo vtotal for abm + ips on full screen video which can improve ips residency */
+2 −2
Original line number Diff line number Diff line
@@ -285,12 +285,12 @@ struct link_service {
			enum replay_FW_Message_type msg,
			union dmub_replay_cmd_set *cmd_data);
	bool (*edp_set_coasting_vtotal)(
			struct dc_link *link, uint16_t coasting_vtotal);
			struct dc_link *link, uint32_t coasting_vtotal);
	bool (*edp_replay_residency)(const struct dc_link *link,
			unsigned int *residency, const bool is_start,
			const bool is_alpm);
	bool (*edp_set_replay_power_opt_and_coasting_vtotal)(struct dc_link *link,
			const unsigned int *power_opts, uint16_t coasting_vtotal);
			const unsigned int *power_opts, uint32_t coasting_vtotal);

	bool (*edp_wait_for_t12)(struct dc_link *link);
	bool (*edp_is_ilr_optimization_required)(struct dc_link *link,
+2 −2
Original line number Diff line number Diff line
@@ -1034,7 +1034,7 @@ bool edp_send_replay_cmd(struct dc_link *link,
	return true;
}

bool edp_set_coasting_vtotal(struct dc_link *link, uint16_t coasting_vtotal)
bool edp_set_coasting_vtotal(struct dc_link *link, uint32_t coasting_vtotal)
{
	struct dc *dc = link->ctx->dc;
	struct dmub_replay *replay = dc->res_pool->replay;
@@ -1073,7 +1073,7 @@ bool edp_replay_residency(const struct dc_link *link,
}

bool edp_set_replay_power_opt_and_coasting_vtotal(struct dc_link *link,
	const unsigned int *power_opts, uint16_t coasting_vtotal)
	const unsigned int *power_opts, uint32_t coasting_vtotal)
{
	struct dc  *dc = link->ctx->dc;
	struct dmub_replay *replay = dc->res_pool->replay;
+2 −2
Original line number Diff line number Diff line
@@ -59,12 +59,12 @@ bool edp_setup_replay(struct dc_link *link,
bool edp_send_replay_cmd(struct dc_link *link,
			enum replay_FW_Message_type msg,
			union dmub_replay_cmd_set *cmd_data);
bool edp_set_coasting_vtotal(struct dc_link *link, uint16_t coasting_vtotal);
bool edp_set_coasting_vtotal(struct dc_link *link, uint32_t coasting_vtotal);
bool edp_replay_residency(const struct dc_link *link,
	unsigned int *residency, const bool is_start, const bool is_alpm);
bool edp_get_replay_state(const struct dc_link *link, uint64_t *state);
bool edp_set_replay_power_opt_and_coasting_vtotal(struct dc_link *link,
	const unsigned int *power_opts, uint16_t coasting_vtotal);
	const unsigned int *power_opts, uint32_t coasting_vtotal);
bool edp_wait_for_t12(struct dc_link *link);
bool edp_is_ilr_optimization_required(struct dc_link *link,
       struct dc_crtc_timing *crtc_timing);
+8 −0
Original line number Diff line number Diff line
@@ -3238,6 +3238,14 @@ struct dmub_cmd_replay_set_coasting_vtotal_data {
	 * Currently the support is only for 0 or 1
	 */
	uint8_t panel_inst;
	/**
	 * 16-bit value dicated by driver that indicates the coasting vtotal high byte part.
	 */
	uint16_t coasting_vtotal_high;
	/**
	 * Explicit padding to 4 byte boundary.
	 */
	uint8_t pad[2];
};

/**
Loading