]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: create accessories, hwss and protocols sub folders in link
authorWenjing Liu <wenjing.liu@amd.com>
Fri, 16 Dec 2022 22:16:19 +0000 (17:16 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Jan 2023 18:26:25 +0000 (13:26 -0500)
[why]
link component contains three sub folders:

accessories - utilities for improving testability, logging or tracing, doesn't impact
end user use cases.

protocols - specs defined protocols used in end user use cases

hwss - hwss owned link_hwss object, served as an abstraction layer in hwss to
access various types of encoder/phy/dpia endpoints in a unified interface.

sooner we will have files directly under link folder one for the implementation of
each major link behavior such as link_create, link_detect, link_validate
and link_set_dpms.

Reviewed-by: George Shen <George.Shen@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
45 files changed:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dc_link.h
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h
drivers/gpu/drm/amd/display/dc/inc/link.h
drivers/gpu/drm/amd/display/dc/link/Makefile
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_trace.c with 95% similarity]
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_trace.h with 91% similarity]
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c [moved from drivers/gpu/drm/amd/display/dc/link/link_hwss_dio.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h [moved from drivers/gpu/drm/amd/display/dc/link/link_hwss_dio.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dpia.c [moved from drivers/gpu/drm/amd/display/dc/link/link_hwss_dpia.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dpia.h [moved from drivers/gpu/drm/amd/display/dc/link/link_hwss_dpia.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c [moved from drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.h [moved from drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_frl.h [deleted file]
drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c [moved from drivers/gpu/drm/amd/display/dc/link/link_ddc.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.h [moved from drivers/gpu/drm/amd/display/dc/link/link_ddc.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_capability.c with 99% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_capability.h with 85% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_dpia.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_dpia.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_dpia_bw.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_dpia_bw.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_phy.c with 99% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_phy.h with 93% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training.c with 99% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_128b_132b.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_128b_132b.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_128b_132b.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_128b_132b.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_8b_10b.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_8b_10b.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_8b_10b.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_8b_10b.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_auxless.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_auxless.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_auxless.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_auxless.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_dpia.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_dpia.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_fixed_vs_pe_retimer.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dp_training_fixed_vs_pe_retimer.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c [moved from drivers/gpu/drm/amd/display/dc/link/link_dpcd.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.h [moved from drivers/gpu/drm/amd/display/dc/link/link_dpcd.h with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c [moved from drivers/gpu/drm/amd/display/dc/link/link_hpd.c with 100% similarity]
drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.h [moved from drivers/gpu/drm/amd/display/dc/link/link_hpd.h with 100% similarity]

index 4c0d3ab37906c245d38588c57d7273251470cf72..2e7ae42388484b0f291c7bed59e97be393b69ca3 100644 (file)
@@ -40,7 +40,7 @@
 #include "dc/dc_stat.h"
 #include "amdgpu_dm_trace.h"
 #include "dpcd_defs.h"
-#include "link/link_dpcd.h"
+#include "link/protocols/link_dpcd.h"
 #include "link_service_types.h"
 
 #include "vid.h"
index bf5a31e2be8a290a82f592ad59571ed3cefd5c59..94dc53d592f0d3ef5134e65fe636c21820d9f22e 100644 (file)
@@ -33,8 +33,8 @@
 #include "gpio_service_interface.h"
 #include "core_status.h"
 #include "dc_link_dp.h"
-#include "link/link_dp_dpia.h"
-#include "link/link_ddc.h"
+#include "link/protocols/link_dp_dpia.h"
+#include "link/protocols/link_ddc.h"
 #include "link_hwss.h"
 #include "link.h"
 #include "opp.h"
 #include "dmub/dmub_srv.h"
 #include "inc/hw/panel_cntl.h"
 #include "inc/link_enc_cfg.h"
-#include "link/link_dpcd.h"
-#include "link/link_dp_trace.h"
-#include "link/link_hpd.h"
-#include "link/link_dp_training.h"
-#include "link/link_dp_phy.h"
-#include "link/link_dp_capability.h"
+#include "link/protocols/link_dpcd.h"
+#include "link/accessories/link_dp_trace.h"
+#include "link/protocols/link_hpd.h"
+#include "link/protocols/link_dp_training.h"
+#include "link/protocols/link_dp_phy.h"
+#include "link/protocols/link_dp_capability.h"
 
 #include "dc/dcn30/dcn30_vpg.h"
 
@@ -4567,7 +4567,7 @@ void dc_link_set_drive_settings(struct dc *dc,
                ASSERT_CRITICAL(false);
 
        dc_link_get_cur_link_res(link, &link_res);
-       dc_link_dp_set_drive_settings(dc->links[i], &link_res, lt_settings);
+       dp_set_drive_settings(dc->links[i], &link_res, lt_settings);
 }
 
 void dc_link_set_preferred_link_settings(struct dc *dc,
index ab09df7f6d107fe0108803343b080cd32c2968d5..8f7505bbe8983b72979debc077f96b2e751a7f97 100644 (file)
 
 #include "inc/core_types.h"
 #include "link_hwss.h"
-#include "link/link_ddc.h"
+#include "link/protocols/link_ddc.h"
 #include "core_status.h"
 #include "dpcd_defs.h"
 
 #include "dc_dmub_srv.h"
 #include "dce/dmub_hw_lock_mgr.h"
-#include "link/link_dp_dpia.h"
+#include "link/protocols/link_dp_dpia.h"
 #include "inc/link_enc_cfg.h"
 #include "clk_mgr.h"
-#include "link/link_dp_trace.h"
-#include "link/link_dp_training.h"
-#include "link/link_dp_training_fixed_vs_pe_retimer.h"
-#include "link/link_dp_training_dpia.h"
-#include "link/link_dp_training_auxless.h"
-#include "link/link_dp_phy.h"
-#include "link/link_dp_capability.h"
+#include "link/accessories/link_dp_trace.h"
+#include "link/protocols/link_dp_training.h"
+#include "link/protocols/link_dp_training_fixed_vs_pe_retimer.h"
+#include "link/protocols/link_dp_training_dpia.h"
+#include "link/protocols/link_dp_training_auxless.h"
+#include "link/protocols/link_dp_phy.h"
+#include "link/protocols/link_dp_capability.h"
 #define DC_LOGGER \
        link->ctx->logger
 
 #define DC_TRACE_LEVEL_MESSAGE(...) /* do nothing */
-#include "link/link_dpcd.h"
+#include "link/protocols/link_dpcd.h"
 
 static uint8_t get_nibble_at_index(const uint8_t *buf,
        uint32_t index)
index a5b5f8592c1b80b8d0ce1ef44b016954d0e1a892..2a46f2869b54a74f7ae0b2bd4decfd63c6c1d420 100644 (file)
@@ -43,9 +43,9 @@
 #include "dc_link_dp.h"
 #include "link.h"
 #include "virtual/virtual_link_hwss.h"
-#include "link/link_hwss_dio.h"
-#include "link/link_hwss_dpia.h"
-#include "link/link_hwss_hpo_dp.h"
+#include "link/hwss/link_hwss_dio.h"
+#include "link/hwss/link_hwss_dpia.h"
+#include "link/hwss/link_hwss_hpo_dp.h"
 
 #if defined(CONFIG_DRM_AMD_DC_SI)
 #include "dce60/dce60_resource.h"
index 48f6a5b0933611ab3fabd607fd429ee3be065644..d86e84f417cc4cb823f2150cfeba1e0b9f7fdab2 100644 (file)
@@ -456,11 +456,6 @@ void dc_link_remove_remote_sink(
 
 /* Used by diagnostics for virtual link at the moment */
 
-void dc_link_dp_set_drive_settings(
-       struct dc_link *link,
-       const struct link_resource *link_res,
-       struct link_training_settings *lt_settings);
-
 bool dc_link_dp_set_test_pattern(
        struct dc_link *link,
        enum dp_test_pattern test_pattern,
index a51bd21a796f974499255e9a3802af5903c18f43..926963a993a9cc4b528b0563045ccf9bdb78640b 100644 (file)
@@ -65,7 +65,6 @@
 
 #include "dcn10/dcn10_hw_sequencer.h"
 
-#include "link/link_dp_trace.h"
 #include "dce110_hw_sequencer.h"
 
 #define GAMMA_HW_POINTS_NUM 256
@@ -807,19 +806,19 @@ void dce110_edp_power_control(
                                div64_u64(dm_get_elapse_time_in_ns(
                                                ctx,
                                                current_ts,
-                                               dp_trace_get_edp_poweroff_timestamp(link)), 1000000);
+                                               link_dp_trace_get_edp_poweroff_timestamp(link)), 1000000);
                unsigned long long time_since_edp_poweron_ms =
                                div64_u64(dm_get_elapse_time_in_ns(
                                                ctx,
                                                current_ts,
-                                               dp_trace_get_edp_poweron_timestamp(link)), 1000000);
+                                               link_dp_trace_get_edp_poweron_timestamp(link)), 1000000);
                DC_LOG_HW_RESUME_S3(
                                "%s: transition: power_up=%d current_ts=%llu edp_poweroff=%llu edp_poweron=%llu time_since_edp_poweroff_ms=%llu time_since_edp_poweron_ms=%llu",
                                __func__,
                                power_up,
                                current_ts,
-                               dp_trace_get_edp_poweroff_timestamp(link),
-                               dp_trace_get_edp_poweron_timestamp(link),
+                               link_dp_trace_get_edp_poweroff_timestamp(link),
+                               link_dp_trace_get_edp_poweron_timestamp(link),
                                time_since_edp_poweroff_ms,
                                time_since_edp_poweron_ms);
 
@@ -834,7 +833,7 @@ void dce110_edp_power_control(
                                        link->panel_config.pps.extra_t12_ms;
 
                        /* Adjust remaining_min_edp_poweroff_time_ms if this is not the first time. */
-                       if (dp_trace_get_edp_poweroff_timestamp(link) != 0) {
+                       if (link_dp_trace_get_edp_poweroff_timestamp(link) != 0) {
                                if (time_since_edp_poweroff_ms < remaining_min_edp_poweroff_time_ms)
                                        remaining_min_edp_poweroff_time_ms =
                                                remaining_min_edp_poweroff_time_ms - time_since_edp_poweroff_ms;
@@ -894,13 +893,13 @@ void dce110_edp_power_control(
                                __func__, (power_up ? "On":"Off"),
                                bp_result);
 
-               dp_trace_set_edp_power_timestamp(link, power_up);
+               link_dp_trace_set_edp_power_timestamp(link, power_up);
 
                DC_LOG_HW_RESUME_S3(
                                "%s: updated values: edp_poweroff=%llu edp_poweron=%llu\n",
                                __func__,
-                               dp_trace_get_edp_poweroff_timestamp(link),
-                               dp_trace_get_edp_poweron_timestamp(link));
+                               link_dp_trace_get_edp_poweroff_timestamp(link),
+                               link_dp_trace_get_edp_poweron_timestamp(link));
 
                if (bp_result != BP_RESULT_OK)
                        DC_LOG_ERROR(
@@ -928,14 +927,14 @@ void dce110_edp_wait_for_T12(
                return;
 
        if (!link->panel_cntl->funcs->is_panel_powered_on(link->panel_cntl) &&
-                       dp_trace_get_edp_poweroff_timestamp(link) != 0) {
+                       link_dp_trace_get_edp_poweroff_timestamp(link) != 0) {
                unsigned int t12_duration = 500; // Default T12 as per spec
                unsigned long long current_ts = dm_get_timestamp(ctx);
                unsigned long long time_since_edp_poweroff_ms =
                                div64_u64(dm_get_elapse_time_in_ns(
                                                ctx,
                                                current_ts,
-                                               dp_trace_get_edp_poweroff_timestamp(link)), 1000000);
+                                               link_dp_trace_get_edp_poweroff_timestamp(link)), 1000000);
 
                t12_duration += link->panel_config.pps.extra_t12_ms; // Add extra T12
 
index 906a43e85f6dbadfef123f0df1c0f61f36ad6e9a..e1422e5e86c92e57573ddc43de405b90caa3c492 100644 (file)
@@ -32,7 +32,7 @@
 #include "core_types.h"
 #include "link.h"
 #include "link_hwss.h"
-#include "link/link_dpcd.h"
+#include "link/protocols/link_dpcd.h"
 
 #define DC_LOGGER \
        link->ctx->logger
index 52e1aad1fce8917abe4f1e821f42d88e2df4823e..31613c58e5eb0481bc00cf9e0be423edd1bda022 100644 (file)
@@ -47,12 +47,6 @@ enum {
        PEAK_FACTOR_X1000 = 1006,
 };
 
-
-bool dp_verify_link_cap_with_retries(
-       struct dc_link *link,
-       struct dc_link_settings *known_limit_link_setting,
-       int attempts);
-
 bool dp_validate_mode_timing(
        struct dc_link *link,
        const struct dc_crtc_timing *timing);
@@ -70,8 +64,6 @@ void dp_enable_mst_on_sink(struct dc_link *link, bool enable);
 enum dp_panel_mode dp_get_panel_mode(struct dc_link *link);
 void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode);
 
-void dpcd_write_cable_id_to_dprx(struct dc_link *link);
-
 enum dc_status dp_set_fec_ready(struct dc_link *link, const struct link_resource *link_res, bool ready);
 void dp_set_fec_enable(struct dc_link *link, bool enable);
 bool dp_set_dsc_enable(struct pipe_ctx *pipe_ctx, bool enable);
@@ -80,12 +72,6 @@ void dp_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable);
 bool dp_update_dsc_config(struct pipe_ctx *pipe_ctx);
 bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable);
 
-/* Initialize output parameter lt_settings. */
-void dp_decide_training_settings(
-       struct dc_link *link,
-       const struct dc_link_settings *link_setting,
-       struct link_training_settings *lt_settings);
-
 bool dpcd_write_128b_132b_sst_payload_allocation_table(
                const struct dc_stream_state *stream,
                struct dc_link *link,
@@ -97,12 +83,6 @@ bool dpcd_poll_for_allocation_change_trigger(struct dc_link *link);
 struct fixed31_32 calculate_sst_avg_time_slots_per_mtp(
                const struct dc_stream_state *stream,
                const struct dc_link *link);
-void enable_dp_hpo_output(struct dc_link *link,
-               const struct link_resource *link_res,
-               const struct dc_link_settings *link_settings);
-void disable_dp_hpo_output(struct dc_link *link,
-               const struct link_resource *link_res,
-               enum signal_type signal);
 void setup_dp_hpo_stream(struct pipe_ctx *pipe_ctx, bool enable);
 void edp_panel_backlight_power_on(struct dc_link *link, bool wait_for_hpd);
 void dp_source_sequence_trace(struct dc_link *link, uint8_t dp_test_mode);
index 3945522fb798213b68b95b1663349424d8d320e6..b176dcfa1469010be33795029e5da01adbfa9f12 100644 (file)
@@ -89,4 +89,9 @@ bool link_decide_link_settings(
        struct dc_stream_state *stream,
        struct dc_link_settings *link_setting);
 
+void link_dp_trace_set_edp_power_timestamp(struct dc_link *link,
+               bool power_up);
+uint64_t link_dp_trace_get_edp_poweron_timestamp(struct dc_link *link);
+uint64_t link_dp_trace_get_edp_poweroff_timestamp(struct dc_link *link);
+
 #endif /* __DC_LINK_HPD_H__ */
index 4dee0e6248b1df9058be35116a7235f9a88889e9..abfd79ba361748b432d70ef0edc6cf306f4863b0 100644 (file)
 # It abstracts the control and status of back end pipe such as DIO, HPO, DPIA,
 # PHY, HPD, DDC and etc).
 
-LINK = link_hwss_dio.o link_hwss_dpia.o link_hwss_hpo_dp.o link_dp_trace.o \
-link_hpd.o link_ddc.o link_dpcd.o link_dp_dpia.o link_dp_training.o \
-link_dp_training_8b_10b.o link_dp_training_128b_132b.o link_dp_training_dpia.o \
-link_dp_training_auxless.o link_dp_training_fixed_vs_pe_retimer.o link_dp_phy.o \
-link_dp_capability.o
+###############################################################################
+# accessories
+###############################################################################
+LINK_ACCESSORIES = link_dp_trace.o
 
-AMD_DAL_LINK = $(addprefix $(AMDDALPATH)/dc/link/,$(LINK))
+AMD_DAL_LINK_ACCESSORIES = $(addprefix $(AMDDALPATH)/dc/link/accessories/, \
+$(LINK_ACCESSORIES))
 
-AMD_DISPLAY_FILES += $(AMD_DAL_LINK)
+AMD_DISPLAY_FILES += $(AMD_DAL_LINK_ACCESSORIES)
+###############################################################################
+# hwss
+###############################################################################
+LINK_HWSS = link_hwss_dio.o link_hwss_dpia.o link_hwss_hpo_dp.o
+
+AMD_DAL_LINK_HWSS = $(addprefix $(AMDDALPATH)/dc/link/hwss/, \
+$(LINK_HWSS))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_LINK_HWSS)
+###############################################################################
+# protocols
+###############################################################################
+LINK_PROTOCOLS = link_hpd.o link_ddc.o link_dpcd.o link_dp_dpia.o \
+link_dp_training.o link_dp_training_8b_10b.o link_dp_training_128b_132b.o \
+link_dp_training_dpia.o link_dp_training_auxless.o \
+link_dp_training_fixed_vs_pe_retimer.o link_dp_phy.o link_dp_capability.o
+
+AMD_DAL_LINK_PROTOCOLS = $(addprefix $(AMDDALPATH)/dc/link/protocols/, \
+$(LINK_PROTOCOLS))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_LINK_PROTOCOLS)
\ No newline at end of file
similarity index 95%
rename from drivers/gpu/drm/amd/display/dc/link/link_dp_trace.c
rename to drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
index 2c1a3bfcdb5067630b4a117cf92c8acde05a6de3..04838a31e5139212917b663f787494c8ddb9c669 100644 (file)
@@ -145,7 +145,7 @@ unsigned int dc_dp_trace_get_link_loss_count(struct dc_link *link)
        return link->dp_trace.link_loss_count;
 }
 
-void dp_trace_set_edp_power_timestamp(struct dc_link *link,
+void link_dp_trace_set_edp_power_timestamp(struct dc_link *link,
                bool power_up)
 {
        if (!power_up)
@@ -155,12 +155,12 @@ void dp_trace_set_edp_power_timestamp(struct dc_link *link,
                link->dp_trace.edp_trace_power_timestamps.poweron = dm_get_timestamp(link->dc->ctx);
 }
 
-uint64_t dp_trace_get_edp_poweron_timestamp(struct dc_link *link)
+uint64_t link_dp_trace_get_edp_poweron_timestamp(struct dc_link *link)
 {
        return link->dp_trace.edp_trace_power_timestamps.poweron;
 }
 
-uint64_t dp_trace_get_edp_poweroff_timestamp(struct dc_link *link)
+uint64_t link_dp_trace_get_edp_poweroff_timestamp(struct dc_link *link)
 {
        return link->dp_trace.edp_trace_power_timestamps.poweroff;
-}
\ No newline at end of file
+}
similarity index 91%
rename from drivers/gpu/drm/amd/display/dc/link/link_dp_trace.h
rename to drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.h
index 26700e3cd65e9c5136bfcd095e1ee2d1371e2e20..702f97c6ead02f026c13e3902988147d1b451e92 100644 (file)
@@ -54,9 +54,4 @@ struct dp_trace_lt_counts *dc_dp_trace_get_lt_counts(struct dc_link *link,
                bool in_detection);
 unsigned int dc_dp_trace_get_link_loss_count(struct dc_link *link);
 
-void dp_trace_set_edp_power_timestamp(struct dc_link *link,
-               bool power_up);
-uint64_t dp_trace_get_edp_poweron_timestamp(struct dc_link *link);
-uint64_t dp_trace_get_edp_poweroff_timestamp(struct dc_link *link);
-
 #endif /* __LINK_DP_TRACE_H__ */
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_frl.h b/drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_frl.h
deleted file mode 100644 (file)
index ea8d976..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2022 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: AMD
- *
- */
-#ifndef __LINK_HWSS_HPO_FRL_H__
-#define __LINK_HWSS_HPO_FRL_H__
-
-#include "link_hwss.h"
-
-bool can_use_hpo_frl_link_hwss(const struct dc_link *link,
-               const struct link_resource *link_res);
-const struct link_hwss *get_hpo_frl_link_hwss(void);
-
-#endif /* __LINK_HWSS_HPO_FRL_H__ */
similarity index 99%
rename from drivers/gpu/drm/amd/display/dc/link/link_dp_capability.c
rename to drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
index 21fd9275ae4c823f5ef957ea72de7e471a5c030f..ccc0638a98a5abb19b9ac8c373777d6bf75e465b 100644 (file)
@@ -39,7 +39,7 @@
 #include "link_dpcd.h"
 #include "link_dp_dpia.h"
 #include "link_dp_phy.h"
-#include "link_dp_trace.h"
+#include "link/accessories/link_dp_trace.h"
 #include "link_dp_training.h"
 #include "atomfirmware.h"
 #include "resource.h"
similarity index 85%
rename from drivers/gpu/drm/amd/display/dc/link/link_dp_capability.h
rename to drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.h
index 5500744d2e47bbdf1daf3f0cd744ecc4515397bf..f79e4a4a9db628ccd0454287ee01cd845ae0a5ba 100644 (file)
@@ -46,6 +46,15 @@ bool is_dp_active_dongle(const struct dc_link *link);
 
 bool is_dp_branch_device(const struct dc_link *link);
 
+void dpcd_write_cable_id_to_dprx(struct dc_link *link);
+
+/* Initialize output parameter lt_settings. */
+void dp_decide_training_settings(
+       struct dc_link *link,
+       const struct dc_link_settings *link_setting,
+       struct link_training_settings *lt_settings);
+
+
 bool decide_edp_link_settings_with_dsc(struct dc_link *link,
                struct dc_link_settings *link_setting,
                uint32_t req_bw,
@@ -62,5 +71,9 @@ bool decide_fallback_link_setting(
                struct dc_link_settings *cur,
                enum link_training_result training_result);
 
+bool dp_verify_link_cap_with_retries(
+       struct dc_link *link,
+       struct dc_link_settings *known_limit_link_setting,
+       int attempts);
 
 #endif /* __DC_LINK_DP_CAPABILITY_H__ */
similarity index 99%
rename from drivers/gpu/drm/amd/display/dc/link/link_dp_phy.c
rename to drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
index afe3b21335c27232c8955a2a0570d44f2836c5fb..b7f7ff451607cf668b674f0e57a0b08d14d83587 100644 (file)
 #define DC_LOGGER \
        link->ctx->logger
 
-void dc_link_dp_set_drive_settings(
-       struct dc_link *link,
-       const struct link_resource *link_res,
-       struct link_training_settings *lt_settings)
-{
-       /* program ASIC PHY settings*/
-       dp_set_hw_lane_settings(link, link_res, lt_settings, DPRX);
-
-       dp_hw_to_dpcd_lane_settings(lt_settings,
-                       lt_settings->hw_lane_settings,
-                       lt_settings->dpcd_lane_settings);
-
-       /* Notify DP sink the PHY settings from source */
-       dpcd_set_lane_settings(link, lt_settings, DPRX);
-}
-
 void dc_link_dp_receiver_power_ctrl(struct dc_link *link, bool on)
 {
        uint8_t state;
@@ -143,3 +127,19 @@ void dp_set_hw_lane_settings(
                        link_settings->hw_lane_settings,
                        sizeof(link->cur_lane_setting));
 }
+
+void dp_set_drive_settings(
+       struct dc_link *link,
+       const struct link_resource *link_res,
+       struct link_training_settings *lt_settings)
+{
+       /* program ASIC PHY settings*/
+       dp_set_hw_lane_settings(link, link_res, lt_settings, DPRX);
+
+       dp_hw_to_dpcd_lane_settings(lt_settings,
+                       lt_settings->hw_lane_settings,
+                       lt_settings->dpcd_lane_settings);
+
+       /* Notify DP sink the PHY settings from source */
+       dpcd_set_lane_settings(link, lt_settings, DPRX);
+}
similarity index 93%
rename from drivers/gpu/drm/amd/display/dc/link/link_dp_phy.h
rename to drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.h
index 717e078fd564b598b4c1bfe5eb8664bdf1bea942..850da64c90058b8979685937e95deffa95c153ac 100644 (file)
@@ -48,4 +48,9 @@ void dp_set_hw_lane_settings(
                const struct link_training_settings *link_settings,
                uint32_t offset);
 
+void dp_set_drive_settings(
+       struct dc_link *link,
+       const struct link_resource *link_res,
+       struct link_training_settings *lt_settings);
+
 #endif /* __DC_LINK_DP_PHY_H__ */
similarity index 99%
rename from drivers/gpu/drm/amd/display/dc/link/link_dp_training.c
rename to drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
index e49e0258a1bdc98a5da08b3a1b5f2dbdf2b195ea..9dbaeb20b8af8373fcba43c370ce31e98d1f3b55 100644 (file)
@@ -37,7 +37,7 @@
 #include "link_dp_training_dpia.h"
 #include "link_dp_training_fixed_vs_pe_retimer.h"
 #include "link_dpcd.h"
-#include "link_dp_trace.h"
+#include "link/accessories/link_dp_trace.h"
 #include "link_dp_phy.h"
 #include "link_dp_capability.h"
 #include "dc_link_dp.h"
@@ -1389,7 +1389,7 @@ static bool perform_post_lt_adj_req_sequence(
                                dp_decide_lane_settings(lt_settings, dpcd_lane_adjust,
                                                lt_settings->hw_lane_settings, lt_settings->dpcd_lane_settings);
 
-                               dc_link_dp_set_drive_settings(link,
+                               dp_set_drive_settings(link,
                                                link_res,
                                                lt_settings);
                                break;