Commit ad5594ad authored by Michael Strauss's avatar Michael Strauss Committed by Alex Deucher
Browse files

drm/amd/display: Support Compliance Test Pattern Generation with DP2 Retimer



[WHY]
Certain retimer requires workarounds in order to correctly output test patterns.

[HOW]
Add vendor-specific aux sequences to program retimer's TX and pattern generator
when specific compliance test patterns are requested by sink.
Note: SQ128 w/a in DPMF mode only works in one flip orientation currently

Reviewed-by: default avatarHansen Dsouza <hansen.dsouza@amd.com>
Reviewed-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Acked-by: default avatarStylon Wang <stylon.wang@amd.com>
Signed-off-by: default avatarMichael Strauss <michael.strauss@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent dba24294
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@
#include "link/hwss/link_hwss_dio.h"
#include "link/hwss/link_hwss_dpia.h"
#include "link/hwss/link_hwss_hpo_dp.h"
#include "link/hwss/link_hwss_dio_fixed_vs_pe_retimer.h"
#include "link/hwss/link_hwss_hpo_fixed_vs_pe_retimer_dp.h"

#if defined(CONFIG_DRM_AMD_DC_SI)
#include "dce60/dce60_resource.h"
@@ -4198,11 +4200,13 @@ const struct link_hwss *get_link_hwss(const struct dc_link *link,
		 * with an hpo encoder. Or we can return a very dummy one that doesn't
		 * do work for all functions
		 */
		return get_hpo_dp_link_hwss();
		return (requires_fixed_vs_pe_retimer_hpo_link_hwss(link) ?
				get_hpo_fixed_vs_pe_retimer_dp_link_hwss() : get_hpo_dp_link_hwss());
	else if (can_use_dpia_link_hwss(link, link_res))
		return get_dpia_link_hwss();
	else if (can_use_dio_link_hwss(link, link_res))
		return get_dio_link_hwss();
		return (requires_fixed_vs_pe_retimer_dio_link_hwss(link)) ?
				get_dio_fixed_vs_pe_retimer_link_hwss() : get_dio_link_hwss();
	else
		return get_virtual_link_hwss();
}
+1 −0
Original line number Diff line number Diff line
@@ -1498,6 +1498,7 @@ struct dc_link {
	enum engine_id eng_id;

	bool test_pattern_enabled;
	enum dp_test_pattern current_test_pattern;
	union compliance_test_state compliance_test_state;

	void *priv;
+4 −0
Original line number Diff line number Diff line
@@ -179,6 +179,10 @@ struct link_service {
	int (*aux_transfer_raw)(struct ddc_service *ddc,
			struct aux_payload *payload,
			enum aux_return_code_type *operation_result);
	bool (*configure_fixed_vs_pe_retimer)(
			struct ddc_service *ddc,
			const uint8_t *data,
			uint32_t len);
	bool (*aux_transfer_with_retries_no_mutex)(struct ddc_service *ddc,
			struct aux_payload *payload);
	bool (*is_in_aux_transaction_mode)(struct ddc_service *ddc);
+2 −1
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ AMD_DISPLAY_FILES += $(AMD_DAL_LINK_ACCESSORIES)
###############################################################################
# hwss
###############################################################################
LINK_HWSS = link_hwss_dio.o link_hwss_dpia.o link_hwss_hpo_dp.o
LINK_HWSS = link_hwss_dio.o link_hwss_dpia.o link_hwss_hpo_dp.o \
link_hwss_dio_fixed_vs_pe_retimer.o link_hwss_hpo_fixed_vs_pe_retimer_dp.o

AMD_DAL_LINK_HWSS = $(addprefix $(AMDDALPATH)/dc/link/hwss/, \
$(LINK_HWSS))
+3 −0
Original line number Diff line number Diff line
@@ -703,6 +703,7 @@ bool dp_set_test_pattern(

		/* Reset Test Pattern state */
		link->test_pattern_enabled = false;
		link->current_test_pattern = test_pattern;

		return true;
	}
@@ -740,6 +741,7 @@ bool dp_set_test_pattern(
		if (test_pattern != DP_TEST_PATTERN_VIDEO_MODE) {
			/* Set Test Pattern state */
			link->test_pattern_enabled = true;
			link->current_test_pattern = test_pattern;
			if (p_link_settings != NULL)
				dpcd_set_link_settings(link,
						p_link_settings);
@@ -938,6 +940,7 @@ bool dp_set_test_pattern(

		/* Set Test Pattern state */
		link->test_pattern_enabled = true;
		link->current_test_pattern = test_pattern;
	}

	return true;
Loading