lab.nexedi.com will be down from Thursday, 20 March 2025, 07:30:00 UTC for a duration of approximately 2 hours

Commit 76f5dc40 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: move dc_link functions in link root folder to dc_link_exports

[why]
link component should only have one interface serving dc.

[how]
We are moving dc_link functions exposed to DM to dc_link_exports
and unify link component interface in link.h with function pointer
to match the style of other dc component. This is the second step to move
dc_link functions under link root folder to dc_link_exports.
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 36516001
...@@ -264,3 +264,18 @@ unsigned int dc_dp_trace_get_link_loss_count(struct dc_link *link) ...@@ -264,3 +264,18 @@ unsigned int dc_dp_trace_get_link_loss_count(struct dc_link *link)
{ {
return link->dc->link_srv->dp_trace_get_link_loss_count(link); return link->dc->link_srv->dp_trace_get_link_loss_count(link);
} }
struct dc_sink *dc_link_add_remote_sink(
struct dc_link *link,
const uint8_t *edid,
int len,
struct dc_sink_init_data *init_data)
{
return link->dc->link_srv->add_remote_sink(link, edid, len, init_data);
}
void dc_link_remove_remote_sink(struct dc_link *link, struct dc_sink *sink)
{
link->dc->link_srv->remove_remote_sink(link, sink);
}
...@@ -49,6 +49,12 @@ struct link_init_data { ...@@ -49,6 +49,12 @@ struct link_init_data {
}; };
struct link_service { struct link_service {
struct dc_sink *(*add_remote_sink)(
struct dc_link *link,
const uint8_t *edid,
int len,
struct dc_sink_init_data *init_data);
void (*remove_remote_sink)(struct dc_link *link, struct dc_sink *sink);
void (*dp_handle_automated_test)(struct dc_link *link); void (*dp_handle_automated_test)(struct dc_link *link);
bool (*dp_set_test_pattern)( bool (*dp_set_test_pattern)(
struct dc_link *link, struct dc_link *link,
......
...@@ -1327,7 +1327,7 @@ static bool link_add_remote_sink_helper(struct dc_link *dc_link, struct dc_sink ...@@ -1327,7 +1327,7 @@ static bool link_add_remote_sink_helper(struct dc_link *dc_link, struct dc_sink
return true; return true;
} }
struct dc_sink *dc_link_add_remote_sink( struct dc_sink *link_add_remote_sink(
struct dc_link *link, struct dc_link *link,
const uint8_t *edid, const uint8_t *edid,
int len, int len,
...@@ -1385,7 +1385,7 @@ struct dc_sink *dc_link_add_remote_sink( ...@@ -1385,7 +1385,7 @@ struct dc_sink *dc_link_add_remote_sink(
return NULL; return NULL;
} }
void dc_link_remove_remote_sink(struct dc_link *link, struct dc_sink *sink) void link_remove_remote_sink(struct dc_link *link, struct dc_sink *sink)
{ {
int i; int i;
......
...@@ -26,5 +26,11 @@ ...@@ -26,5 +26,11 @@
#ifndef __DC_LINK_DETECTION_H__ #ifndef __DC_LINK_DETECTION_H__
#define __DC_LINK_DETECTION_H__ #define __DC_LINK_DETECTION_H__
#include "link.h" #include "link.h"
struct dc_sink *link_add_remote_sink(
struct dc_link *link,
const uint8_t *edid,
int len,
struct dc_sink_init_data *init_data);
void link_remove_remote_sink(struct dc_link *link, struct dc_sink *sink);
#endif /* __DC_LINK_DETECTION_H__ */ #endif /* __DC_LINK_DETECTION_H__ */
...@@ -1000,7 +1000,7 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx) ...@@ -1000,7 +1000,7 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx)
} }
} }
static void dc_log_vcp_x_y(const struct dc_link *link, struct fixed31_32 avg_time_slots_per_mtp) static void log_vcp_x_y(const struct dc_link *link, struct fixed31_32 avg_time_slots_per_mtp)
{ {
const uint32_t VCP_Y_PRECISION = 1000; const uint32_t VCP_Y_PRECISION = 1000;
uint64_t vcp_x, vcp_y; uint64_t vcp_x, vcp_y;
...@@ -1516,7 +1516,7 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx) ...@@ -1516,7 +1516,7 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
pbn = get_pbn_from_timing(pipe_ctx); pbn = get_pbn_from_timing(pipe_ctx);
avg_time_slots_per_mtp = dc_fixpt_div(pbn, pbn_per_slot); avg_time_slots_per_mtp = dc_fixpt_div(pbn, pbn_per_slot);
dc_log_vcp_x_y(link, avg_time_slots_per_mtp); log_vcp_x_y(link, avg_time_slots_per_mtp);
if (link_hwss->ext.set_throttled_vcp_size) if (link_hwss->ext.set_throttled_vcp_size)
link_hwss->ext.set_throttled_vcp_size(pipe_ctx, avg_time_slots_per_mtp); link_hwss->ext.set_throttled_vcp_size(pipe_ctx, avg_time_slots_per_mtp);
...@@ -1669,7 +1669,7 @@ static enum dc_status update_sst_payload(struct pipe_ctx *pipe_ctx, ...@@ -1669,7 +1669,7 @@ static enum dc_status update_sst_payload(struct pipe_ctx *pipe_ctx,
if (!allocate) { if (!allocate) {
avg_time_slots_per_mtp = dc_fixpt_from_int(0); avg_time_slots_per_mtp = dc_fixpt_from_int(0);
dc_log_vcp_x_y(link, avg_time_slots_per_mtp); log_vcp_x_y(link, avg_time_slots_per_mtp);
if (link_hwss->ext.set_throttled_vcp_size) if (link_hwss->ext.set_throttled_vcp_size)
link_hwss->ext.set_throttled_vcp_size(pipe_ctx, link_hwss->ext.set_throttled_vcp_size(pipe_ctx,
...@@ -1720,7 +1720,7 @@ static enum dc_status update_sst_payload(struct pipe_ctx *pipe_ctx, ...@@ -1720,7 +1720,7 @@ static enum dc_status update_sst_payload(struct pipe_ctx *pipe_ctx,
DP_128b_132b_ENCODING) { DP_128b_132b_ENCODING) {
avg_time_slots_per_mtp = link_calculate_sst_avg_time_slots_per_mtp(stream, link); avg_time_slots_per_mtp = link_calculate_sst_avg_time_slots_per_mtp(stream, link);
dc_log_vcp_x_y(link, avg_time_slots_per_mtp); log_vcp_x_y(link, avg_time_slots_per_mtp);
if (link_hwss->ext.set_throttled_vcp_size) if (link_hwss->ext.set_throttled_vcp_size)
link_hwss->ext.set_throttled_vcp_size(pipe_ctx, link_hwss->ext.set_throttled_vcp_size(pipe_ctx,
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
* This file owns the creation/destruction of link structure. * This file owns the creation/destruction of link structure.
*/ */
#include "link_factory.h" #include "link_factory.h"
#include "link_detection.h"
#include "accessories/link_dp_cts.h" #include "accessories/link_dp_cts.h"
#include "accessories/link_dp_trace.h" #include "accessories/link_dp_trace.h"
#include "accessories/link_fpga.h" #include "accessories/link_fpga.h"
...@@ -43,6 +44,8 @@ ...@@ -43,6 +44,8 @@
__VA_ARGS__) __VA_ARGS__)
static struct link_service link_srv = { static struct link_service link_srv = {
.add_remote_sink = link_add_remote_sink,
.remove_remote_sink = link_remove_remote_sink,
.dp_handle_automated_test = dp_handle_automated_test, .dp_handle_automated_test = dp_handle_automated_test,
.dp_set_test_pattern = dp_set_test_pattern, .dp_set_test_pattern = dp_set_test_pattern,
.dp_set_preferred_link_settings = dp_set_preferred_link_settings, .dp_set_preferred_link_settings = dp_set_preferred_link_settings,
...@@ -197,7 +200,7 @@ static enum channel_id get_ddc_line(struct dc_link *link) ...@@ -197,7 +200,7 @@ static enum channel_id get_ddc_line(struct dc_link *link)
return channel; return channel;
} }
static bool dc_link_construct_phy(struct dc_link *link, static bool construct_phy(struct dc_link *link,
const struct link_init_data *init_params) const struct link_init_data *init_params)
{ {
uint8_t i; uint8_t i;
...@@ -489,7 +492,7 @@ static bool dc_link_construct_phy(struct dc_link *link, ...@@ -489,7 +492,7 @@ static bool dc_link_construct_phy(struct dc_link *link,
return false; return false;
} }
static bool dc_link_construct_dpia(struct dc_link *link, static bool construct_dpia(struct dc_link *link,
const struct link_init_data *init_params) const struct link_init_data *init_params)
{ {
struct ddc_service_init_data ddc_service_init_data = { 0 }; struct ddc_service_init_data ddc_service_init_data = { 0 };
...@@ -559,9 +562,9 @@ static bool link_construct(struct dc_link *link, ...@@ -559,9 +562,9 @@ static bool link_construct(struct dc_link *link,
{ {
/* Handle dpia case */ /* Handle dpia case */
if (init_params->is_dpia_link == true) if (init_params->is_dpia_link == true)
return dc_link_construct_dpia(link, init_params); return construct_dpia(link, init_params);
else else
return dc_link_construct_phy(link, init_params); return construct_phy(link, init_params);
} }
struct dc_link *link_create(const struct link_init_data *init_params) struct dc_link *link_create(const struct link_init_data *init_params)
......
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