Commit 54618888 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher
Browse files

drm/amd/display: break down dc_link.c



[why]
dc_link contains over 30k line of code, the decision is to break it
down to files residing in link folder based on functionality. This
change is the last break down change which will remove dc_link.c
file after everything is broken down.

[how]
Move remaining dc_link.c functions into link_detection, link_dpms,
link_validation, link_resource, and link_fpga and remove dc_link.

Reviewed-by: default avatarGeorge Shen <George.Shen@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 71d7e890
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1283,7 +1283,7 @@ static void dm_handle_hpd_rx_offload_work(struct work_struct *work)
	dc_link = aconnector->dc_link;

	mutex_lock(&aconnector->hpd_lock);
	if (!dc_link_detect_sink(dc_link, &new_connection_type))
	if (!dc_link_detect_connection_type(dc_link, &new_connection_type))
		DRM_ERROR("KMS: Failed to detect connector\n");
	mutex_unlock(&aconnector->hpd_lock);

@@ -1334,7 +1334,7 @@ static void dm_handle_hpd_rx_offload_work(struct work_struct *work)
		offload_work->offload_wq->is_handling_link_loss = false;
		spin_unlock_irqrestore(&offload_work->offload_wq->offload_lock, flags);

		if ((dp_read_hpd_rx_irq_data(dc_link, &irq_data) == DC_OK) &&
		if ((dc_link_dp_read_hpd_rx_irq_data(dc_link, &irq_data) == DC_OK) &&
			dc_link_check_link_loss_status(dc_link, &irq_data))
			dc_link_dp_handle_link_loss(dc_link);
	}
@@ -2777,7 +2777,7 @@ static int dm_resume(void *handle)
			continue;

		mutex_lock(&aconnector->hpd_lock);
		if (!dc_link_detect_sink(aconnector->dc_link, &new_connection_type))
		if (!dc_link_detect_connection_type(aconnector->dc_link, &new_connection_type))
			DRM_ERROR("KMS: Failed to detect connector\n");

		if (aconnector->base.force && new_connection_type == dc_connection_none) {
@@ -3118,7 +3118,7 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)

	aconnector->timing_changed = false;

	if (!dc_link_detect_sink(aconnector->dc_link, &new_connection_type))
	if (!dc_link_detect_connection_type(aconnector->dc_link, &new_connection_type))
		DRM_ERROR("KMS: Failed to detect connector\n");

	if (aconnector->base.force && new_connection_type == dc_connection_none) {
@@ -3321,7 +3321,7 @@ static void handle_hpd_rx_irq(void *param)
out:
	if (result && !is_mst_root_connector) {
		/* Downstream Port status changed. */
		if (!dc_link_detect_sink(dc_link, &new_connection_type))
		if (!dc_link_detect_connection_type(dc_link, &new_connection_type))
			DRM_ERROR("KMS: Failed to detect connector\n");

		if (aconnector->base.force && new_connection_type == dc_connection_none) {
@@ -4370,7 +4370,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)

		link = dc_get_link_at_index(dm->dc, i);

		if (!dc_link_detect_sink(link, &new_connection_type))
		if (!dc_link_detect_connection_type(link, &new_connection_type))
			DRM_ERROR("KMS: Failed to detect connector\n");

		if (aconnector->base.force && new_connection_type == dc_connection_none) {
+2 −2
Original line number Diff line number Diff line
@@ -1257,7 +1257,7 @@ static ssize_t trigger_hotplug(struct file *f, const char __user *buf,

	if (param[0] == 1) {

		if (!dc_link_detect_sink(aconnector->dc_link, &new_connection_type) &&
		if (!dc_link_detect_connection_type(aconnector->dc_link, &new_connection_type) &&
			new_connection_type != dc_connection_none)
			goto unlock;

@@ -1294,7 +1294,7 @@ static ssize_t trigger_hotplug(struct file *f, const char __user *buf,

		/* If the aconnector is the root node in mst topology */
		if (aconnector->mst_mgr.mst_state == true)
			reset_cur_dp_mst_topology(link);
			dc_link_reset_cur_dp_mst_topology(link);

		drm_modeset_lock_all(dev);
		dm_restore_drm_connector_state(dev, connector);
+1 −1
Original line number Diff line number Diff line
@@ -1104,7 +1104,7 @@ bool dm_helpers_dp_handle_test_pattern_request(
		pipe_ctx->stream->timing.display_color_depth = requestColorDepth;
		pipe_ctx->stream->timing.pixel_encoding = requestPixelEncoding;

		dp_update_dsc_config(pipe_ctx);
		dc_link_update_dsc_config(pipe_ctx);

		aconnector->timing_changed = true;
		/* store current timing */
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
#include "dc/dcn20/dcn20_resource.h"
bool is_timing_changed(struct dc_stream_state *cur_stream,
		       struct dc_stream_state *new_stream);

#define PEAK_FACTOR_X1000 1006

static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
				  struct drm_dp_aux_msg *msg)
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ AMD_DC = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/dc/,$(DC_LI

include $(AMD_DC)

DISPLAY_CORE = dc.o dc_stat.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_sink.o \
DISPLAY_CORE = dc.o dc_stat.o dc_resource.o dc_hw_sequencer.o dc_sink.o \
dc_surface.o dc_debug.o dc_stream.o dc_link_enc_cfg.o

DISPLAY_CORE += dc_vm_helper.o
Loading