drm/amd/display: Add panel replay capability detection
Subsystems (3)
PATCH 2/16 drm/amd/display: Add panel replay capability detection
From: Jack Chang <[email protected]>
[Why&How]
For supporting VESA PR, add flow to determine the support capability
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + drivers/gpu/drm/amd/display/dc/dc_types.h | 9 +++++++++ drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 15 +++++++++++++++ .../gpu/drm/amd/display/dc/link/link_factory.c | 2 ++ 4 files changed, 27 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -303,6 +303,7 @@ static bool create_links( link->link_id.id =CONNECTOR_ID_VIRTUAL ; link->link_id.enum_id =ENUM_ID_1 ; link->psr_settings.psr_version =DC_PSR_VERSION_UNSUPPORTED ; + link->replay_settings.config.replay_version =DC_REPLAY_VERSION_UNSUPPORTED ; link->link_enc =kzalloc (sizeof (*link->link_enc),GFP_KERNEL );if (!link->link_enc) {
drivers/gpu/drm/amd/display/dc/dc_types.h +9 -0
@@ -941,6 +941,12 @@ enum dc_psr_version { DC_PSR_VERSION_UNSUPPORTED = 0xFFFFFFFF, }; +enum dc_replay_version { +DC_FREESYNC_REPLAY =0 , +DC_VESA_PANEL_REPLAY =1 , +DC_REPLAY_VERSION_UNSUPPORTED =0XFF , +}; +/* Possible values of display_endpoint_id.endpoint */ enum display_endpoint_type {DISPLAY_ENDPOINT_PHY =0 ,/* Physical connector. */
@@ -1093,6 +1099,7 @@ enum replay_FW_Message_type { Replay_Set_Residency_Frameupdate_Timer, Replay_Set_Pseudo_VTotal, Replay_Disabled_Adaptive_Sync_SDP, + Replay_Set_Version, Replay_Set_General_Cmd, };
@@ -1128,6 +1135,8 @@ union replay_low_refresh_rate_enable_options { };struct replay_config { +/* Replay version */ +enum dc_replay_version replay_version;/* Replay feature is supported */ bool replay_supported;/* Replay caps support DPCD & EDID caps*/
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +15 -0
@@ -387,6 +387,21 @@ static void dmub_replay_send_cmd(struct dmub_replay *dmub, cmd.replay_disabled_adaptive_sync_sdp.data.force_disabled = cmd_element->disabled_adaptive_sync_sdp_data.force_disabled;break ; +case Replay_Set_Version: +//Header + cmd.replay_set_version.header.sub_type = +DMUB_CMD__REPLAY_SET_VERSION ; + cmd.replay_set_version.header.payload_bytes = +sizeof (struct dmub_rb_cmd_replay_set_version ) - +sizeof (struct dmub_cmd_header ); +//Cmd Body + cmd.replay_set_version.replay_set_version_data.panel_inst = + cmd_element->version_data.panel_inst; + cmd.replay_set_version.replay_set_version_data.version = + cmd_element->version_data.version; + cmd.replay_set_version.replay_set_version_data.cmd_version = + cmd_element->version_data.cmd_version; +break ;case Replay_Set_General_Cmd://Header cmd.replay_set_general_cmd.header.sub_type =
drivers/gpu/drm/amd/display/dc/link/link_factory.c +2 -0
@@ -787,6 +787,7 @@ static bool construct_phy(struct dc_link *link, link->psr_settings.psr_vtotal_control_support = false; link->psr_settings.psr_version =DC_PSR_VERSION_UNSUPPORTED ; + link->replay_settings.config.replay_version =DC_REPLAY_VERSION_UNSUPPORTED ;DC_LOG_DC ("BIOS object table - %s finished successfully.\n" , __func__);return true;
@@ -868,6 +869,7 @@ static bool construct_dpia(struct dc_link *link,/* TODO: Create link encoder */ link->psr_settings.psr_version =DC_PSR_VERSION_UNSUPPORTED ; + link->replay_settings.config.replay_version =DC_REPLAY_VERSION_UNSUPPORTED ;return true;
Signature · 1 line
2.43.0
PATCH 3/16 drm/amd/display: Get panel replay capability from DPCD
From: Jack Chang <[email protected]>
[Why&How]
Read Panel replay caps from DPCD when retrieving link capability
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 11 +++++++++++ .../display/dc/link/protocols/link_dp_capability.c | 5 +++++ 2 files changed, 16 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +11 -0
@@ -1157,6 +1157,16 @@ struct dprx_states {bool cable_id_written; }; +union dpcd_panel_replay_capability_supported { +struct { +unsigned char PANEL_REPLAY_SUPPORT :1 ; +unsigned char SELECTIVE_UPDATE_SUPPORT :1 ; +unsigned char EARLY_TRANSPORT_SUPPORT :1 ; +unsigned char RESERVED :5 ; + } bits; +unsigned char raw; +}; +enum dpcd_downstream_port_max_bpc {DOWN_STREAM_MAX_8BPC =0 ,DOWN_STREAM_MAX_10BPC ,
@@ -1280,6 +1290,7 @@ struct dpcd_caps {struct edp_psr_info psr_info;struct replay_info pr_info; +union dpcd_panel_replay_capability_supported pr_caps_supported;uint16_t edp_oled_emission_rate;union dp_receive_port0_cap receive_port0_cap;/* Indicates the number of SST links supported by MSO (Multi-Stream Output) */
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +5 -0
@@ -2091,6 +2091,11 @@ static bool retrieve_link_cap(struct dc_link *link) link->dpcd_caps.max_uncompressed_pixel_rate_cap.raw, sizeof(link->dpcd_caps.max_uncompressed_pixel_rate_cap.raw)); +core_link_read_dpcd (link, +DP_PANEL_REPLAY_CAPABILITY_SUPPORT , + &link->dpcd_caps.pr_caps_supported.raw, +sizeof (link->dpcd_caps.pr_caps_supported.raw)); +/* Read DP tunneling information. */ status =dpcd_get_tunneling_device_data (link);if (status !=DC_OK )
Signature · 1 line
2.43.0
PATCH 4/16 drm/amd/display: Add panel replay enablement option and logic
In reply to [email protected]From: Jack Chang <[email protected]>
[Why&How]
1.Add flow to enable and configure panel replay enablement and configuration
2.Add registry key for enable option
3.Add replay version check to be compatible with freesync replay 4.Add AC/DC switch function to notify ac/dc change. 5.Add flow in set event function to check and decide Replay enable/disable
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 25 ++++ .../link/protocols/link_edp_panel_control.c | 126 +++++++++++++++++- .../gpu/drm/amd/display/include/dpcd_defs.h | 16 +++ .../amd/display/modules/power/power_helpers.c | 3 + 4 files changed, 168 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +25 -0
@@ -1357,6 +1357,31 @@ union dpcd_replay_configuration {unsigned char raw; }; +union panel_replay_enable_and_configuration_1 { +struct { +unsigned char PANEL_REPLAY_ENABLE :1 ; +unsigned char PANEL_REPLAY_CRC_ENABLE :1 ; +unsigned char IRQ_HPD_ASSDP_MISSING :1 ; +unsigned char IRQ_HPD_VSCSDP_UNCORRECTABLE_ERROR :1 ; +unsigned char IRQ_HPD_RFB_ERROR :1 ; +unsigned char IRQ_HPD_ACTIVE_FRAME_CRC_ERROR :1 ; +unsigned char PANEL_REPLAY_SELECTIVE_UPDATE_ENABLE :1 ; +unsigned char PANEL_REPLAY_EARLY_TRANSPORT_ENABLE :1 ; + } bits; +unsigned char raw; +}; + +union panel_replay_enable_and_configuration_2 { +struct { +unsigned char SINK_REFRESH_RATE_UNLOCK_GRANTED :1 ; +unsigned char RESERVED :1 ; +unsigned char SU_Y_GRANULARITY_EXT_VALUE_ENABLED :1 ; +unsigned char SU_Y_GRANULARITY_EXT_VALUE :4 ; +unsigned char SU_REGION_SCAN_LINE_CAPTURE_INDICATION :1 ; + } bits; +unsigned char raw; +}; +union dpcd_alpm_configuration {struct {unsigned char ENABLE :1 ;
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +124 -2
144 lines not on this page · raw message
drivers/gpu/drm/amd/display/include/dpcd_defs.h +16 -0
@@ -30,6 +30,22 @@#ifndef DP_SINK_HW_REVISION_START // can remove this once the define gets into linux drm_dp_helper.h #define DP_SINK_HW_REVISION_START 0x409#endif +/* Panel Replay*/ +#ifndef DP_PANEL_REPLAY_CAPABILITY_SUPPORT // can remove this once the define gets into linux drm_dp_helper.h +#define DP_PANEL_REPLAY_CAPABILITY_SUPPORT 0x0b0 +#endif /* DP_PANEL_REPLAY_CAPABILITY_SUPPORT */ +#ifndef DP_PANEL_REPLAY_CAPABILITY // can remove this once the define gets into linux drm_dp_helper.h +#define DP_PANEL_REPLAY_CAPABILITY 0x0b1 +#endif /* DP_PANEL_REPLAY_CAPABILITY */ +#ifndef DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_1 // can remove this once the define gets into linux drm_dp_helper.h +#define DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_1 0x1b0 +#endif /* DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_1 */ +#ifndef DP_PANEL_REPLAY_ENABLE // can remove this once the define gets into linux drm_dp_helper.h +#define DP_PANEL_REPLAY_ENABLE (1 << 0) +#endif /* DP_PANEL_REPLAY_ENABLE */ +#ifndef DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_2 // can remove this once the define gets into linux drm_dp_helper.h +#define DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_2 0x1b1 +#endif /* DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_2 */ enum dpcd_revision {DPCD_REV_10 =0x10 ,
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +3 -0
@@ -1037,6 +1037,9 @@ void calculate_replay_link_off_frame_count(struct dc_link *link,uint8_t max_link_off_frame_count =0 ;uint16_t max_deviation_line =0 , pixel_deviation_per_line =0 ; +if (!link || link->replay_settings.config.replay_version !=DC_FREESYNC_REPLAY ) +return ; + max_deviation_line = link->dpcd_caps.pr_info.max_deviation_line; pixel_deviation_per_line = link->dpcd_caps.pr_info.pixel_deviation_per_line;
Signature · 1 line
2.43.0
PATCH 5/16 drm/amd/display: Remove unused variable in Replay set version structure
In reply to [email protected]From: Jack Chang <[email protected]>
[Why]
Remove unused variable from the DMUB replay command.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +0 -2
@@ -399,8 +399,6 @@ static void dmub_replay_send_cmd(struct dmub_replay *dmub, cmd_element->version_data.panel_inst; cmd.replay_set_version.replay_set_version_data.version = cmd_element->version_data.version; - cmd.replay_set_version.replay_set_version_data.cmd_version = - cmd_element->version_data.cmd_version;break ;case Replay_Set_General_Cmd://Header
Signature · 1 line
2.43.0
PATCH 6/16 drm/amd/display: Re-check seamless boot can be enabled or not
In reply to [email protected]From: Paul Hsieh <[email protected]>
[Why]
If the seamless boot feature has already been enabled, and dc_commit_streams is called again before receiving a flip, the driver will adjust the engine clock without turning off the screen, which will cause garbage to occur. However, in reality, the Pixel Clock from the first dc_commit_streams and the second dc_commit_streams are different.
[How]
If the apply seamless boot flag in the previous stream has not been cleared, and dc_commit_streams is received again, we need to recheck whether seamless boot should be disabled
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +8 -0
@@ -2147,6 +2147,14 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *cif (!dcb->funcs->is_accelerated_mode (dcb)) {disable_vbios_mode_if_required (dc, context); dc->hwss.enable_accelerated_mode (dc, context); + }else if (get_seamless_boot_stream_count (dc->current_state) >0 ) { +/* If the previous Stream still retains the apply seamless boot flag, +* it means the OS has not actually performed a flip yet. +* At this point, if we receive dc_commit_streams again, we should +* once more check whether the actual HW timing matches what the OS +* has provided +*/ +disable_vbios_mode_if_required (dc, context); }if (dc->hwseq->funcs.wait_for_pipe_update_if_needed) {
Signature · 1 line
2.43.0
PATCH 7/16 drm/amd/display: Move sleep into each retry for retrieve_link_cap()
In reply to [email protected]From: "Mario Limonciello (AMD)" <[email protected]>
[Why]
When a monitor is booting it's possible that it isn't ready to retrieve link caps and this can lead to an EDID read failure:
``` [drm:retrieve_link_cap [amdgpu]] *ERROR* retrieve_link_cap: Read receiver caps dpcd data failed. amdgpu 0000:c5:00.0: [drm] *ERROR* No EDID read. ```
[How]
Rather than msleep once and try a few times, msleep each time. Should be no changes for existing working monitors, but should correct reading caps on a monitor that is slow to boot.
--- .../amd/display/dc/link/protocols/link_dp_capability.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +5 -4
@@ -1756,12 +1756,13 @@ static bool retrieve_link_cap(struct dc_link *link) }dpcd_set_source_specific_data (link); -/* Sink may need to configure internals based on vendor, so allow some -* time before proceeding with possibly vendor specific transactions -*/ -msleep (post_oui_delay);for (i =0 ; i < read_dpcd_retry_cnt; i++) { +/* +* Sink may need to configure internals based on vendor, so allow some +* time before proceeding with possibly vendor specific transactions +*/ +msleep (post_oui_delay); status = core_link_read_dpcd( link, DP_DPCD_REV,
Signature · 1 line
2.43.0
PATCH 8/16 drm/amd/display: Increase DPCD read retries
In reply to [email protected]From: "Mario Limonciello (AMD)" <[email protected]>
[Why]
Empirical measurement of some monitors that fail to read EDID while booting shows that the number of retries with a 30ms delay between tries is as high as 16.
[How]
Increase number of retries to 20.
--- .../gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +1 -1
@@ -1713,7 +1713,7 @@ static bool retrieve_link_cap(struct dc_link *link)union edp_configuration_cap edp_config_cap;union dp_downstream_port_present ds_port = {0 };enum dc_status status =DC_ERROR_UNEXPECTED ; -uint32_t read_dpcd_retry_cnt =3 ; +uint32_t read_dpcd_retry_cnt =20 ;int i;struct dp_sink_hw_fw_revision dp_hw_fw_revision;const uint32_t post_oui_delay =30 ;// 30ms
Signature · 1 line
2.43.0
PATCH 9/16 drm/amd/display: Add an HPD filter for HDMI
In reply to [email protected]From: Ivan Lipski <[email protected]>
[Why]
Some monitors perform rapid “autoscan” HPD re‑assertions right after a disconnect or powersaving mode enablement. These appear as a quick disconnect→reconnect with an identical EDID. Since Linux has no HDMI hotplug detection (HPD) filter, these quick reconnects are seen as hotplug events, which can unintentionally wake a system with DPMS off.
An example: https://gitlab.freedesktop.org/drm/amd/-/issues/2876
Such 'fake reconnects' are considered when the interval between a disconnect and a connect is within 1500ms (experimentally chosen using several monitors), and the two connections have the same EDID.
[How]
Implement a time-based debounce mechanism:
1. On HDMI disconnect detection, instead of immediately processing the HPD event, save the current sink and schedule delayed work (default 1500ms)
2. If another HDMI disconnect HPD event arrives during the debounce period, it reschedules the pending work, ensuring only the final state is processed.
3. When the debounce timer expires, re-detect the display and compare the new sink with the cached one using EDID comparison.
4. If sinks match (same EDID), this was a spontaneous HPD toggle:
- Update connector state internally
- Skip hotplug event to prevent desktop rearrangement
If sinks differ, this was a real display change:
- Process normally with the hotplug event
The debounce delay is configurable via module parameter 'hdmi_hpd_debounce_delay_ms'.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 138 ++++++++++++++++++ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 6 + 2 files changed, 144 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +138 -0
@@ -3915,6 +3915,97 @@ void amdgpu_dm_update_connector_after_detect(mutex_unlock (&dev->mode_config.mutex); } +static bool are_sinks_equal (const struct dc_sink *sink1,const struct dc_sink *sink2) +{ +if (!sink1 || !sink2) +return false; +if (sink1->sink_signal != sink2->sink_signal) +return false; + +if (sink1->dc_edid.length != sink2->dc_edid.length) +return false; + +if (memcmp (sink1->dc_edid.raw_edid, sink2->dc_edid.raw_edid, + sink1->dc_edid.length) !=0 ) +return false; +return true; +} + + +/** +* DOC: hdmi_hpd_debounce_work +* +* HDMI HPD debounce delay in milliseconds. When an HDMI display toggles HPD +* (such as during power save transitions), this delay determines how long to +* wait before processing the HPD event. This allows distinguishing between a +* physical unplug (>hdmi_hpd_debounce_delay) +* and a spontaneous RX HPD toggle (<hdmi_hpd_debounce_delay). +* +* If the toggle is less than this delay, the driver compares sink capabilities +* and permits a hotplug event if they changed. +* +* The default value of 1500ms was chosen based on experimental testing with +* various monitors that exhibit spontaneous HPD toggling behavior. +*/ +static void hdmi_hpd_debounce_work (struct work_struct *work) +{ +struct amdgpu_dm_connector *aconnector = + container_of(to_delayed_work(work), struct amdgpu_dm_connector, + hdmi_hpd_debounce_work); +struct drm_connector *connector = &aconnector->base; +struct drm_device *dev = connector->dev; +struct amdgpu_device *adev =drm_to_adev (dev); +struct dc *dc = aconnector->dc_link->ctx->dc; +bool fake_reconnect = false; +bool reallow_idle = false; +bool ret = false; +guard (mutex)(&aconnector->hpd_lock); + +/* Re-detect the display */ + scoped_guard(mutex, &adev->dm.dc_lock) { +if (dc->caps.ips_support && dc->ctx->dmub_srv->idle_allowed) { +dc_allow_idle_optimizations (dc, false); + reallow_idle = true; + } + ret =dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD ); + } + +if (ret) { +/* Apply workaround delay for certain panels */ +apply_delay_after_dpcd_poweroff (adev, aconnector->dc_sink); +/* Compare sinks to determine if this was a spontaneous HPD toggle */ +if (are_sinks_equal (aconnector->dc_link->local_sink, aconnector->hdmi_prev_sink)) { +/* +* Sinks match - this was a spontaneous HDMI HPD toggle. +*/ +drm_dbg_kms (dev,"HDMI HPD: Sink unchanged after debounce, internal re-enable\n" ); + fake_reconnect = true; + } + +/* Update connector state */ +amdgpu_dm_update_connector_after_detect (aconnector); + +drm_modeset_lock_all (dev); +dm_restore_drm_connector_state (dev, connector); +drm_modeset_unlock_all (dev); + +/* Only notify OS if sink actually changed */ +if (!fake_reconnect && aconnector->base.force ==DRM_FORCE_UNSPECIFIED ) +drm_kms_helper_hotplug_event (dev); + } + +/* Release the cached sink reference */ +if (aconnector->hdmi_prev_sink) { +dc_sink_release (aconnector->hdmi_prev_sink); + aconnector->hdmi_prev_sink =NULL ; + } + + scoped_guard(mutex, &adev->dm.dc_lock) { +if (reallow_idle && dc->caps.ips_support) +dc_allow_idle_optimizations (dc, true); + } +} +static void handle_hpd_irq_helper (struct amdgpu_dm_connector *aconnector) {struct drm_connector *connector = &aconnector->base;
@@ -3924,6 +4015,7 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)struct dm_connector_state *dm_con_state =to_dm_connector_state (connector->state);struct dc *dc = aconnector->dc_link->ctx->dc;bool ret = false; +bool debounce_required = false;if (adev->dm.disable_hpd_irq)return ;
@@ -3946,6 +4038,14 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)if (!dc_link_detect_connection_type (aconnector->dc_link, &new_connection_type))drm_err (adev_to_drm (adev),"KMS: Failed to detect connector\n" ); +/* +* Check for HDMI disconnect with debounce enabled. +*/ + debounce_required = (aconnector->hdmi_hpd_debounce_delay_ms >0 && +dc_is_hdmi_signal (aconnector->dc_link->connector_signal) && + new_connection_type == dc_connection_none && + aconnector->dc_link->local_sink !=NULL ); +if (aconnector->base.force && new_connection_type == dc_connection_none) {emulated_link_detect (aconnector->dc_link);
@@ -3955,7 +4055,34 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)if (aconnector->base.force ==DRM_FORCE_UNSPECIFIED )drm_kms_helper_connector_hotplug_event (connector); + }else if (debounce_required) { +/* +* HDMI disconnect detected - schedule delayed work instead of +* processing immediately. This allows us to coalesce spurious +* HDMI signals from physical unplugs. +*/ +drm_dbg_kms (dev,"HDMI HPD: Disconnect detected, scheduling debounce work (%u ms)\n" , + aconnector->hdmi_hpd_debounce_delay_ms); + +/* Cache the current sink for later comparison */ +if (aconnector->hdmi_prev_sink) +dc_sink_release (aconnector->hdmi_prev_sink); + aconnector->hdmi_prev_sink = aconnector->dc_link->local_sink; +if (aconnector->hdmi_prev_sink) +dc_sink_retain (aconnector->hdmi_prev_sink); + +/* Schedule delayed detection. */ +if (mod_delayed_work (system_wq, + &aconnector->hdmi_hpd_debounce_work, +msecs_to_jiffies (aconnector->hdmi_hpd_debounce_delay_ms))) +drm_dbg_kms (dev,"HDMI HPD: Re-scheduled debounce work\n" ); + }else { + +/* If the aconnector->hdmi_hpd_debounce_work is scheduled, exit early */ +if (delayed_work_pending (&aconnector->hdmi_hpd_debounce_work)) +return ; + scoped_guard(mutex, &adev->dm.dc_lock) {dc_exit_ips_for_hw_access (dc); ret =dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD );
@@ -7569,6 +7696,13 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector)if (aconnector->mst_mgr.dev)drm_dp_mst_topology_mgr_destroy (&aconnector->mst_mgr); +/* Cancel and flush any pending HDMI HPD debounce work */ +cancel_delayed_work_sync (&aconnector->hdmi_hpd_debounce_work); +if (aconnector->hdmi_prev_sink) { +dc_sink_release (aconnector->hdmi_prev_sink); + aconnector->hdmi_prev_sink =NULL ; + } +if (aconnector->bl_idx !=-1 ) {backlight_device_unregister (dm->backlight_dev[aconnector->bl_idx]); dm->backlight_dev[aconnector->bl_idx] =NULL ;
@@ -8748,6 +8882,10 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,mutex_init (&aconnector->hpd_lock);mutex_init (&aconnector->handle_mst_msg_ready); + aconnector->hdmi_hpd_debounce_delay_ms =AMDGPU_DM_HDMI_HPD_DEBOUNCE_MS ; +INIT_DELAYED_WORK (&aconnector->hdmi_hpd_debounce_work, hdmi_hpd_debounce_work); + aconnector->hdmi_prev_sink =NULL ; +/* * configure support HPD hot plug connector_>polled default value is 0 * which means HPD hot plug not supported
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +6 -0
@@ -59,6 +59,7 @@#define AMDGPU_HDR_MULT_DEFAULT (0x100000000LL) +#define AMDGPU_DM_HDMI_HPD_DEBOUNCE_MS 1500/* #include "include/amdgpu_dal_power_if.h" #include "amdgpu_dm_irq.h"
@@ -814,6 +815,11 @@ struct amdgpu_dm_connector {bool pack_sdp_v1_3;enum adaptive_sync_type as_type;struct amdgpu_hdmi_vsdb_info vsdb_info; + +/* HDMI HPD debounce support */ +unsigned int hdmi_hpd_debounce_delay_ms; +struct delayed_work hdmi_hpd_debounce_work; +struct dc_sink *hdmi_prev_sink; }; static inline void amdgpu_dm_set_mst_status(uint8_t *status,
Signature · 1 line
2.43.0
PATCH 10/16 drm/amd/display: Add pipe topology history to dc
In reply to [email protected]From: Nicholas Carbones <[email protected]>
[Why]
There is no way to check pipe topology update history through a dump.
[How]
Add a topology history structure to dc with snapshots of the most recent pipe topology updates.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 76 +++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 26 +++++++ 3 files changed, 97 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +70 -6
@@ -99,6 +99,40 @@#define UNABLE_TO_SPLIT -1 +static void capture_pipe_topology_data (struct dc *dc,int plane_idx,int slice_idx,int stream_idx, +int dpp_inst,int opp_inst,int tg_inst,bool is_phantom_pipe) +{ +struct pipe_topology_snapshot *current_snapshot = &dc->debug_data.topology_history.snapshots[dc->debug_data.topology_history.current_snapshot_index]; + +if (current_snapshot->line_count >=MAX_PIPES ) +return ; + + current_snapshot->pipe_log_lines[current_snapshot->line_count].is_phantom_pipe = is_phantom_pipe; + current_snapshot->pipe_log_lines[current_snapshot->line_count].plane_idx = plane_idx; + current_snapshot->pipe_log_lines[current_snapshot->line_count].slice_idx = slice_idx; + current_snapshot->pipe_log_lines[current_snapshot->line_count].stream_idx = stream_idx; + current_snapshot->pipe_log_lines[current_snapshot->line_count].dpp_inst = dpp_inst; + current_snapshot->pipe_log_lines[current_snapshot->line_count].opp_inst = opp_inst; + current_snapshot->pipe_log_lines[current_snapshot->line_count].tg_inst = tg_inst; + + current_snapshot->line_count++; +} + +static void start_new_topology_snapshot (struct dc *dc,struct dc_state *state) +{ +// Move to next snapshot slot (circular buffer) + dc->debug_data.topology_history.current_snapshot_index = (dc->debug_data.topology_history.current_snapshot_index +1 ) %MAX_TOPOLOGY_SNAPSHOTS ; + +// Clear the new snapshot +struct pipe_topology_snapshot *current_snapshot = &dc->debug_data.topology_history.snapshots[dc->debug_data.topology_history.current_snapshot_index]; +memset (current_snapshot,0 ,sizeof (*current_snapshot)); + +// Set metadata + current_snapshot->timestamp_us =dm_get_timestamp (dc->ctx); + current_snapshot->stream_count = state->stream_count; + current_snapshot->phantom_stream_count = state->phantom_stream_count; +} +enum dce_version resource_parse_asic_id (struct hw_asic_id asic_id) {enum dce_version dc_version =DCE_VERSION_UNKNOWN ;
@@ -2311,10 +2345,11 @@ bool resource_is_odm_topology_changed(const struct pipe_ctx *otg_master_a,static void resource_log_pipe (struct dc *dc,struct pipe_ctx *pipe,int stream_idx,int slice_idx,int plane_idx,int slice_count, -bool is_primary) +bool is_primary,bool is_phantom_pipe) {DC_LOGGER_INIT (dc->ctx->logger); +// new format for logging: bit storing code if (slice_idx ==0 && plane_idx ==0 && is_primary) {/* case 0 (OTG master pipe with plane) */ DC_LOG_DC(" | plane%d slice%d stream%d|",
@@ -2323,6 +2358,10 @@ static void resource_log_pipe(struct dc *dc, struct pipe_ctx *pipe, pipe->plane_res.dpp->inst, pipe->stream_res.opp->inst, pipe->stream_res.tg->inst); +capture_pipe_topology_data (dc, plane_idx, slice_idx, stream_idx, + pipe->plane_res.dpp->inst, + pipe->stream_res.opp->inst, + pipe->stream_res.tg->inst, is_phantom_pipe); }else if (slice_idx ==0 && plane_idx ==-1 ) {/* case 1 (OTG master pipe without plane) */ DC_LOG_DC(" | slice%d stream%d|",
@@ -2331,6 +2370,10 @@ static void resource_log_pipe(struct dc *dc, struct pipe_ctx *pipe, pipe->stream_res.opp->inst, pipe->stream_res.opp->inst, pipe->stream_res.tg->inst); +capture_pipe_topology_data (dc,0xF , slice_idx, stream_idx, + pipe->plane_res.dpp->inst, + pipe->stream_res.opp->inst, + pipe->stream_res.tg->inst, is_phantom_pipe); }else if (slice_idx !=0 && plane_idx ==0 && is_primary) {/* case 2 (OPP head pipe with plane) */ DC_LOG_DC(" | plane%d slice%d | |",
@@ -2338,27 +2381,43 @@ static void resource_log_pipe(struct dc *dc, struct pipe_ctx *pipe,DC_LOG_DC (" |DPP%d----OPP%d----| |" , pipe->plane_res.dpp->inst, pipe->stream_res.opp->inst); +capture_pipe_topology_data (dc, plane_idx, slice_idx, stream_idx, + pipe->plane_res.dpp->inst, + pipe->stream_res.opp->inst, + pipe->stream_res.tg->inst, is_phantom_pipe); }else if (slice_idx !=0 && plane_idx ==-1 ) {/* case 3 (OPP head pipe without plane) */ DC_LOG_DC (" | slice%d | |" , slice_idx);DC_LOG_DC (" |DPG%d----OPP%d----| |" , pipe->plane_res.dpp->inst, pipe->stream_res.opp->inst); +capture_pipe_topology_data (dc,0xF , slice_idx, stream_idx, + pipe->plane_res.dpp->inst, + pipe->stream_res.opp->inst, + pipe->stream_res.tg->inst, is_phantom_pipe); }else if (slice_idx == slice_count -1 ) {/* case 4 (DPP pipe in last slice) */ DC_LOG_DC (" | plane%d | |" , plane_idx);DC_LOG_DC (" |DPP%d----| |" , pipe->plane_res.dpp->inst); +capture_pipe_topology_data (dc, plane_idx, slice_idx, stream_idx, + pipe->plane_res.dpp->inst, + pipe->stream_res.opp->inst, + pipe->stream_res.tg->inst, is_phantom_pipe); }else {/* case 5 (DPP pipe not in last slice) */ DC_LOG_DC (" | plane%d | | |" , plane_idx);DC_LOG_DC (" |DPP%d----| | |" , pipe->plane_res.dpp->inst); +capture_pipe_topology_data (dc, plane_idx, slice_idx, stream_idx, + pipe->plane_res.dpp->inst, + pipe->stream_res.opp->inst, + pipe->stream_res.tg->inst, is_phantom_pipe); } }static void resource_log_pipe_for_stream (struct dc *dc,struct dc_state *state, -struct pipe_ctx *otg_master,int stream_idx) +struct pipe_ctx *otg_master,int stream_idx,bool is_phantom_pipe) {struct pipe_ctx *opp_heads[MAX_PIPES ];struct pipe_ctx *dpp_pipes[MAX_PIPES ];
@@ -2384,12 +2443,12 @@ static void resource_log_pipe_for_stream(struct dc *dc, struct dc_state *state,resource_log_pipe (dc, dpp_pipes[dpp_idx], stream_idx, slice_idx, plane_idx, slice_count, - is_primary); + is_primary, is_phantom_pipe); } }else {resource_log_pipe (dc, opp_heads[slice_idx], stream_idx, slice_idx, plane_idx, - slice_count, true); + slice_count, true, is_phantom_pipe); } }
@@ -2420,6 +2479,10 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state)struct pipe_ctx *otg_master;int stream_idx, phantom_stream_idx;DC_LOGGER_INIT (dc->ctx->logger); +bool is_phantom_pipe = false; + +// Start a new snapshot for this topology update +start_new_topology_snapshot (dc, state);DC_LOG_DC (" pipe topology update" );DC_LOG_DC (" ________________________" );
@@ -2433,9 +2496,10 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state)if (!otg_master)continue ; -resource_log_pipe_for_stream (dc, state, otg_master, stream_idx); +resource_log_pipe_for_stream (dc, state, otg_master, stream_idx, is_phantom_pipe); }if (state->phantom_stream_count >0 ) { + is_phantom_pipe = true;DC_LOG_DC (" | (phantom pipes) |" );for (stream_idx =0 ; stream_idx < state->stream_count; stream_idx++) {if (state->stream_status[stream_idx].mall_stream_config.type !=SUBVP_MAIN )
@@ -2448,7 +2512,7 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state)if (!otg_master)continue ; -resource_log_pipe_for_stream (dc, state, otg_master, stream_idx); +resource_log_pipe_for_stream (dc, state, otg_master, stream_idx, is_phantom_pipe); } }DC_LOG_DC (" |________________________|\n" );
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -899,6 +899,7 @@ struct dc_debug_data {uint32_t ltFailCount;uint32_t i2cErrorCount;uint32_t auxErrorCount; +struct pipe_topology_history topology_history; };struct dc_phy_addr_space_config {
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +26 -0
@@ -80,6 +80,32 @@#define MAX_HPO_DP2_ENCODERS 4#define MAX_HPO_DP2_LINK_ENCODERS 4 +/* Pipe topology snapshot structures */ +#define MAX_TOPOLOGY_SNAPSHOTS 4 + +struct pipe_topology_line { +bool is_phantom_pipe; +int plane_idx; +int slice_idx; +int stream_idx; +int dpp_inst; +int opp_inst; +int tg_inst; +}; + +struct pipe_topology_snapshot { +struct pipe_topology_line pipe_log_lines[MAX_PIPES ]; +int line_count; +uint64_t timestamp_us; +int stream_count; +int phantom_stream_count; +}; + +struct pipe_topology_history { +struct pipe_topology_snapshot snapshots[MAX_TOPOLOGY_SNAPSHOTS ]; +int current_snapshot_index; +}; +struct gamma_curve {uint32_t offset;uint32_t segments_num;
Signature · 1 line
2.43.0
PATCH 11/16 drm/amd/display: Clear the CUR_ENABLE register on DCN20 on DPP5
In reply to [email protected]From: Ivan Lipski <[email protected]>
[Why]
On DCN20 & DCN30, the 6th DPP's & HUBP's are powered on permanently and cannot be power gated. Thus, when dpp_reset() is invoked for the DPP5, while it's still powered on, the cached cursor_state (dpp_base->pos.cur0_ctl.bits.cur0_enable)
and the actual state (CUR0_ENABLE) bit are unsycned. This can cause a double cursor in full screen with non-native scaling.
[How]
Force disable cursor on DPP5 on plane powerdown for ASICs w/ 6 DPPs/HUBPs.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +8 -0
@@ -614,6 +614,14 @@ void dcn20_dpp_pg_control(* DOMAIN11_PGFSM_PWR_STATUS, pwr_status, * 1, 1000); */ + +/* Force disable cursor on plane powerdown on DPP 5 using dpp_force_disable_cursor */ +if (!power_on) { +struct dpp *dpp5 = hws->ctx->dc->res_pool->dpps[dpp_inst]; +if (dpp5 && dpp5->funcs->dpp_force_disable_cursor) + dpp5->funcs->dpp_force_disable_cursor (dpp5); + } +break ;default :BREAK_TO_DEBUGGER ();
Signature · 1 line
2.43.0
PATCH 12/16 drm/amd/display: Add null pointer check in link_dpms
In reply to [email protected]From: Charlene Liu <[email protected]>
[why]
Check that the stream exists to add link->local_sink null pointer access protection.
--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +5 -1
@@ -2226,7 +2226,11 @@ static enum dc_status enable_link( {enum dc_status status =DC_ERROR_UNEXPECTED ;struct dc_stream_state *stream = pipe_ctx->stream; -struct dc_link *link = stream->link; +struct dc_link *link =NULL ; + +if (stream ==NULL ) +return DC_ERROR_UNEXPECTED ; + link = stream->link;/* There's some scenarios where driver is unloaded with display * still enabled. When driver is reloaded, it may cause a display
Signature · 1 line
2.43.0
PATCH 13/16 drm/amd/display: Check DCCG_AUDIO_DTO2 register mask exist
In reply to [email protected]From: Charlene Liu <[email protected]>
[Why&How]
Check DCCG_AUDIO_DTO2 register mask exist before access. Also, add a existing DIO_CLOCK_control register for later use.
--- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 3 ++- .../gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +2 -1
@@ -1143,7 +1143,8 @@ void dce_aud_wall_dto_setup(REG_UPDATE (DCCG_AUDIO_DTO1_PHASE ,DCCG_AUDIO_DTO1_PHASE , clock_info.audio_dto_phase); -REG_UPDATE (DCCG_AUDIO_DTO_SOURCE , +if (aud->masks->DCCG_AUDIO_DTO2_USE_512FBR_DTO) +REG_UPDATE (DCCG_AUDIO_DTO_SOURCE ,DCCG_AUDIO_DTO2_USE_512FBR_DTO ,1 ); }
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.h +2 -1
@@ -227,7 +227,8 @@ void dcn401_prepare_mcache_programming(struct dc *dc, struct dc_state *context);#define LE_DCN401_REG_LIST_RI (id) \ LE_DCN3_REG_LIST_RI(id), \ SRI_ARR(DP_DPHY_INTERNAL_CTRL, DP, id), \ - SRI_ARR(DIG_BE_CLK_CNTL, DIG, id) + SRI_ARR(DIG_BE_CLK_CNTL, DIG, id),\ + SR_ARR(DIO_CLK_CNTL, id)/* DPP */ #define DPP_REG_LIST_DCN401_COMMON_RI (id) \
Signature · 1 line
2.43.0
PATCH 14/16 drm/amd/display: Fix pbn to kbps Conversion
In reply to [email protected]From: Fangzhi Zuo <[email protected]>
[Why]
Existing routine has two conversion sequence, pbn_to_kbps and kbps_to_pbn with margin.
Non of those has without-margin calculation.
kbps_to_pbn with margin conversion includes fec overhead which has already been included in pbn_div calculation with 0.994 factor considered. It is a double counted fec overhead factor that causes potential bw loss.
[How]
Add without-margin calculation.
Fix fec overhead double counted issue.
Fixes for:
https://gitlab.freedesktop.org/drm/amd/-/issues/3735
--- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 59 ++++++++----------- 1 file changed, 23 insertions(+), 36 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +23 -36
@@ -884,26 +884,28 @@ struct dsc_mst_fairness_params { };#if defined(CONFIG_DRM_AMD_DC_FP ) -static uint16_t get_fec_overhead_multiplier (struct dc_link *dc_link) +static uint64_t kbps_to_pbn (int kbps,bool is_peak_pbn) { -u8 link_coding_cap; -uint16_t fec_overhead_multiplier_x1000 =PBN_FEC_OVERHEAD_MULTIPLIER_8B_10B ; +uint64_t effective_kbps = (uint64_t )kbps; - link_coding_cap =dc_link_dp_mst_decide_link_encoding_format (dc_link); -if (link_coding_cap == DP_128b_132b_ENCODING) - fec_overhead_multiplier_x1000 =PBN_FEC_OVERHEAD_MULTIPLIER_128B_132B ; +if (is_peak_pbn) {// add 0.6% (1006/1000) overhead into effective kbps + effective_kbps *=1006 ; + effective_kbps =div_u64 (effective_kbps,1000 ); + } -return fec_overhead_multiplier_x1000; +return (uint64_t )DIV64_U64_ROUND_UP (effective_kbps *64 , (54 *8 *1000 )); } -static int kbps_to_peak_pbn (int kbps,uint16_t fec_overhead_multiplier_x1000) +static uint32_t pbn_to_kbps (unsigned int pbn,bool with_margin) { -u64 peak_kbps = kbps; +uint64_t pbn_effective = (uint64_t )pbn; + +if (with_margin)// deduct 0.6% (994/1000) overhead from effective pbn + pbn_effective *= (1000000 /PEAK_FACTOR_X1000 ); +else + pbn_effective *=1000 ; - peak_kbps *=1006 ; - peak_kbps *= fec_overhead_multiplier_x1000; - peak_kbps =div_u64 (peak_kbps,1000 *1000 ); -return (int )DIV64_U64_ROUND_UP (peak_kbps *64 , (54 *8 *1000 )); +return DIV_U64_ROUND_UP (pbn_effective *8 *54 ,64 ); } static void set_dsc_configs_from_fairness_vars(struct dsc_mst_fairness_params *params,
@@ -974,7 +976,7 @@ static int bpp_x16_from_pbn(struct dsc_mst_fairness_params param, int pbn)dc_dsc_get_default_config_option (param.sink->ctx->dc, &dsc_options); dsc_options.max_target_bpp_limit_override_x16 = drm_connector->display_info.max_dsc_bpp *16 ; - kbps =div_u64 ((u64 )pbn *994 *8 *54 ,64 ); + kbps =pbn_to_kbps (pbn, false); dc_dsc_compute_config( param.sink->ctx->dc->res_pool->dscs[0], ¶m.sink->dsc_caps.dsc_dec_caps,
@@ -1003,12 +1005,11 @@ static int increase_dsc_bpp(struct drm_atomic_state *state,int link_timeslots_used;int fair_pbn_alloc;int ret =0 ; -uint16_t fec_overhead_multiplier_x1000 =get_fec_overhead_multiplier (dc_link);for (i =0 ; i < count; i++) {if (vars[i + k].dsc_enabled) { initial_slack[i] = -kbps_to_peak_pbn (params[i].bw_range.max_kbps, fec_overhead_multiplier_x1000) - vars[i + k].pbn; +kbps_to_pbn (params[i].bw_range.max_kbps, false) - vars[i + k].pbn; bpp_increased[i] = false; remaining_to_increase +=1 ; }else {
@@ -1104,7 +1105,6 @@ static int try_disable_dsc(struct drm_atomic_state *state,int next_index;int remaining_to_try =0 ;int ret; -uint16_t fec_overhead_multiplier_x1000 =get_fec_overhead_multiplier (dc_link);int var_pbn;for (i =0 ; i < count; i++) {
@@ -1137,7 +1137,7 @@ static int try_disable_dsc(struct drm_atomic_state *state,DRM_DEBUG_DRIVER ("MST_DSC index #%d, try no compression\n" , next_index); var_pbn = vars[next_index].pbn; - vars[next_index].pbn =kbps_to_peak_pbn (params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000); + vars[next_index].pbn =kbps_to_pbn (params[next_index].bw_range.stream_kbps, true); ret = drm_dp_atomic_find_time_slots(state, params[next_index].port->mgr, params[next_index].port,
@@ -1197,7 +1197,6 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,int count =0 ;int i, k, ret;bool debugfs_overwrite = false; -uint16_t fec_overhead_multiplier_x1000 =get_fec_overhead_multiplier (dc_link);struct drm_connector_state *new_conn_state;memset (params,0 ,sizeof (params));
@@ -1278,7 +1277,7 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,DRM_DEBUG_DRIVER ("MST_DSC Try no compression\n" );for (i =0 ; i < count; i++) { vars[i + k].aconnector = params[i].aconnector; - vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); + vars[i + k].pbn =kbps_to_pbn (params[i].bw_range.stream_kbps, false); vars[i + k].dsc_enabled = false; vars[i + k].bpp_x16 =0 ; ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, params[i].port,
@@ -1300,7 +1299,7 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,DRM_DEBUG_DRIVER ("MST_DSC Try max compression\n" );for (i =0 ; i < count; i++) {if (params[i].compression_possible && params[i].clock_force_enable !=DSC_CLK_FORCE_DISABLE ) { - vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.min_kbps, fec_overhead_multiplier_x1000); + vars[i + k].pbn =kbps_to_pbn (params[i].bw_range.min_kbps, false); vars[i + k].dsc_enabled = true; vars[i + k].bpp_x16 = params[i].bw_range.min_target_bpp_x16; ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
@@ -1308,7 +1307,7 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,if (ret <0 )return ret; }else { - vars[i + k].pbn =kbps_to_peak_pbn (params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); + vars[i + k].pbn =kbps_to_pbn (params[i].bw_range.stream_kbps, false); vars[i + k].dsc_enabled = false; vars[i + k].bpp_x16 =0 ; ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
@@ -1763,18 +1762,6 @@ int pre_validate_dsc(struct drm_atomic_state *state,return ret; } -static uint32_t kbps_from_pbn (unsigned int pbn) -{ -uint64_t kbps = (uint64_t )pbn; - - kbps *= (1000000 /PEAK_FACTOR_X1000 ); - kbps *=8 ; - kbps *=54 ; - kbps /=64 ; - -return (uint32_t )kbps; -} -static bool is_dsc_common_config_possible (struct dc_stream_state *stream,struct dc_dsc_bw_range *bw_range) {
@@ -1873,7 +1860,7 @@ enum dc_status dm_dp_mst_is_port_support_mode( dc_link_get_highest_encoding_format(stream->link)); cur_link_settings = stream->link->verified_link_cap; root_link_bw_in_kbps =dc_link_bandwidth_kbps (aconnector->dc_link, &cur_link_settings); - virtual_channel_bw_in_kbps =kbps_from_pbn (aconnector->mst_output_port->full_pbn); + virtual_channel_bw_in_kbps =pbn_to_kbps (aconnector->mst_output_port->full_pbn, true);/* pick the end to end bw bottleneck */ end_to_end_bw_in_kbps =min (root_link_bw_in_kbps, virtual_channel_bw_in_kbps);
@@ -1926,7 +1913,7 @@ enum dc_status dm_dp_mst_is_port_support_mode( immediate_upstream_port = aconnector->mst_output_port->parent->port_parent;if (immediate_upstream_port) { - virtual_channel_bw_in_kbps =kbps_from_pbn (immediate_upstream_port->full_pbn); + virtual_channel_bw_in_kbps =pbn_to_kbps (immediate_upstream_port->full_pbn, true); virtual_channel_bw_in_kbps =min (root_link_bw_in_kbps, virtual_channel_bw_in_kbps); }else {/* For topology LCT 1 case - only one mstb*/
Signature · 1 line
2.43.0
PATCH 15/16 drm/amd/display: Ignore Coverity false positive
In reply to [email protected]From: Taimur Hassan <[email protected]>
[Why&How]
Ignore Coverity false positive analysis in the dmub_cmd.h
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +1 -0
@@ -2647,6 +2647,7 @@ struct dmub_cmd_fams2_global_config {union dmub_cmd_fams2_config {struct dmub_cmd_fams2_global_config global; +// coverity[cert_dcl37_c_violation:FALSE] errno.h, stddef.h, stdint.h not included in atombios.h struct dmub_fams2_stream_static_state stream;//v0 union {struct dmub_fams2_cmd_stream_static_base_state base;
Signature · 1 line
2.43.0
Re: [PATCH 15/16] drm/amd/display: Ignore Coverity false positive
Quoted 17 lines · On 11/12/25 19:20, [email protected] wrote:
From: Taimur Hassan <[email protected]>
[Why&How]
Ignore Coverity false positive analysis in thedmub_cmd.hReviewed-by Leo Li <[email protected]>Signed-off-by Taimur Hassan <[email protected]>Signed-off-by Ivan Lipski <[email protected]>--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +0
-0
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h struct dmub_cmd_fams2_global_config { · line 2650
Quoted 4 lines
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +1
-0@@ -2647,6 +2647,7 @@ struct dmub_cmd_fams2_global_config {union dmub_cmd_fams2_config {struct dmub_cmd_fams2_global_config global; +// coverity[cert_dcl37_c_violation:FALSE] errno.h, stddef.h, stdint.h not included in atombios.h
Absolutely clear NAK to that. Please see the kernel coding style rules.
In general I don't think we should clutter the source code with such stuff.
Regards,
Christian
Quoted 3 lines
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +0
-0struct dmub_fams2_stream_static_state stream;//v0 union {struct dmub_fams2_cmd_stream_static_base_state base;
PATCH 16/16 drm/amd/display: Promote DC to 3.2.359
In reply to [email protected]From: Taimur Hassan <[email protected]>
This version brings along the following updates:
- Add interface to capture expected HW state from SW state
- Add panel Replay capability detection, DPCD reading, and enablement logic
- Re-check seamless boot enablement on subsequent dc_commit_streams
- Improve DPCD link capability retrieval with increased retries and per-retry delays
- Add HPD filter for HDMI
- Add pipe topology history tracking to DC
- Fix MST initialization on resume when switching from SST to MST during suspend
- Fix double cursor on DCN20 & DCN30 in non-native scaling
- Check DCCG_AUDIO_DTO2 register mask before access
- Fix pbs to kbps conversion
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -63,7 +63,7 @@ struct dcn_dsc_reg_state;struct dcn_optc_reg_state ;struct dcn_dccg_reg_state ; -#define DC_VER "3.2.358" +#define DC_VER "3.2.359"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.43.0