aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h')
-rw-r--r--drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h277
1 files changed, 271 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
index 385c28238beb..bf6f017858a6 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -102,6 +102,11 @@
#define TRACE_BUFFER_ENTRY_OFFSET 16
/**
+ * Maximum number of dirty rects supported by FW.
+ */
+#define DMUB_MAX_DIRTY_RECTS 3
+
+/**
*
* PSR control version legacy
*/
@@ -166,6 +171,31 @@ union dmub_addr {
};
/**
+ * Dirty rect definition.
+ */
+struct dmub_rect {
+ /**
+ * Dirty rect x offset.
+ */
+ uint32_t x;
+
+ /**
+ * Dirty rect y offset.
+ */
+ uint32_t y;
+
+ /**
+ * Dirty rect width.
+ */
+ uint32_t width;
+
+ /**
+ * Dirty rect height.
+ */
+ uint32_t height;
+};
+
+/**
* Flags that can be set by driver to change some PSR behaviour.
*/
union dmub_psr_debug_flags {
@@ -177,6 +207,12 @@ union dmub_psr_debug_flags {
* Enable visual confirm in FW.
*/
uint32_t visual_confirm : 1;
+
+ /**
+ * Force all selective updates to bw full frame updates.
+ */
+ uint32_t force_full_frame_update : 1;
+
/**
* Use HW Lock Mgr object to do HW locking in FW.
*/
@@ -617,6 +653,14 @@ enum dmub_cmd_type {
*/
DMUB_CMD__ABM = 66,
/**
+ * Command type used to update dirty rects in FW.
+ */
+ DMUB_CMD__UPDATE_DIRTY_RECT = 67,
+ /**
+ * Command type used to update cursor info in FW.
+ */
+ DMUB_CMD__UPDATE_CURSOR_INFO = 68,
+ /**
* Command type used for HW locking in FW.
*/
DMUB_CMD__HW_LOCK = 69,
@@ -641,7 +685,10 @@ enum dmub_cmd_type {
* Command type used for all panel control commands.
*/
DMUB_CMD__PANEL_CNTL = 74,
-
+ /**
+ * Command type used for <TODO:description>
+ */
+ DMUB_CMD__CAB_FOR_SS = 75,
/**
* Command type used for interfacing with DPIA.
*/
@@ -879,6 +926,23 @@ struct dmub_rb_cmd_mall {
};
/**
+ * enum dmub_cmd_cab_type - TODO:
+ */
+enum dmub_cmd_cab_type {
+ DMUB_CMD__CAB_NO_IDLE_OPTIMIZATION = 0,
+ DMUB_CMD__CAB_NO_DCN_REQ = 1,
+ DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB = 2,
+};
+
+/**
+ * struct dmub_rb_cmd_cab_for_ss - TODO:
+ */
+struct dmub_rb_cmd_cab_for_ss {
+ struct dmub_cmd_header header;
+ uint8_t cab_alloc_ways; /* total number of ways */
+ uint8_t debug_bits; /* debug bits */
+};
+/**
* enum dmub_cmd_idle_opt_type - Idle optimization command type.
*/
enum dmub_cmd_idle_opt_type {
@@ -1363,6 +1427,7 @@ struct dmub_rb_cmd_dp_set_config_reply {
struct dmub_cmd_hpd_state_query_data {
uint8_t instance; /**< HPD instance or DPIA instance */
uint8_t result; /**< For returning HPD state */
+ uint16_t pad; /** < Alignment */
enum aux_channel_type ch_type; /**< enum aux_channel_type */
enum aux_return_code_type status; /**< for returning the status of command */
};
@@ -1420,6 +1485,10 @@ enum dmub_cmd_psr_type {
*/
DMUB_CMD__PSR_FORCE_STATIC = 5,
/**
+ * Set vtotal in psr active for FreeSync PSR.
+ */
+ DMUB_CMD__SET_SINK_VTOTAL_IN_PSR_ACTIVE = 6,
+ /**
* Set PSR power option
*/
DMUB_CMD__SET_PSR_POWER_OPT = 7,
@@ -1434,6 +1503,10 @@ enum psr_version {
*/
PSR_VERSION_1 = 0,
/**
+ * Freesync PSR SU.
+ */
+ PSR_VERSION_SU_1 = 1,
+ /**
* PSR not supported.
*/
PSR_VERSION_UNSUPPORTED = 0xFFFFFFFF,
@@ -1600,9 +1673,15 @@ struct dmub_cmd_psr_copy_settings_data {
*/
uint8_t frame_cap_ind;
/**
- * Explicit padding to 4 byte boundary.
+ * Granularity of Y offset supported by sink.
*/
- uint8_t pad[2];
+ uint8_t su_y_granularity;
+ /**
+ * Indicates whether sink should start capturing
+ * immediately following active scan line,
+ * or starting with the 2nd active scan line.
+ */
+ uint8_t line_capture_indication;
/**
* Multi-display optimizations are implemented on certain ASICs.
*/
@@ -1613,9 +1692,13 @@ struct dmub_cmd_psr_copy_settings_data {
*/
uint16_t init_sdp_deadline;
/**
- * Explicit padding to 4 byte boundary.
+ * @ rate_control_caps : Indicate FreeSync PSR Sink Capabilities
+ */
+ uint8_t rate_control_caps ;
+ /*
+ * Force PSRSU always doing full frame update
*/
- uint16_t pad2;
+ uint8_t force_ffu_mode;
/**
* Length of each horizontal line in us.
*/
@@ -1808,6 +1891,164 @@ struct dmub_rb_cmd_psr_force_static {
};
/**
+ * PSR SU debug flags.
+ */
+union dmub_psr_su_debug_flags {
+ /**
+ * PSR SU debug flags.
+ */
+ struct {
+ /**
+ * Update dirty rect in SW only.
+ */
+ uint8_t update_dirty_rect_only : 1;
+ /**
+ * Reset the cursor/plane state before processing the call.
+ */
+ uint8_t reset_state : 1;
+ } bitfields;
+
+ /**
+ * Union for debug flags.
+ */
+ uint32_t u32All;
+};
+
+/**
+ * Data passed from driver to FW in a DMUB_CMD__UPDATE_DIRTY_RECT command.
+ * This triggers a selective update for PSR SU.
+ */
+struct dmub_cmd_update_dirty_rect_data {
+ /**
+ * Dirty rects from OS.
+ */
+ struct dmub_rect src_dirty_rects[DMUB_MAX_DIRTY_RECTS];
+ /**
+ * PSR SU debug flags.
+ */
+ union dmub_psr_su_debug_flags debug_flags;
+ /**
+ * OTG HW instance.
+ */
+ uint8_t pipe_idx;
+ /**
+ * Number of dirty rects.
+ */
+ uint8_t dirty_rect_count;
+ /**
+ * PSR control version.
+ */
+ uint8_t cmd_version;
+ /**
+ * Panel Instance.
+ * Panel isntance to identify which psr_state to use
+ * Currently the support is only for 0 or 1
+ */
+ uint8_t panel_inst;
+};
+
+/**
+ * Definition of a DMUB_CMD__UPDATE_DIRTY_RECT command.
+ */
+struct dmub_rb_cmd_update_dirty_rect {
+ /**
+ * Command header.
+ */
+ struct dmub_cmd_header header;
+ /**
+ * Data passed from driver to FW in a DMUB_CMD__UPDATE_DIRTY_RECT command.
+ */
+ struct dmub_cmd_update_dirty_rect_data update_dirty_rect_data;
+};
+
+/**
+ * Data passed from driver to FW in a DMUB_CMD__UPDATE_CURSOR_INFO command.
+ */
+struct dmub_cmd_update_cursor_info_data {
+ /**
+ * Cursor dirty rects.
+ */
+ struct dmub_rect cursor_rect;
+ /**
+ * PSR SU debug flags.
+ */
+ union dmub_psr_su_debug_flags debug_flags;
+ /**
+ * Cursor enable/disable.
+ */
+ uint8_t enable;
+ /**
+ * OTG HW instance.
+ */
+ uint8_t pipe_idx;
+ /**
+ * PSR control version.
+ */
+ uint8_t cmd_version;
+ /**
+ * Panel Instance.
+ * Panel isntance to identify which psr_state to use
+ * Currently the support is only for 0 or 1
+ */
+ uint8_t panel_inst;
+};
+/**
+ * Definition of a DMUB_CMD__UPDATE_CURSOR_INFO command.
+ */
+struct dmub_rb_cmd_update_cursor_info {
+ /**
+ * Command header.
+ */
+ struct dmub_cmd_header header;
+ /**
+ * Data passed from driver to FW in a DMUB_CMD__UPDATE_CURSOR_INFO command.
+ */
+ struct dmub_cmd_update_cursor_info_data update_cursor_info_data;
+};
+
+/**
+ * Data passed from driver to FW in a DMUB_CMD__SET_SINK_VTOTAL_IN_PSR_ACTIVE command.
+ */
+struct dmub_cmd_psr_set_vtotal_data {
+ /**
+ * 16-bit value dicated by driver that indicates the vtotal in PSR active requirement when screen idle..
+ */
+ uint16_t psr_vtotal_idle;
+ /**
+ * PSR control version.
+ */
+ uint8_t cmd_version;
+ /**
+ * Panel Instance.
+ * Panel isntance to identify which psr_state to use
+ * Currently the support is only for 0 or 1
+ */
+ uint8_t panel_inst;
+ /*
+ * 16-bit value dicated by driver that indicates the vtotal in PSR active requirement when doing SU/FFU.
+ */
+ uint16_t psr_vtotal_su;
+ /**
+ * Explicit padding to 4 byte boundary.
+ */
+ uint8_t pad2[2];
+};
+
+/**
+ * Definition of a DMUB_CMD__SET_SINK_VTOTAL_IN_PSR_ACTIVE command.
+ */
+struct dmub_rb_cmd_psr_set_vtotal {
+ /**
+ * Command header.
+ */
+ struct dmub_cmd_header header;
+ /**
+ * Definition of a DMUB_CMD__SET_SINK_VTOTAL_IN_PSR_ACTIVE command.
+ */
+ struct dmub_cmd_psr_set_vtotal_data psr_set_vtotal_data;
+};
+
+/**
* Data passed from driver to FW in a DMUB_CMD__SET_PSR_POWER_OPT command.
*/
struct dmub_cmd_psr_set_power_opt_data {
@@ -1918,6 +2159,10 @@ enum hw_lock_client {
*/
HW_LOCK_CLIENT_DRIVER = 0,
/**
+ * PSR SU is the client of HW Lock Manager.
+ */
+ HW_LOCK_CLIENT_PSR_SU = 1,
+ /**
* Invalid client.
*/
HW_LOCK_CLIENT_INVALID = 0xFFFFFFFF,
@@ -2620,7 +2865,6 @@ struct dmub_rb_cmd_get_usbc_cable_id {
* union dmub_rb_cmd - DMUB inbox command.
*/
union dmub_rb_cmd {
- struct dmub_rb_cmd_lock_hw lock_hw;
/**
* Elements shared with all commands.
*/
@@ -2682,6 +2926,23 @@ union dmub_rb_cmd {
*/
struct dmub_rb_cmd_psr_force_static psr_force_static;
/**
+ * Definition of a DMUB_CMD__UPDATE_DIRTY_RECT command.
+ */
+ struct dmub_rb_cmd_update_dirty_rect update_dirty_rect;
+ /**
+ * Definition of a DMUB_CMD__UPDATE_CURSOR_INFO command.
+ */
+ struct dmub_rb_cmd_update_cursor_info update_cursor_info;
+ /**
+ * Definition of a DMUB_CMD__HW_LOCK command.
+ * Command is used by driver and FW.
+ */
+ struct dmub_rb_cmd_lock_hw lock_hw;
+ /**
+ * Definition of a DMUB_CMD__SET_SINK_VTOTAL_IN_PSR_ACTIVE command.
+ */
+ struct dmub_rb_cmd_psr_set_vtotal psr_set_vtotal;
+ /**
* Definition of a DMUB_CMD__SET_PSR_POWER_OPT command.
*/
struct dmub_rb_cmd_psr_set_power_opt psr_set_power_opt;
@@ -2694,6 +2955,10 @@ union dmub_rb_cmd {
*/
struct dmub_rb_cmd_mall mall;
/**
+ * Definition of a DMUB_CMD__CAB command.
+ */
+ struct dmub_rb_cmd_cab_for_ss cab;
+ /**
* Definition of a DMUB_CMD__IDLE_OPT_DCN_RESTORE command.
*/
struct dmub_rb_cmd_idle_opt_dcn_restore dcn_restore;