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

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
......@@ -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;
......
......@@ -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;
......
......@@ -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 {
......
......@@ -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,
......
......@@ -733,6 +733,7 @@ static const struct dc_panel_config panel_config_defaults = {
.psr = {
.disable_psr = false,
.disallow_psrsu = false,
.disallow_replay = false,
},
};
......
......@@ -103,6 +103,7 @@ static const struct dc_panel_config panel_config_defaults = {
.psr = {
.disable_psr = false,
.disallow_psrsu = false,
.disallow_replay = false,
},
};
......
......@@ -85,6 +85,7 @@ static const struct dc_panel_config panel_config_defaults = {
.psr = {
.disable_psr = false,
.disallow_psrsu = false,
.disallow_replay = false,
},
};
......
......@@ -896,6 +896,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,
......
......@@ -870,6 +870,7 @@ static const struct dc_debug_options debug_defaults_drv = {
.enable_z9_disable_interface = true,
.minimum_z8_residency_time = 2000,
.psr_skip_crtc_disable = true,
.replay_skip_crtc_disabled = true,
.disable_dmcu = true,
.force_abm_enable = false,
.timing_trace = false,
......@@ -945,6 +946,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,
......
......@@ -895,6 +895,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,
......
......@@ -891,6 +891,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,
......
......@@ -304,6 +304,8 @@ struct resource_pool {
struct dmcu *dmcu;
struct dmub_psr *psr;
struct dmub_replay *replay;
struct abm *multiple_abms[MAX_PIPES];
const struct resource_funcs *funcs;
......@@ -572,6 +574,23 @@ struct dc_state {
} perf_params;
};
struct replay_context {
/* ddc line */
enum channel_id aux_inst;
/* Transmitter id */
enum transmitter digbe_inst;
/* Engine Id is used for Dig Be source select */
enum engine_id digfe_inst;
/* Controller Id used for Dig Fe source select */
enum controller_id controllerId;
unsigned int line_time_in_ns;
};
enum dc_replay_enable {
DC_REPLAY_DISABLE = 0,
DC_REPLAY_ENABLE = 1,
};
struct dc_bounding_box_max_clk {
int max_dcfclk_mhz;
int max_dispclk_mhz;
......
......@@ -172,6 +172,7 @@ enum dpcd_psr_sink_states {
#define DP_SOURCE_BACKLIGHT_CURRENT_PEAK 0x326
#define DP_SOURCE_BACKLIGHT_CONTROL 0x32E
#define DP_SOURCE_BACKLIGHT_ENABLE 0x32F
#define DP_SOURCE_MINIMUM_HBLANK_SUPPORTED 0x340
#define DP_SOURCE_MINIMUM_HBLANK_SUPPORTED 0x340
#define DP_SINK_PR_REPLAY_STATUS 0x378
#endif /* __DAL_DPCD_DEFS_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment