Commit e0138644 authored by Bhawanpreet Lakha's avatar Bhawanpreet Lakha Committed by Alex Deucher
Browse files

drm/amd/display: Add structs for Freesync Panel Replay



In some instances, the GPU is transmitting repeated frame to the sink
without any updates or changes in the content. These repeat transmission
are wasteful, resulting in power draw in different aspects of the system

1. DCN is fetching the frame of data from DF/UMC/DRAM. This memory traffic
prevents power down of parts of this HW path.

2. GPU is transmitting pixel data to the display through the main link of
the DisplayPort interface. This prevents power down of both the Source
transmitter (TX) and the Sink receiver (RX)

The concepts of utilizing replay is similar to PSR, but there is a benefit of:
	Source and Sink remaining synchronized which allows for
        	- lower latency when switching from replay to live frames
	        - enable the possibility of more use cases
		- easy control of the sink's refresh rate during replay

Due to Source and Sink remaining timing synchronized, Replay can be activated
in more UI scenarios.

Signed-off-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e2e42edf
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -430,6 +430,7 @@ enum visual_confirm {
	VISUAL_CONFIRM_SWAPCHAIN = 6,
	VISUAL_CONFIRM_FAMS = 7,
	VISUAL_CONFIRM_SWIZZLE = 9,
	VISUAL_CONFIRM_REPLAY = 12,
	VISUAL_CONFIRM_SUBVP = 14,
	VISUAL_CONFIRM_MCLK_SWITCH = 16,
};
@@ -905,6 +906,7 @@ struct dc_debug_options {
	uint32_t fpo_vactive_max_blank_us;
	bool enable_legacy_fast_update;
	bool disable_dc_mode_overwrite;
	bool replay_skip_crtc_disabled;
};

struct gpu_info_soc_bounding_box_v1_0;
@@ -1524,6 +1526,8 @@ struct dc_link {
	struct backlight_settings backlight_settings;
	struct psr_settings psr_settings;

	struct replay_settings replay_settings;

	/* Drive settings read from integrated info table */
	struct dc_lane_settings bios_forced_drive_settings;

+29 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,11 @@ struct edp_psr_info {
	uint8_t force_psrsu_cap;
};

struct replay_info {
	uint8_t pixel_deviation_per_line;
	uint8_t max_deviation_line;
};

struct dprx_states {
	bool cable_id_written;
};
@@ -1236,6 +1241,8 @@ struct dpcd_caps {
	uint8_t edp_rev;
	union edp_alpm_caps alpm_caps;
	struct edp_psr_info psr_info;

	struct replay_info pr_info;
};

union dpcd_sink_ext_caps {
@@ -1276,6 +1283,28 @@ union dpcd_psr_configuration {
	unsigned char raw;
};

union replay_enable_and_configuration {
	struct {
		unsigned char FREESYNC_PANEL_REPLAY_MODE              :1;
		unsigned char TIMING_DESYNC_ERROR_VERIFICATION        :1;
		unsigned char STATE_TRANSITION_ERROR_DETECTION        :1;
		unsigned char RESERVED0                               :1;
		unsigned char RESERVED1                               :4;
	} bits;
	unsigned char raw;
};

union dpcd_replay_configuration {
	struct {
		unsigned char STATE_TRANSITION_ERROR_STATUS    : 1;
		unsigned char DESYNC_ERROR_STATUS              : 1;
		unsigned char SINK_DEVICE_REPLAY_STATUS        : 3;
		unsigned char SINK_FRAME_LOCKED                : 2;
		unsigned char RESERVED                         : 1;
	} bits;
	unsigned char raw;
};

union dpcd_alpm_configuration {
	struct {
		unsigned char ENABLE                    : 1;
+41 −0
Original line number Diff line number Diff line
@@ -1025,6 +1025,45 @@ struct psr_settings {
	unsigned int psr_power_opt;
};

enum replay_coasting_vtotal_type {
	PR_COASTING_TYPE_NOM = 0,
	PR_COASTING_TYPE_STATIC,
	PR_COASTING_TYPE_FULL_SCREEN_VIDEO,
	PR_COASTING_TYPE_TEST_HARNESS,
	PR_COASTING_TYPE_NUM,
};

union replay_error_status {
	struct {
		unsigned char STATE_TRANSITION_ERROR    :1;
		unsigned char LINK_CRC_ERROR            :1;
		unsigned char DESYNC_ERROR              :1;
		unsigned char RESERVED                  :5;
	} bits;
	unsigned char raw;
};

struct replay_config {
	bool replay_supported;                          // Replay feature is supported
	unsigned int replay_power_opt_supported;        // Power opt flags that are supported
	bool replay_smu_opt_supported;                  // SMU optimization is supported
	unsigned int replay_enable_option;              // Replay enablement option
	uint32_t debug_flags;                           // Replay debug flags
	bool replay_timing_sync_supported;             // Replay desync is supported
	union replay_error_status replay_error_status; // Replay error status
};

/* Replay feature flags */
struct replay_settings {
	struct replay_config config;            // Replay configuration
	bool replay_feature_enabled;            // Replay feature is ready for activating
	bool replay_allow_active;               // Replay is currently active
	unsigned int replay_power_opt_active;   // Power opt flags that are activated currently
	bool replay_smu_opt_enable;             // SMU optimization is enabled
	uint16_t coasting_vtotal;               // Current Coasting vtotal
	uint16_t coasting_vtotal_table[PR_COASTING_TYPE_NUM]; // Coasting vtotal table
};

/* To split out "global" and "per-panel" config settings.
 * Add a struct dc_panel_config under dc_link
 */
@@ -1051,9 +1090,11 @@ struct dc_panel_config {
	struct psr {
		bool disable_psr;
		bool disallow_psrsu;
		bool disallow_replay;
		bool rc_disable;
		bool rc_allow_static_screen;
		bool rc_allow_fullscreen_VPB;
		unsigned int replay_enable_option;
	} psr;
	/* ABM */
	struct varib {
+1 −0
Original line number Diff line number Diff line
@@ -660,6 +660,7 @@ static const struct dc_panel_config panel_config_defaults = {
		.psr = {
			.disable_psr = false,
			.disallow_psrsu = false,
			.disallow_replay = false,
		},
		.ilr = {
			.optimize_edp_link_rate = true,
+1 −0
Original line number Diff line number Diff line
@@ -733,6 +733,7 @@ static const struct dc_panel_config panel_config_defaults = {
	.psr = {
		.disable_psr = false,
		.disallow_psrsu = false,
		.disallow_replay = false,
	},
};

Loading