[PATCH 22/27] drm/amd/display: Refactor on dc_sink structure.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zeyu Fan <Zeyu.Fan@xxxxxxx>

Change-Id: I47456746d26307356b62379b1cf3c221e5935eb5
Signed-off-by: Zeyu Fan <Zeyu.Fan at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c     | 9 ++++-----
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_sink.c     | 4 ++--
 drivers/gpu/drm/amd/display/dc/dc.h               | 2 ++
 drivers/gpu/drm/amd/display/dc/inc/core_types.h   | 2 --
 5 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index d275fc88f71e..5ca72afe8f6f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -675,10 +675,6 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
 
 		sink_init_data.link = &link->public;
 		sink_init_data.sink_signal = sink_caps.signal;
-		sink_init_data.dongle_max_pix_clk =
-			sink_caps.max_hdmi_pixel_clock;
-		sink_init_data.converter_disable_audio =
-			converter_disable_audio;
 
 		dc_sink = dc_sink_create(&sink_init_data);
 		if (!dc_sink) {
@@ -686,6 +682,9 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
 			return false;
 		}
 
+		dc_sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock;
+		dc_sink->converter_disable_audio = converter_disable_audio;
+
 		sink = DC_SINK_TO_CORE(dc_sink);
 		link->public.local_sink = &sink->public;
 
@@ -1361,7 +1360,7 @@ enum dc_status dc_link_validate_mode_timing(
 		struct core_link *link,
 		const struct dc_crtc_timing *timing)
 {
-	uint32_t max_pix_clk = stream->sink->dongle_max_pix_clk;
+	uint32_t max_pix_clk = stream->sink->public.dongle_max_pix_clk;
 
 	/* A hack to avoid failing any modes for EDID override feature on
 	 * topology change such as lower quality cable for DP or different dongle
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index c38f71e45381..326019407cb1 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -1193,7 +1193,7 @@ enum dc_status resource_map_pool_resources(
 			pipe_ctx->stream_enc);
 
 		/* TODO: Add check if ASIC support and EDID audio */
-		if (!stream->sink->converter_disable_audio &&
+		if (!stream->sink->public.converter_disable_audio &&
 			dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&
 			stream->public.audio_info.mode_count) {
 			pipe_ctx->audio = find_first_free_audio(
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c
index 0a805ea1159a..8a204731301d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c
@@ -60,8 +60,8 @@ static bool construct(struct sink *sink, const struct dc_sink_init_data *init_pa
 	sink->protected.public.sink_signal = init_params->sink_signal;
 	sink->protected.link = core_link;
 	sink->protected.ctx = core_link->ctx;
-	sink->protected.dongle_max_pix_clk = init_params->dongle_max_pix_clk;
-	sink->protected.converter_disable_audio =
+	sink->protected.public.dongle_max_pix_clk = init_params->dongle_max_pix_clk;
+	sink->protected.public.converter_disable_audio =
 			init_params->converter_disable_audio;
 
 	return true;
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index e2c2a0bf764d..c6c0cf500ae8 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -653,6 +653,8 @@ struct dc_sink {
 	enum signal_type sink_signal;
 	struct dc_edid dc_edid; /* raw edid */
 	struct dc_edid_caps edid_caps; /* parse display caps */
+	uint32_t dongle_max_pix_clk;
+	bool converter_disable_audio;
 };
 
 void dc_sink_retain(const struct dc_sink *sink);
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
index b29fca9dfeff..faec2292cc27 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -109,8 +109,6 @@ struct core_sink {
 	/* not used for now */
 	struct core_link *link;
 	struct dc_context *ctx;
-	uint32_t dongle_max_pix_clk;
-	bool converter_disable_audio;
 };
 
 /************ link *****************/
-- 
2.10.2



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux