Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Restructure dpia link training

[WHY]
We intend to consolidate dp tunneling and conventional dp link training.

[HOW]
1. Use the same link training entry for both dp and dpia
2. Move SET_CONFIG of non-transparent mode to dmub side
3. Add set_tps_notification dmub_cmd to notify tps request for
non-transparent dpia link training
4. Check dpcd request result and abort link training early if dpia
aux tunneling fails
5. Add option to avoid affect old product
6. Separately handle wait_time_microsec for dpia

Reviewed-by: Cruise Hung <cruise.hung@amd.com>
Reviewed-by: George Shen <george.shen@amd.com>
Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: Peichen Huang <PeiChen.Huang@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Peichen Huang and committed by
Alex Deucher
cf4cebce ae510080

+233 -52
+21
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 5756 5756 } 5757 5757 5758 5758 /** 5759 + * dc_process_dmub_dpia_set_tps_notification - Submits tps notification 5760 + * 5761 + * @dc: [in] dc structure 5762 + * @link_index: [in] link index 5763 + * @ts: [in] request tps 5764 + * 5765 + * Submits set_tps_notification command to dmub via inbox message 5766 + */ 5767 + void dc_process_dmub_dpia_set_tps_notification(const struct dc *dc, uint32_t link_index, uint8_t tps) 5768 + { 5769 + union dmub_rb_cmd cmd = {0}; 5770 + 5771 + cmd.set_tps_notification.header.type = DMUB_CMD__DPIA; 5772 + cmd.set_tps_notification.header.sub_type = DMUB_CMD__DPIA_SET_TPS_NOTIFICATION; 5773 + cmd.set_tps_notification.tps_notification.instance = dc->links[link_index]->ddc_hw_inst; 5774 + cmd.set_tps_notification.tps_notification.tps = tps; 5775 + 5776 + dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_WAIT); 5777 + } 5778 + 5779 + /** 5759 5780 * dc_process_dmub_dpia_hpd_int_enable - Submits DPIA DPD interruption 5760 5781 * 5761 5782 * @dc: [in] dc structure
+5 -1
drivers/gpu/drm/amd/display/dc/dc.h
··· 462 462 bool support_edp0_on_dp1; 463 463 unsigned int enable_fpo_flicker_detection; 464 464 bool disable_hbr_audio_dp2; 465 + bool consolidated_dpia_dp_lt; 465 466 }; 466 467 467 468 enum visual_confirm { ··· 763 762 uint32_t disable_mst_dsc_work_around:1; /* bit 3 */ 764 763 uint32_t enable_force_tbt3_work_around:1; /* bit 4 */ 765 764 uint32_t disable_usb4_pm_support:1; /* bit 5 */ 766 - uint32_t reserved:26; 765 + uint32_t enable_consolidated_dpia_dp_lt:1; /* bit 6 */ 766 + uint32_t reserved:25; 767 767 } bits; 768 768 uint32_t raw; 769 769 }; ··· 2526 2524 uint32_t link_index, 2527 2525 uint8_t mst_alloc_slots, 2528 2526 uint8_t *mst_slots_in_use); 2527 + 2528 + void dc_process_dmub_dpia_set_tps_notification(const struct dc *dc, uint32_t link_index, uint8_t tps); 2529 2529 2530 2530 void dc_process_dmub_dpia_hpd_int_enable(const struct dc *dc, 2531 2531 uint32_t hpd_int_enable);
+1
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
··· 300 300 enum dmub_ips_disable_type disable_ips; 301 301 bool disallow_phy_access; 302 302 bool disable_sldo_opt; 303 + bool enable_non_transparent_setconfig; 303 304 }; 304 305 305 306 /**
+24 -1
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
··· 682 682 uint32_t gpint_scratch8: 1; /* 1 if GPINT is in scratch8*/ 683 683 uint32_t usb4_cm_version: 1; /**< 1 CM support */ 684 684 uint32_t dpia_hpd_int_enable_supported: 1; /* 1 if dpia hpd int enable supported */ 685 - uint32_t reserved0: 1; 685 + uint32_t enable_non_transparent_setconfig: 1; /* 1 if dpia use conventional dp lt flow*/ 686 686 uint32_t disable_clk_ds: 1; /* 1 if disallow dispclk_ds and dppclk_ds*/ 687 687 uint32_t disable_timeout_recovery : 1; /* 1 if timeout recovery should be disabled */ 688 688 uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/ ··· 1308 1308 DMUB_CMD__DPIA_DIG1_DPIA_CONTROL = 0, 1309 1309 DMUB_CMD__DPIA_SET_CONFIG_ACCESS = 1, 1310 1310 DMUB_CMD__DPIA_MST_ALLOC_SLOTS = 2, 1311 + DMUB_CMD__DPIA_SET_TPS_NOTIFICATION = 3, 1311 1312 }; 1312 1313 1313 1314 /* DMUB_OUT_CMD__DPIA_NOTIFICATION command types. */ ··· 2137 2136 struct dmub_rb_cmd_set_mst_alloc_slots { 2138 2137 struct dmub_cmd_header header; /* header */ 2139 2138 struct dmub_cmd_mst_alloc_slots_control_data mst_slots_control; /* mst slots control */ 2139 + }; 2140 + 2141 + /** 2142 + * Data passed from driver to FW in a DMUB_CMD__SET_TPS_NOTIFICATION command. 2143 + */ 2144 + struct dmub_cmd_tps_notification_data { 2145 + uint8_t instance; /* DPIA instance */ 2146 + uint8_t tps; /* requested training pattern */ 2147 + uint8_t reserved1; 2148 + uint8_t reserved2; 2149 + }; 2150 + 2151 + /** 2152 + * DMUB command structure for SET_TPS_NOTIFICATION command. 2153 + */ 2154 + struct dmub_rb_cmd_set_tps_notification { 2155 + struct dmub_cmd_header header; /* header */ 2156 + struct dmub_cmd_tps_notification_data tps_notification; /* set tps_notification data */ 2140 2157 }; 2141 2158 2142 2159 /** ··· 5323 5304 * Definition of a DMUB_CMD__DPIA_MST_ALLOC_SLOTS command. 5324 5305 */ 5325 5306 struct dmub_rb_cmd_set_mst_alloc_slots set_mst_alloc_slots; 5307 + /** 5308 + * Definition of a DMUB_CMD__DPIA_SET_TPS_NOTIFICATION command. 5309 + */ 5310 + struct dmub_rb_cmd_set_tps_notification set_tps_notification; 5326 5311 /** 5327 5312 * Definition of a DMUB_CMD__EDID_CEA command. 5328 5313 */
+1
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c
··· 425 425 boot_options.bits.ips_disable = params->disable_ips; 426 426 boot_options.bits.ips_sequential_ono = params->ips_sequential_ono; 427 427 boot_options.bits.disable_sldo_opt = params->disable_sldo_opt; 428 + boot_options.bits.enable_non_transparent_setconfig = params->enable_non_transparent_setconfig; 428 429 429 430 REG_WRITE(DMCUB_SCRATCH14, boot_options.all); 430 431 }