Commit 1e5cd4ad authored by Peichen Huang's avatar Peichen Huang Committed by Alex Deucher
Browse files

drm/amd/display: move panel replay out from edp



[WHY]
Panel Replay is not an eDP-specific function.

[HOW]
Create new Panel Replay source files and move the Panel Replay
functions from the eDP files to the new files. Additionally, create
a new link_service construct function to assign the related
function pointers.

Reviewed-by: default avatarRobin Chen <robin.chen@amd.com>
Signed-off-by: default avatarPeichen Huang <PeiChen.Huang@amd.com>
Signed-off-by: default avatarMatthew Stewart <matthew.stewart2@amd.com>
Tested-by: default avatarDan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0f744593
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ bool amdgpu_dm_replay_enable(struct dc_stream_state *stream, bool wait)
	link = stream->link;

	if (link) {
		link->dc->link_srv->edp_setup_replay(link, stream);
		link->dc->link_srv->dp_setup_replay(link, stream);
		link->dc->link_srv->edp_set_coasting_vtotal(link, stream->timing.v_total, 0);
		DRM_DEBUG_DRIVER("Enabling replay...\n");
		link->dc->link_srv->edp_set_replay_allow_active(link, &replay_active, wait, false, NULL);
+4 −5
Original line number Diff line number Diff line
@@ -493,24 +493,24 @@ bool dc_link_get_replay_state(const struct dc_link *link, uint64_t *state)

bool dc_link_set_pr_enable(struct dc_link *link, bool enable)
{
	return link->dc->link_srv->edp_pr_enable(link, enable);
	return link->dc->link_srv->dp_pr_enable(link, enable);
}

bool dc_link_update_pr_state(struct dc_link *link,
		struct dmub_cmd_pr_update_state_data *update_state_data)
{
	return link->dc->link_srv->edp_pr_update_state(link, update_state_data);
	return link->dc->link_srv->dp_pr_update_state(link, update_state_data);
}

bool dc_link_set_pr_general_cmd(struct dc_link *link,
		struct dmub_cmd_pr_general_cmd_data *general_cmd_data)
{
	return link->dc->link_srv->edp_pr_set_general_cmd(link, general_cmd_data);
	return link->dc->link_srv->dp_pr_set_general_cmd(link, general_cmd_data);
}

bool dc_link_get_pr_state(const struct dc_link *link, uint64_t *state)
{
	return link->dc->link_srv->edp_pr_get_state(link, state);
	return link->dc->link_srv->dp_pr_get_state(link, state);
}

bool dc_link_wait_for_t12(struct dc_link *link)
@@ -549,4 +549,3 @@ void dc_link_get_alpm_support(struct dc_link *link,
{
	link->dc->link_srv->edp_get_alpm_support(link, auxless_support, auxwake_support);
}
+5 −5
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ struct link_service {
	bool (*edp_set_replay_allow_active)(struct dc_link *dc_link,
			const bool *enable, bool wait, bool force_static,
			const unsigned int *power_opts);
	bool (*edp_setup_replay)(struct dc_link *link,
	bool (*dp_setup_replay)(struct dc_link *link,
			const struct dc_stream_state *stream);
	bool (*edp_send_replay_cmd)(struct dc_link *link,
			enum replay_FW_Message_type msg,
@@ -304,10 +304,10 @@ struct link_service {
	bool (*edp_receiver_ready_T9)(struct dc_link *link);
	bool (*edp_receiver_ready_T7)(struct dc_link *link);
	bool (*edp_power_alpm_dpcd_enable)(struct dc_link *link, bool enable);
	bool (*edp_pr_enable)(struct dc_link *link, bool enable);
	bool (*edp_pr_update_state)(struct dc_link *link, struct dmub_cmd_pr_update_state_data *update_state_data);
	bool (*edp_pr_set_general_cmd)(struct dc_link *link, struct dmub_cmd_pr_general_cmd_data *general_cmd_data);
	bool (*edp_pr_get_state)(const struct dc_link *link, uint64_t *state);
	bool (*dp_pr_enable)(struct dc_link *link, bool enable);
	bool (*dp_pr_update_state)(struct dc_link *link, struct dmub_cmd_pr_update_state_data *update_state_data);
	bool (*dp_pr_set_general_cmd)(struct dc_link *link, struct dmub_cmd_pr_general_cmd_data *general_cmd_data);
	bool (*dp_pr_get_state)(const struct dc_link *link, uint64_t *state);
	void (*edp_set_panel_power)(struct dc_link *link, bool powerOn);


+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ LINK_PROTOCOLS = link_hpd.o link_ddc.o link_dpcd.o link_dp_dpia.o \
link_dp_training.o link_dp_training_8b_10b.o link_dp_training_128b_132b.o \
link_dp_training_dpia.o link_dp_training_auxless.o \
link_dp_training_fixed_vs_pe_retimer.o link_dp_phy.o link_dp_capability.o \
link_edp_panel_control.o link_dp_irq_handler.o link_dp_dpia_bw.o
link_edp_panel_control.o link_dp_panel_replay.o link_dp_irq_handler.o link_dp_dpia_bw.o

AMD_DAL_LINK_PROTOCOLS = $(addprefix $(AMDDALPATH)/dc/link/protocols/, \
$(LINK_PROTOCOLS))
+13 −5
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include "protocols/link_dp_phy.h"
#include "protocols/link_dp_training.h"
#include "protocols/link_edp_panel_control.h"
#include "protocols/link_dp_panel_replay.h"
#include "protocols/link_hpd.h"
#include "gpio_service_interface.h"
#include "atomfirmware.h"
@@ -214,7 +215,6 @@ static void construct_link_service_edp_panel_control(struct link_service *link_s

	link_srv->edp_get_replay_state = edp_get_replay_state;
	link_srv->edp_set_replay_allow_active = edp_set_replay_allow_active;
	link_srv->edp_setup_replay = edp_setup_replay;
	link_srv->edp_send_replay_cmd = edp_send_replay_cmd;
	link_srv->edp_set_coasting_vtotal = edp_set_coasting_vtotal;
	link_srv->edp_replay_residency = edp_replay_residency;
@@ -228,13 +228,20 @@ static void construct_link_service_edp_panel_control(struct link_service *link_s
	link_srv->edp_receiver_ready_T9 = edp_receiver_ready_T9;
	link_srv->edp_receiver_ready_T7 = edp_receiver_ready_T7;
	link_srv->edp_power_alpm_dpcd_enable = edp_power_alpm_dpcd_enable;
	link_srv->edp_pr_enable = edp_pr_enable;
	link_srv->edp_pr_update_state = edp_pr_update_state;
	link_srv->edp_pr_set_general_cmd = edp_pr_set_general_cmd;
	link_srv->edp_pr_get_state = edp_pr_get_state;
	link_srv->edp_set_panel_power = edp_set_panel_power;
}

/* link dp panel replay implements DP panel replay functionality.
 */
static void construct_link_service_dp_panel_replay(struct link_service *link_srv)
{
	link_srv->dp_setup_replay = dp_setup_replay;
	link_srv->dp_pr_enable = dp_pr_enable;
	link_srv->dp_pr_update_state = dp_pr_update_state;
	link_srv->dp_pr_set_general_cmd = dp_pr_set_general_cmd;
	link_srv->dp_pr_get_state = dp_pr_get_state;
}

/* link dp cts implements dp compliance test automation protocols and manual
 * testing interfaces for debugging and certification purpose.
 */
@@ -287,6 +294,7 @@ static void construct_link_service(struct link_service *link_srv)
	construct_link_service_dp_phy_or_dpia(link_srv);
	construct_link_service_dp_irq_handler(link_srv);
	construct_link_service_edp_panel_control(link_srv);
	construct_link_service_dp_panel_replay(link_srv);
	construct_link_service_dp_cts(link_srv);
	construct_link_service_dp_trace(link_srv);
}
Loading