Skip to contentSkip to conversation

DAL Patches Nov 21, 2016

PATCH In review Harry Wentland 3 participants 80 messages Nov 21, 2016 – Nov 23, 2016 2 messages not in the archive Page 2 of 2

Subsystems (2)
lore
Share & tools
lore
#55 lore raw

PATCH 54/76 drm/amd/dal: Disable bit depth reduction in set link test pattern

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

[Description]
Driver current only programs timing generator to set the link test pattern. However for deep color, bit depth reduction is not disabled. This causes DP compliance reads a wrong CRC
when evaluating the pattern.
Call the general dc_link_dp_set_test_pattern function.
This has already provide a correct sequence for
programming link test pattern

---
 drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c | 53 ++++++++++------------------
 1 file changed, 18 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c +18 -35
index b7c4b5899dcd..dd06960e110c 100644
@@ -1668,6 +1668,7 @@ static void dp_test_send_link_test_pattern(struct core_link *link)
 {
 	union link_test_pattern dpcd_test_pattern;
 	union test_misc dpcd_test_params;
+	enum dp_test_pattern test_pattern;
 
 	memset(&dpcd_test_pattern, 0, sizeof(dpcd_test_pattern));
 	memset(&dpcd_test_params, 0, sizeof(dpcd_test_params));
@@ -1684,52 +1685,30 @@ static void dp_test_send_link_test_pattern(struct core_link *link)
 			&dpcd_test_params.raw,
 			sizeof(dpcd_test_params));
 
-	/* translate request */
-	enum controller_dp_test_pattern test_pattern;
-	enum dc_color_depth color_depth;
-
 	switch (dpcd_test_pattern.bits.PATTERN) {
 	case LINK_TEST_PATTERN_COLOR_RAMP:
-		test_pattern = CONTROLLER_DP_TEST_PATTERN_COLORRAMP;
+		test_pattern = DP_TEST_PATTERN_COLOR_RAMP;
 	break;
 	case LINK_TEST_PATTERN_VERTICAL_BARS:
-		test_pattern = CONTROLLER_DP_TEST_PATTERN_VERTICALBARS;
+		test_pattern = DP_TEST_PATTERN_VERTICAL_BARS;
 	break; /* black and white */
 	case LINK_TEST_PATTERN_COLOR_SQUARES:
 		test_pattern = (dpcd_test_params.bits.DYN_RANGE ==
 				TEST_DYN_RANGE_VESA ?
-				CONTROLLER_DP_TEST_PATTERN_COLORSQUARES :
-				CONTROLLER_DP_TEST_PATTERN_COLORSQUARES_CEA);
+				DP_TEST_PATTERN_COLOR_SQUARES :
+				DP_TEST_PATTERN_COLOR_SQUARES_CEA);
 	break;
 	default:
-		test_pattern = CONTROLLER_DP_TEST_PATTERN_VIDEOMODE;
-	break;
-	}
-
-	switch (dpcd_test_params.bits.BPC) {
-	case TEST_BIT_DEPTH_6:
-		color_depth = COLOR_DEPTH_666;
-	break;
-	case TEST_BIT_DEPTH_8:
-		color_depth = COLOR_DEPTH_888;
-	break;
-	case TEST_BIT_DEPTH_10:
-		color_depth = COLOR_DEPTH_101010;
-	break;
-	case TEST_BIT_DEPTH_12:
-		color_depth = COLOR_DEPTH_121212;
-	break;
-	case TEST_BIT_DEPTH_16:
-		color_depth = COLOR_DEPTH_161616;
-	break;
-	default:
-		color_depth = COLOR_DEPTH_UNDEFINED;
+		test_pattern = DP_TEST_PATTERN_VIDEO_MODE;
 	break;
 	}
 
-	link->dc->current_context->res_ctx.pipe_ctx->tg->funcs->
-		set_test_pattern(link->dc->current_context->res_ctx.
-				pipe_ctx->tg, test_pattern, color_depth);
+	dc_link_dp_set_test_pattern(
+			&link->public,
+			test_pattern,
+			NULL,
+			NULL,
+			0);
 }
 
 static void handle_automated_test(struct core_link *link)
@@ -1784,6 +1763,7 @@ bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link)
 {
 	struct core_link *link = DC_LINK_TO_LINK(dc_link);
 	union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
+	union device_service_irq device_service_clear = {0};
 	enum dc_status result = DDC_RESULT_UNKNOWN;
 	bool status = false;
 	/* For use cases related to down stream connection status change,
@@ -1809,12 +1789,15 @@ bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link)
 	}
 
 	if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.AUTOMATED_TEST) {
+		device_service_clear.bits.AUTOMATED_TEST = 1;
 		core_link_write_dpcd(
 			link,
 			DPCD_ADDRESS_DEVICE_SERVICE_IRQ_VECTOR,
-			&hpd_irq_dpcd_data.bytes.device_service_irq.raw,
-			sizeof(hpd_irq_dpcd_data.bytes.device_service_irq));
+			&device_service_clear.raw,
+			sizeof(device_service_clear.raw));
+		device_service_clear.raw = 0;
 		handle_automated_test(link);
+		return false;
 	}
 
 	if (!allow_hpd_rx_irq(link)) {
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#56 lore raw

PATCH 55/76 drm/amd/dal: Handle AUX error during RECIEVE state of transaction

In reply to a message not in the archive

From: Wenjing Liu <[email protected]>

[Description]
DP compliance intermittent failure for aux channel error retry. During DP compliance test generates AUX channel error,
asic may intermittently set the AUX_SW_DONE bit to 1
but indicates channel error during RECIEVE state.
Driver fails to retry without checking the error bits
The fix will retry upon following errors:
During the RECIEVE state of a SW transaction,
some H symbol(s) were detected that were not part of a STOP pattern During the RECIEVE state of a SW transaction,
some L symbol(s) were detected that were not part of a STOP pattern. During the RECIEVE state of a SW transaction,
symbol(s) had both correlation counters below the threshold level of detection set by
AUX_RX_CONTROL.AUX_RX_DETECTION_THRESHOLD.

---
 drivers/gpu/drm/amd/dal/dc/i2caux/dce110/aux_engine_dce110.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/dal/dc/i2caux/dce110/aux_engine_dce110.c +5 -1
index c112bdd5e7ab..f49fd1ad3807 100644
@@ -362,7 +362,11 @@ static enum aux_channel_operation_result get_channel_status(
 			(value & AUX_SW_STATUS__AUX_SW_RX_TIMEOUT_MASK))
 			return AUX_CHANNEL_OPERATION_FAILED_TIMEOUT;
 
-		else if (value & AUX_SW_STATUS__AUX_SW_RX_INVALID_STOP_MASK)
+		else if ((value & AUX_SW_STATUS__AUX_SW_RX_INVALID_STOP_MASK) ||
+			(value & AUX_SW_STATUS__AUX_SW_RX_RECV_NO_DET_MASK) ||
+			(value &
+				AUX_SW_STATUS__AUX_SW_RX_RECV_INVALID_H_MASK) ||
+			(value & AUX_SW_STATUS__AUX_SW_RX_RECV_INVALID_L_MASK))
 			return AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY;
 
 		*returned_bytes = get_reg_field_value(value,
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#57 lore raw

PATCH 56/76 drm/amd/dal: Remove unnecessary increment in scaler ratio calculation

In reply to a message not in the archive

From: Jordan Lazare <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/core/dc_resource.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/dal/dc/core/dc_resource.c +0 -3
index 4e76d5dbbac0..0578052859e3 100644
@@ -493,9 +493,6 @@ static void calculate_scaling_ratios(
 	pipe_ctx->scl_data.ratios.horz.value = div64_s64(
 		pipe_ctx->scl_data.ratios.horz.value * in_w, out_w);
 
-	pipe_ctx->scl_data.ratios.horz.value++;
-	pipe_ctx->scl_data.ratios.vert.value++;
-
 	pipe_ctx->scl_data.ratios.horz_c = pipe_ctx->scl_data.ratios.horz;
 	pipe_ctx->scl_data.ratios.vert_c = pipe_ctx->scl_data.ratios.vert;
 
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#58 lore raw

PATCH 57/76 drm/amd/dal: Add YCBCR420 to stream encoder

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

---
 .../gpu/drm/amd/dal/dc/dce/dce_stream_encoder.c    | 37 +++++++++++++++++-----
 .../gpu/drm/amd/dal/dc/dce/dce_stream_encoder.h    |  4 +++
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    |  4 +--
 3 files changed, 35 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.c +29 -8
index 98925f9278db..89e09150234e 100644
@@ -27,11 +27,29 @@
 #include "dm_services.h"
 #include "dc_bios_types.h"
 #include "dce_stream_encoder.h"
-#include "dce/dce_11_0_d.h"
-#include "dce/dce_11_0_sh_mask.h"
-#include "dce/dce_11_0_enum.h"
 #include "reg_helper.h"
 
+enum DP_PIXEL_ENCODING {
+DP_PIXEL_ENCODING_RGB444                 = 0x00000000,
+DP_PIXEL_ENCODING_YCBCR422               = 0x00000001,
+DP_PIXEL_ENCODING_YCBCR444               = 0x00000002,
+DP_PIXEL_ENCODING_RGB_WIDE_GAMUT         = 0x00000003,
+DP_PIXEL_ENCODING_Y_ONLY                 = 0x00000004,
+DP_PIXEL_ENCODING_YCBCR420               = 0x00000005,
+DP_PIXEL_ENCODING_RESERVED               = 0x00000006,
+};
+
+
+enum DP_COMPONENT_DEPTH {
+DP_COMPONENT_DEPTH_6BPC                  = 0x00000000,
+DP_COMPONENT_DEPTH_8BPC                  = 0x00000001,
+DP_COMPONENT_DEPTH_10BPC                 = 0x00000002,
+DP_COMPONENT_DEPTH_12BPC                 = 0x00000003,
+DP_COMPONENT_DEPTH_16BPC                 = 0x00000004,
+DP_COMPONENT_DEPTH_RESERVED              = 0x00000005,
+};
+
+
 #define REG(reg)\
 	(enc110->regs->reg)
 
@@ -221,14 +239,12 @@ static void dce110_stream_encoder_dp_set_stream_attribute(
 	/* set pixel encoding */
 	switch (crtc_timing->pixel_encoding) {
 	case PIXEL_ENCODING_YCBCR422:
-
 		REG_UPDATE(DP_PIXEL_FORMAT, DP_PIXEL_ENCODING,
 				DP_PIXEL_ENCODING_YCBCR422);
-
 		break;
 	case PIXEL_ENCODING_YCBCR444:
 		REG_UPDATE(DP_PIXEL_FORMAT, DP_PIXEL_ENCODING,
-				PIXEL_ENCODING_YCBCR444);
+				DP_PIXEL_ENCODING_YCBCR444);
 
 		if (crtc_timing->flags.Y_ONLY)
 			if (crtc_timing->display_color_depth != COLOR_DEPTH_666)
@@ -237,13 +253,18 @@ static void dce110_stream_encoder_dp_set_stream_attribute(
 				 * 8, 10, 12, 16 bits */
 				REG_UPDATE(DP_PIXEL_FORMAT, DP_PIXEL_ENCODING,
 						DP_PIXEL_ENCODING_Y_ONLY);
-
-
 		/* Note: DP_MSA_MISC1 bit 7 is the indicator
 		 * of Y-only mode.
 		 * This bit is set in HW if register
 		 * DP_PIXEL_ENCODING is programmed to 0x4 */
 		break;
+	case PIXEL_ENCODING_YCBCR420:
+		REG_UPDATE(DP_PIXEL_FORMAT, DP_PIXEL_ENCODING,
+				DP_PIXEL_ENCODING_YCBCR420);
+		if (enc110->se_mask->DP_VID_M_DOUBLE_VALUE_EN)
+			REG_UPDATE(DP_VID_TIMING, DP_VID_M_DOUBLE_VALUE_EN, 1);
+
+		break;
 	default:
 		REG_UPDATE(DP_PIXEL_FORMAT, DP_PIXEL_ENCODING,
 				DP_PIXEL_ENCODING_RGB444);
drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.h +4 -0
index 88ef2a1f2a43..2778f89e5abf 100644
@@ -330,6 +330,8 @@ struct dce_stream_encoder_shift {
 	uint8_t DP_MSA_HWIDTH;
 	uint8_t DP_MSA_VHEIGHT;
 	uint8_t HDMI_DB_DISABLE;
+	uint8_t DP_VID_N_MUL;
+	uint8_t DP_VID_M_DOUBLE_VALUE_EN;
 };
 
 struct dce_stream_encoder_mask {
@@ -455,6 +457,8 @@ struct dce_stream_encoder_mask {
 	uint32_t DP_MSA_HWIDTH;
 	uint32_t DP_MSA_VHEIGHT;
 	uint32_t HDMI_DB_DISABLE;
+	uint32_t DP_VID_N_MUL;
+	uint32_t DP_VID_M_DOUBLE_VALUE_EN;
 };
 
 struct dce110_stream_enc_registers {
drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c +2 -2
index 578d8fd89d39..9f47bec557ea 100644
@@ -298,11 +298,11 @@ static const struct dce110_stream_enc_registers stream_enc_regs[] = {
 };
 
 static const struct dce_stream_encoder_shift se_shift = {
-		SE_COMMON_MASK_SH_LIST_DCE110(__SHIFT)
+		SE_COMMON_MASK_SH_LIST_DCE112(__SHIFT)
 };
 
 static const struct dce_stream_encoder_mask se_mask = {
-		SE_COMMON_MASK_SH_LIST_DCE110(_MASK)
+		SE_COMMON_MASK_SH_LIST_DCE112(_MASK)
 };
 
 #define audio_regs(id)\
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#59 lore raw

PATCH 58/76 drm/amd/dal: Add surface log to dc

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/Makefile                |   2 +-
 drivers/gpu/drm/amd/dal/dc/basics/logger.c         |   6 +-
 drivers/gpu/drm/amd/dal/dc/core/dc.c               |   6 +
 drivers/gpu/drm/amd/dal/dc/core/dc_debug.c         | 270 +++++++++++++++++++++
 drivers/gpu/drm/amd/dal/dc/dc.h                    |   3 +
 drivers/gpu/drm/amd/dal/include/logger_interface.h |  18 ++
 drivers/gpu/drm/amd/dal/include/logger_types.h     |   1 +
 7 files changed, 303 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/dal/dc/core/dc_debug.c
drivers/gpu/drm/amd/dal/dc/Makefile +1 -1
index 834bb1814be5..f9c5db6f6cd1 100644
@@ -15,7 +15,7 @@ AMD_DC = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DAL_PATH)/dc/,$(DC_LIBS))
 include $(AMD_DC)
 
 DISPLAY_CORE = dc.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_target.o dc_sink.o dc_stream.o \
-dc_surface.o dc_link_hwss.o dc_link_dp.o dc_link_ddc.o
+dc_surface.o dc_link_hwss.o dc_link_dp.o dc_link_ddc.o dc_debug.o
 
 AMD_DISPLAY_CORE = $(addprefix $(AMDDALPATH)/dc/core/,$(DISPLAY_CORE))
 
drivers/gpu/drm/amd/dal/dc/basics/logger.c +4 -2
index 3c16fe1d91ff..a5625a3badab 100644
@@ -57,7 +57,8 @@ static const struct dc_log_type_info log_type_info_tbl[] = {
 		{LOG_EVENT_DETECTION,       "Detect"},
 		{LOG_EVENT_LINK_TRAINING,   "LKTN"},
 		{LOG_EVENT_LINK_LOSS,       "LinkLoss"},
-		{LOG_EVENT_UNDERFLOW,       "Underflow"}
+		{LOG_EVENT_UNDERFLOW,       "Underflow"},
+		{LOG_IF_TRACE,				"InterfaceTrace"}
 };
 
 
@@ -83,7 +84,8 @@ static const struct dc_log_type_info log_type_info_tbl[] = {
 		(1 << LOG_DETECTION_EDID_PARSER) | \
 		(1 << LOG_DETECTION_DP_CAPS) | \
 		(1 << LOG_BACKLIGHT)) | \
-		(1 << LOG_I2C_AUX)/* | \
+		(1 << LOG_I2C_AUX) | \
+		(1 << LOG_IF_TRACE) /* | \
 		(1 << LOG_SURFACE) | \
 		(1 << LOG_SCALER) | \
 		(1 << LOG_DML) | \
drivers/gpu/drm/amd/dal/dc/core/dc.c +6 -0
index e58b27fc3322..d928b3f93ab6 100644
@@ -1119,6 +1119,8 @@ bool dc_pre_update_surfaces_to_target(
 	struct validate_context *temp_context;
 	bool ret = true;
 
+	pre_surface_trace(dc, new_surfaces, new_surface_count);
+
 	if (core_dc->current_context->target_count == 0)
 		return false;
 
@@ -1249,6 +1251,8 @@ bool dc_post_update_surfaces_to_target(struct dc *dc)
 	struct core_dc *core_dc = DC_TO_CORE(dc);
 	int i;
 
+	post_surface_trace(dc);
+
 	for (i = 0; i < core_dc->current_context->res_ctx.pool->pipe_count; i++)
 		if (core_dc->current_context->res_ctx.pipe_ctx[i].stream == NULL)
 			core_dc->hwss.power_down_front_end(
@@ -1320,6 +1324,8 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 	int i, j;
 	bool is_new_pipe_surface[MAX_SURFACES];
 
+	update_surface_trace(dc, updates, surface_count);
+
 	for (j = 0; j < MAX_SURFACES; j++)
 		is_new_pipe_surface[j] = true;
 
drivers/gpu/drm/amd/dal/dc/core/dc_debug.c new file +270 -0

270 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dc.h +3 -0
index d73ae63b4ec9..26624e2661fa 100644
@@ -141,6 +141,9 @@ struct dc_debug {
 	bool disable_dcc;
 	bool disable_dfs_bypass;
 	bool max_disp_clk;
+	bool target_trace;
+	bool surface_trace;
+	bool validation_trace;
 };
 
 struct dc {
drivers/gpu/drm/amd/dal/include/logger_interface.h +18 -0
index 859215630914..b58d30de8293 100644
@@ -30,6 +30,7 @@
 
 struct dc_context;
 struct dc_link;
+struct dc_surface_update;
 
 /*
  *
@@ -67,6 +68,23 @@ void dc_conn_log(struct dc_context *ctx,
 		const char *msg,
 		...);
 
+void logger_write(struct dal_logger *logger,
+		enum dc_log_type log_type,
+		const char *msg,
+		void *paralist);
+
+void pre_surface_trace(
+		const struct dc *dc,
+		const struct dc_surface *const *surfaces,
+		int surface_count);
+
+void update_surface_trace(
+		const struct dc *dc,
+		const struct dc_surface_update *updates,
+		int surface_count);
+
+void post_surface_trace(const struct dc *dc);
+
 
 /* Any function which is empty or have incomplete implementation should be
  * marked by this macro.
drivers/gpu/drm/amd/dal/include/logger_types.h +1 -0
index 1ea60bb9e716..babd6523b105 100644
@@ -61,6 +61,7 @@ enum dc_log_type {
 	LOG_EVENT_LINK_TRAINING,
 	LOG_EVENT_LINK_LOSS,
 	LOG_EVENT_UNDERFLOW,
+	LOG_IF_TRACE,
 
 	LOG_SECTION_TOTAL_COUNT
 };
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#60 lore raw

PATCH 59/76 drm/amd/dal: add stoney bounding box to bw_calcs

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c | 110 +++++++++++++++++++++
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    |   5 +-
 drivers/gpu/drm/amd/dal/dc/inc/bandwidth_calcs.h   |   1 +
 3 files changed, 115 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c +110 -0
index 8e669971b321..5247543dc6c1 100644
@@ -2294,6 +2294,116 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
 		dceip.scatter_gather_pte_request_rows_in_tiling_mode = 2;
 		dceip.mcifwr_all_surfaces_burst_time = bw_int_to_fixed(0);
 		break;
+	case BW_CALCS_VERSION_STONEY:
+		vbios.memory_type = bw_def_gddr5;
+		vbios.dram_channel_width_in_bits = 64;
+		vbios.number_of_dram_channels = 1;
+		vbios.number_of_dram_banks = 8;
+		vbios.high_yclk = bw_int_to_fixed(1866);
+		vbios.mid_yclk = bw_int_to_fixed(1866);
+		vbios.low_yclk = bw_int_to_fixed(1333);
+		vbios.low_sclk = bw_int_to_fixed(200);
+		vbios.mid1_sclk = bw_int_to_fixed(600);
+		vbios.mid2_sclk = bw_int_to_fixed(600);
+		vbios.mid3_sclk = bw_int_to_fixed(600);
+		vbios.mid4_sclk = bw_int_to_fixed(600);
+		vbios.mid5_sclk = bw_int_to_fixed(600);
+		vbios.mid6_sclk = bw_int_to_fixed(600);
+		vbios.high_sclk = bw_int_to_fixed(800);
+		vbios.low_voltage_max_dispclk = bw_int_to_fixed(352);
+		vbios.mid_voltage_max_dispclk = bw_int_to_fixed(467);
+		vbios.high_voltage_max_dispclk = bw_int_to_fixed(643);
+		vbios.low_voltage_max_phyclk = bw_int_to_fixed(540);
+		vbios.mid_voltage_max_phyclk = bw_int_to_fixed(810);
+		vbios.high_voltage_max_phyclk = bw_int_to_fixed(810);
+		vbios.data_return_bus_width = bw_int_to_fixed(32);
+		vbios.trc = bw_int_to_fixed(50);
+		vbios.dmifmc_urgent_latency = bw_int_to_fixed(4);
+		vbios.stutter_self_refresh_exit_latency = bw_frc_to_fixed(158, 10);
+		vbios.stutter_self_refresh_entry_latency = bw_int_to_fixed(0);
+		vbios.nbp_state_change_latency = bw_frc_to_fixed(208, 10);
+		vbios.mcifwrmc_urgent_latency = bw_int_to_fixed(10);
+		vbios.scatter_gather_enable = true;
+		vbios.down_spread_percentage = bw_frc_to_fixed(5, 10);
+		vbios.cursor_width = 32;
+		vbios.average_compression_rate = 4;
+		vbios.number_of_request_slots_gmc_reserves_for_dmif_per_channel = 256;
+		vbios.blackout_duration = bw_int_to_fixed(18); /* us */
+		vbios.maximum_blackout_recovery_time = bw_int_to_fixed(20);
+
+		dceip.large_cursor = false;
+		dceip.dmif_request_buffer_size = bw_int_to_fixed(768);
+		dceip.dmif_pipe_en_fbc_chunk_tracker = false;
+		dceip.cursor_max_outstanding_group_num = 1;
+		dceip.lines_interleaved_into_lb = 2;
+		dceip.chunk_width = 256;
+		dceip.number_of_graphics_pipes = 2;
+		dceip.number_of_underlay_pipes = 1;
+		dceip.low_power_tiling_mode = 0;
+		dceip.display_write_back_supported = false;
+		dceip.argb_compression_support = false;
+		dceip.underlay_vscaler_efficiency6_bit_per_component =
+			bw_frc_to_fixed(35556, 10000);
+		dceip.underlay_vscaler_efficiency8_bit_per_component =
+			bw_frc_to_fixed(34286, 10000);
+		dceip.underlay_vscaler_efficiency10_bit_per_component =
+			bw_frc_to_fixed(32, 10);
+		dceip.underlay_vscaler_efficiency12_bit_per_component =
+			bw_int_to_fixed(3);
+		dceip.graphics_vscaler_efficiency6_bit_per_component =
+			bw_frc_to_fixed(35, 10);
+		dceip.graphics_vscaler_efficiency8_bit_per_component =
+			bw_frc_to_fixed(34286, 10000);
+		dceip.graphics_vscaler_efficiency10_bit_per_component =
+			bw_frc_to_fixed(32, 10);
+		dceip.graphics_vscaler_efficiency12_bit_per_component =
+			bw_int_to_fixed(3);
+		dceip.alpha_vscaler_efficiency = bw_int_to_fixed(3);
+		dceip.max_dmif_buffer_allocated = 2;
+		dceip.graphics_dmif_size = 12288;
+		dceip.underlay_luma_dmif_size = 19456;
+		dceip.underlay_chroma_dmif_size = 23552;
+		dceip.pre_downscaler_enabled = true;
+		dceip.underlay_downscale_prefetch_enabled = true;
+		dceip.lb_write_pixels_per_dispclk = bw_int_to_fixed(1);
+		dceip.lb_size_per_component444 = bw_int_to_fixed(82176);
+		dceip.graphics_lb_nodownscaling_multi_line_prefetching = false;
+		dceip.stutter_and_dram_clock_state_change_gated_before_cursor =
+			bw_int_to_fixed(0);
+		dceip.underlay420_luma_lb_size_per_component = bw_int_to_fixed(
+			82176);
+		dceip.underlay420_chroma_lb_size_per_component =
+			bw_int_to_fixed(164352);
+		dceip.underlay422_lb_size_per_component = bw_int_to_fixed(
+			82176);
+		dceip.cursor_chunk_width = bw_int_to_fixed(64);
+		dceip.cursor_dcp_buffer_lines = bw_int_to_fixed(4);
+		dceip.underlay_maximum_width_efficient_for_tiling =
+			bw_int_to_fixed(1920);
+		dceip.underlay_maximum_height_efficient_for_tiling =
+			bw_int_to_fixed(1080);
+		dceip.peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display =
+			bw_frc_to_fixed(3, 10);
+		dceip.peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation =
+			bw_int_to_fixed(25);
+		dceip.minimum_outstanding_pte_request_limit = bw_int_to_fixed(
+			2);
+		dceip.maximum_total_outstanding_pte_requests_allowed_by_saw =
+			bw_int_to_fixed(128);
+		dceip.limit_excessive_outstanding_dmif_requests = true;
+		dceip.linear_mode_line_request_alternation_slice =
+			bw_int_to_fixed(64);
+		dceip.scatter_gather_lines_of_pte_prefetching_in_linear_mode =
+			32;
+		dceip.display_write_back420_luma_mcifwr_buffer_size = 12288;
+		dceip.display_write_back420_chroma_mcifwr_buffer_size = 8192;
+		dceip.request_efficiency = bw_frc_to_fixed(8, 10);
+		dceip.dispclk_per_request = bw_int_to_fixed(2);
+		dceip.dispclk_ramping_factor = bw_frc_to_fixed(105, 100);
+		dceip.display_pipe_throughput_factor = bw_frc_to_fixed(105, 100);
+		dceip.scatter_gather_pte_request_rows_in_tiling_mode = 2;
+		dceip.mcifwr_all_surfaces_burst_time = bw_int_to_fixed(0);
+		break;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c +4 -1
index 8a840d3b86d7..cac8a19f28ed 100644
@@ -1325,7 +1325,10 @@ static bool construct(
 	if (!dce110_hw_sequencer_construct(dc))
 		goto res_create_fail;
 
-	bw_calcs_init(&dc->bw_dceip, &dc->bw_vbios, BW_CALCS_VERSION_CARRIZO);
+	if (ASIC_REV_IS_STONEY(ctx->asic_id.hw_internal_rev))
+		bw_calcs_init(&dc->bw_dceip, &dc->bw_vbios, BW_CALCS_VERSION_STONEY);
+	else
+		bw_calcs_init(&dc->bw_dceip, &dc->bw_vbios, BW_CALCS_VERSION_CARRIZO);
 
 	bw_calcs_data_update_from_pplib(dc);
 
drivers/gpu/drm/amd/dal/dc/inc/bandwidth_calcs.h +1 -0
index 6fb38c718d2d..f9b871b6199b 100644
@@ -39,6 +39,7 @@ enum bw_calcs_version {
 	BW_CALCS_VERSION_CARRIZO,
 	BW_CALCS_VERSION_POLARIS10,
 	BW_CALCS_VERSION_POLARIS11,
+	BW_CALCS_VERSION_STONEY,
 };
 
 /*******************************************************************************
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#61 lore raw

PATCH 60/76 drm/amd/dal: Implement DCHUB interface

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/core/dc.c               | 26 ++++++++++++++++++++++
 drivers/gpu/drm/amd/dal/dc/dc.h                    | 19 ++++++++++++++++
 .../gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c   |  3 ++-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c |  3 ++-
 drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h      |  3 +++
 5 files changed, 52 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/dal/dc/core/dc.c +26 -0
index d928b3f93ab6..0c814cf886c3 100644
@@ -1802,3 +1802,29 @@ const struct dc_stream_status *dc_stream_get_status(
 
 	return &stream->status;
 }
+
+bool dc_init_dchub(struct dc *dc, struct dchub_init_data *dh_data)
+{
+	int i;
+	int status_check = false;
+	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct mem_input *mi;
+
+	for (i = 0; i < core_dc->res_pool->pipe_count; i++) {
+		if (core_dc->res_pool->mis[i] != NULL) {
+			mi = core_dc->res_pool->mis[i];
+			break;
+		}
+	}
+
+
+	if (mi->funcs->mem_input_update_dchub)
+		mi->funcs->mem_input_update_dchub(mi, dh_data);
+	else
+		ASSERT(mi->funcs->mem_input_update_dchub);
+
+
+	return true;
+
+}
+
drivers/gpu/drm/amd/dal/dc/dc.h +19 -0
index 26624e2661fa..4c969eb26e85 100644
@@ -155,6 +155,21 @@ struct dc {
 	struct dc_debug debug;
 };
 
+enum frame_buffer_mode {
+	FRAME_BUFFER_MODE_LOCAL_ONLY = 0,
+	FRAME_BUFFER_MODE_ZFB_ONLY,
+	FRAME_BUFFER_MODE_MIXED_ZFB_AND_LOCAL,
+} ;
+
+struct dchub_init_data {
+	bool dchub_initialzied;
+	bool dchub_info_valid;
+	int64_t zfb_phys_addr_base;
+	int64_t zfb_mc_base_addr;
+	uint64_t zfb_size_in_byte;
+	enum frame_buffer_mode fb_mode;
+};
+
 struct dc_init_data {
 	struct hw_asic_id asic_id;
 	void *driver; /* ctx */
@@ -172,8 +187,11 @@ struct dc_init_data {
 };
 
 struct dc *dc_create(const struct dc_init_data *init_params);
+
 void dc_destroy(struct dc **dc);
 
+bool dc_init_dchub(struct dc *dc, struct dchub_init_data *dh_data);
+
 /*******************************************************************************
  * Surface Interfaces
  ******************************************************************************/
@@ -346,6 +364,7 @@ bool dc_post_update_surfaces_to_target(
 
 void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *updates,
 		int surface_count, struct dc_target *dc_target);
+
 /*******************************************************************************
  * Target Interfaces
  ******************************************************************************/
drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c +2 -1
index 0b778c984e9a..834a73222926 100644
@@ -983,7 +983,8 @@ static struct mem_input_funcs dce110_mem_input_funcs = {
 	.mem_input_program_surface_config =
 			dce110_mem_input_program_surface_config,
 	.mem_input_is_flip_pending =
-			dce110_mem_input_is_flip_pending
+			dce110_mem_input_is_flip_pending,
+	.mem_input_update_dchub = NULL
 };
 /*****************************************/
 /* Constructor, Destructor               */
drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c +2 -1
index 078a608dc737..7cc3ae89b7ee 100644
@@ -175,7 +175,8 @@ static struct mem_input_funcs dce80_mem_input_funcs = {
 	.mem_input_program_surface_config =
 			dce110_mem_input_program_surface_config,
 	.mem_input_is_flip_pending =
-			dce110_mem_input_is_flip_pending
+			dce110_mem_input_is_flip_pending,
+	.mem_input_update_dchub = NULL
 };
 
 /*****************************************/
drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h +3 -0
index c4a78eefd362..a4e91cc719d6 100644
@@ -91,6 +91,9 @@ struct mem_input_funcs {
 		bool horizontal_mirror);
 
 	bool (*mem_input_is_flip_pending)(struct mem_input *mem_input);
+
+	void (*mem_input_update_dchub)(struct mem_input *mem_input,
+			struct dchub_init_data *dh_data);
 };
 
 #endif
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#62 lore raw

PATCH 61/76 drm/amd/dal: fix initial bw_calc parameters

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/dal/dc/calcs/bandwidth_calcs.c +4 -4
index 5247543dc6c1..0dbe47db3740 100644
@@ -2121,7 +2121,7 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
 		dceip.number_of_underlay_pipes = 0;
 		dceip.low_power_tiling_mode = 0;
 		dceip.display_write_back_supported = false;
-		dceip.argb_compression_support = false;
+		dceip.argb_compression_support = true;
 		dceip.underlay_vscaler_efficiency6_bit_per_component =
 			bw_frc_to_fixed(35556, 10000);
 		dceip.underlay_vscaler_efficiency8_bit_per_component =
@@ -2231,7 +2231,7 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
 		dceip.number_of_underlay_pipes = 0;
 		dceip.low_power_tiling_mode = 0;
 		dceip.display_write_back_supported = false;
-		dceip.argb_compression_support = false;
+		dceip.argb_compression_support = true;
 		dceip.underlay_vscaler_efficiency6_bit_per_component =
 			bw_frc_to_fixed(35556, 10000);
 		dceip.underlay_vscaler_efficiency8_bit_per_component =
@@ -2321,7 +2321,7 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
 		vbios.dmifmc_urgent_latency = bw_int_to_fixed(4);
 		vbios.stutter_self_refresh_exit_latency = bw_frc_to_fixed(158, 10);
 		vbios.stutter_self_refresh_entry_latency = bw_int_to_fixed(0);
-		vbios.nbp_state_change_latency = bw_frc_to_fixed(208, 10);
+		vbios.nbp_state_change_latency = bw_frc_to_fixed(2008, 100);
 		vbios.mcifwrmc_urgent_latency = bw_int_to_fixed(10);
 		vbios.scatter_gather_enable = true;
 		vbios.down_spread_percentage = bw_frc_to_fixed(5, 10);
@@ -2341,7 +2341,7 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
 		dceip.number_of_underlay_pipes = 1;
 		dceip.low_power_tiling_mode = 0;
 		dceip.display_write_back_supported = false;
-		dceip.argb_compression_support = false;
+		dceip.argb_compression_support = true;
 		dceip.underlay_vscaler_efficiency6_bit_per_component =
 			bw_frc_to_fixed(35556, 10000);
 		dceip.underlay_vscaler_efficiency8_bit_per_component =
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#63 lore raw

PATCH 62/76 drm/amd/dal: Don't read I2C_DATA register when in write mode

In reply to a message not in the archive
---
 .../dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c    | 25 +++++++++++-----------
 1 file changed, 12 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c +12 -13
index 17758ab2e9fb..2b606a542cb8 100644
@@ -256,6 +256,7 @@ static bool process_transaction(
 {
 	uint32_t length = request->length;
 	uint8_t *buffer = request->data;
+	uint32_t value = 0;
 
 	bool last_transaction = false;
 
@@ -291,26 +292,24 @@ static bool process_transaction(
 	 * For an I2C send operation, the LSB must be programmed to 0;
 	 * for I2C receive operation, the LSB must be programmed to 1. */
 	if (hw_engine->transaction_count == 0) {
-			REG_SET_4(DC_I2C_DATA, 0,
-			DC_I2C_DATA_RW, false,
-			DC_I2C_DATA, request->address,
-			DC_I2C_INDEX, 0,
-			DC_I2C_INDEX_WRITE, 1);
+			value = REG_SET_4(DC_I2C_DATA, 0,
+						DC_I2C_DATA_RW, false,
+						DC_I2C_DATA, request->address,
+						DC_I2C_INDEX, 0,
+						DC_I2C_INDEX_WRITE, 1);
 		hw_engine->buffer_used_write = 0;
 	} else
-			REG_SET_2(DC_I2C_DATA, 0,
-			DC_I2C_DATA_RW, false,
-			DC_I2C_DATA, request->address);
+			value = REG_SET_2(DC_I2C_DATA, 0,
+						DC_I2C_DATA_RW, false,
+						DC_I2C_DATA, request->address);
 
 	hw_engine->buffer_used_write++;
 
 	if (!(request->action & I2CAUX_TRANSACTION_ACTION_I2C_READ)) {
 		while (length) {
-
-			REG_UPDATE_2(DC_I2C_DATA,
-				DC_I2C_INDEX_WRITE, 0,
-				DC_I2C_DATA, *buffer++);
-
+			REG_SET_2(DC_I2C_DATA, value,
+					DC_I2C_INDEX_WRITE, 0,
+					DC_I2C_DATA, *buffer++);
 			hw_engine->buffer_used_write++;
 			--length;
 		}
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#64 lore raw

PATCH 63/76 drm/amd/dal: disable break_to_debugger for bandwidth failures in diags

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/core/dc.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/dal/dc/core/dc.c +0 -1
index 0c814cf886c3..c96e9edacaf1 100644
@@ -1205,7 +1205,6 @@ bool dc_pre_update_surfaces_to_target(
 				context);
 		if (!temp_context) {
 			dm_error("%s:failed apply clk constraints\n", __func__);
-			BREAK_TO_DEBUGGER();
 			ret = false;
 			goto unexpected_fail;
 		}
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#65 lore raw

PATCH 64/76 drm/amd/dal: PSR second monitor blackout fix

In reply to a message not in the archive

From: Amy Zhang <[email protected]>

- Added check to make sure stream and link are corresponding to each other
- Initialized PSR caps

---
 drivers/gpu/drm/amd/dal/dc/core/dc.c         | 13 +++++++------
 drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c |  6 ++++++
 2 files changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/dal/dc/core/dc.c +7 -6
index c96e9edacaf1..66686ee1c3e1 100644
@@ -314,14 +314,15 @@ static bool setup_psr(struct dc *dc, const struct dc_stream *stream)
 	int i;
 	unsigned int underlay_idx = core_dc->res_pool->underlay_pipe_index;
 
-	for (i = 0; i < core_dc->link_count; i++)
-		dc_link_setup_psr(&core_dc->links[i]->public,
-				stream);
+	for (i = 0; i < core_dc->link_count; i++) {
+		if (core_stream->sink->link == core_dc->links[i])
+			dc_link_setup_psr(&core_dc->links[i]->public,
+					stream);
+	}
 
 	for (i = 0; i < MAX_PIPES; i++) {
-		if (core_dc->current_context->res_ctx.pipe_ctx[i].stream == core_stream
-				&& i != underlay_idx) {
-
+		if (core_dc->current_context->res_ctx.pipe_ctx[i].stream
+				== core_stream && i != underlay_idx) {
 			pipes = &core_dc->current_context->res_ctx.pipe_ctx[i];
 			core_dc->hwss.set_static_screen_control(&pipes, 1,
 					0x182);
drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c +6 -0
index dd06960e110c..2b0b23ac6cac 100644
@@ -2134,6 +2134,12 @@ static void retrieve_link_cap(struct core_link *link)
 	link->public.test_pattern_enabled = false;
 	link->public.compliance_test_state.raw = 0;
 
+	link->public.psr_caps.psr_exit_link_training_required = false;
+	link->public.psr_caps.psr_frame_capture_indication_req = false;
+	link->public.psr_caps.psr_rfb_setup_time = 0;
+	link->public.psr_caps.psr_sdp_transmit_line_num_deadline = 0;
+	link->public.psr_caps.psr_version = 0;
+
 	/* read sink count */
 	core_link_read_dpcd(link,
 			DPCD_ADDRESS_SINK_COUNT,
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#66 lore raw

PATCH 65/76 drm/amd/dal: Fixe linux compile error.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/core/dc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/dal/dc/core/dc.c +1 -2
index 66686ee1c3e1..9c8550bc8c06 100644
@@ -47,6 +47,7 @@
 
 #include "dc_link_ddc.h"
 #include "dm_helpers.h"
+#include "mem_input.h"
 
 /*******************************************************************************
  * Private structures
@@ -1806,7 +1807,6 @@ const struct dc_stream_status *dc_stream_get_status(
 bool dc_init_dchub(struct dc *dc, struct dchub_init_data *dh_data)
 {
 	int i;
-	int status_check = false;
 	struct core_dc *core_dc = DC_TO_CORE(dc);
 	struct mem_input *mi;
 
@@ -1817,7 +1817,6 @@ bool dc_init_dchub(struct dc *dc, struct dchub_init_data *dh_data)
 		}
 	}
 
-
 	if (mi->funcs->mem_input_update_dchub)
 		mi->funcs->mem_input_update_dchub(mi, dh_data);
 	else
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#67 lore raw

PATCH 66/76 drm/amd/dal: consolidate DCE hw_sequencer

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- store register offset / shift / mask in dce_hwseq
- retire func_ptr enable_fe_clock and replace with direct call

- add debug assert guarding read/write to uninitialized offset

---
 drivers/gpu/drm/amd/dal/dc/core/dc_resource.c      |  2 +
 drivers/gpu/drm/amd/dal/dc/dce/Makefile            |  2 +-
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c         | 43 +++++++++++
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h         | 78 +++++++++++++++++++
 .../drm/amd/dal/dc/dce100/dce100_hw_sequencer.c    | 19 -----
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    | 33 +++++++-
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    | 33 +-------
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    | 33 +++++++-
 .../drm/amd/dal/dc/dce112/dce112_hw_sequencer.c    | 30 +-------
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    | 33 +++++++-
 .../gpu/drm/amd/dal/dc/dce80/dce80_hw_sequencer.c  | 20 +----
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c  | 33 +++++++-
 drivers/gpu/drm/amd/dal/dc/dm_services.h           | 90 ++++++++++++----------
 drivers/gpu/drm/amd/dal/dc/inc/core_dc.h           |  1 +
 drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h      |  3 -
 drivers/gpu/drm/amd/dal/dc/inc/resource.h          |  7 +-
 16 files changed, 313 insertions(+), 147 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c
 create mode 100644 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h
drivers/gpu/drm/amd/dal/dc/core/dc_resource.c +2 -0
index 0578052859e3..25b03cba906e 100644
@@ -193,6 +193,8 @@ bool resource_construct(
 		pool->stream_enc_count++;
 	}
 
+	dc->hwseq = create_funcs->create_hwseq(ctx);
+
 	return true;
 }
 
drivers/gpu/drm/amd/dal/dc/dce/Makefile +1 -1
index 306070dd5455..738f33f64d64 100644
@@ -5,7 +5,7 @@
 #   - register programming through common macros that look up register 
 #     offset/shift/mask stored in dce_hw struct
 
-DCE = dce_audio.o dce_stream_encoder.o dce_link_encoder.o
+DCE = dce_audio.o dce_stream_encoder.o dce_link_encoder.o dce_hwseq.o
 
 AMD_DAL_DCE = $(addprefix $(AMDDALPATH)/dc/dce/,$(DCE))
 
drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c new file +43 -0

43 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h new file +78 -0

78 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce100/dce100_hw_sequencer.c +0 -19
index 713291d7853f..b17cdf702fec 100644
@@ -83,24 +83,6 @@ static const struct dce100_hw_seq_reg_offsets reg_offsets[] = {
  * Private definitions
  ******************************************************************************/
 /***************************PIPE_CONTROL***********************************/
-static void dce100_enable_fe_clock(
-	struct dc_context *ctx, uint8_t controller_id, bool enable)
-{
-	uint32_t value = 0;
-	uint32_t addr;
-
-	addr = HW_REG_CRTC(mmDCFE_CLOCK_CONTROL, controller_id);
-
-	value = dm_read_reg(ctx, addr);
-
-	set_reg_field_value(
-		value,
-		enable,
-		DCFE_CLOCK_CONTROL,
-		DCFE_CLOCK_ENABLE);
-
-	dm_write_reg(ctx, addr, value);
-}
 
 static bool dce100_pipe_control_lock(
 	struct dc_context *ctx,
@@ -287,7 +269,6 @@ bool dce100_hw_sequencer_construct(struct core_dc *dc)
 	dc->hwss.clock_gating_power_up = dal_dc_clock_gating_dce100_power_up;
 
 	dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating;
-	dc->hwss.enable_fe_clock = dce100_enable_fe_clock;
 	dc->hwss.pipe_control_lock = dce100_pipe_control_lock;
 	dc->hwss.set_blender_mode = dce100_set_blender_mode;
 	dc->hwss.set_displaymarks = set_displaymarks;
drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c +32 -1
index 9062ca209fd9..2451327de092 100644
@@ -43,6 +43,7 @@
 #include "dce110/dce110_opp.h"
 #include "dce110/dce110_clock_source.h"
 #include "dce/dce_audio.h"
+#include "dce/dce_hwseq.h"
 #include "dce100/dce100_hw_sequencer.h"
 
 #include "reg_helper.h"
@@ -446,10 +447,40 @@ static struct stream_encoder *dce100_stream_encoder_create(
 	return NULL;
 }
 
+#define SRII(reg_name, block, id)\
+	.reg_name[id] = mm ## block ## id ## _ ## reg_name
+
+static const struct dce_hwseq_registers hwseq_reg = {
+		HWSEQ_COMMON_REG_LIST_BASE()
+};
+
+static const struct dce_hwseq_shift hwseq_shift = {
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT)
+};
+
+static const struct dce_hwseq_mask hwseq_mask = {
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK)
+};
+
+static struct dce_hwseq *dce100_hwseq_create(
+	struct dc_context *ctx)
+{
+	struct dce_hwseq *hws = dm_alloc(sizeof(struct dce_hwseq));
+
+	if (hws) {
+		hws->ctx = ctx;
+		hws->regs = &hwseq_reg;
+		hws->shifts = &hwseq_shift;
+		hws->masks = &hwseq_mask;
+	}
+	return hws;
+}
+
 static const struct resource_create_funcs res_create_funcs = {
 	.read_dce_straps = read_dce_straps,
 	.create_audio = create_audio,
-	.create_stream_encoder = dce100_stream_encoder_create
+	.create_stream_encoder = dce100_stream_encoder_create,
+	.create_hwseq = dce100_hwseq_create,
 };
 
 static struct mem_input *dce100_mem_input_create(
drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c +3 -30
index 249438456f73..c4a2bbf57dcd 100644
@@ -46,13 +46,13 @@
 #include "clock_source.h"
 #include "gamma_calcs.h"
 #include "audio.h"
+#include "dce/dce_hwseq.h"
 
 /* include DCE11 register header files */
 #include "dce/dce_11_0_d.h"
 #include "dce/dce_11_0_sh_mask.h"
 
 struct dce110_hw_seq_reg_offsets {
-	uint32_t dcfe;
 	uint32_t blnd;
 	uint32_t crtc;
 };
@@ -66,30 +66,23 @@ enum blender_mode {
 
 static const struct dce110_hw_seq_reg_offsets reg_offsets[] = {
 {
-	.dcfe = (mmDCFE0_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND0_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC0_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFE1_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND1_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC1_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFE2_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND2_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC2_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFEV_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLNDV_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTCV_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 }
 };
 
-#define HW_REG_DCFE(reg, id)\
-	(reg + reg_offsets[id].dcfe)
-
 #define HW_REG_BLND(reg, id)\
 	(reg + reg_offsets[id].blnd)
 
@@ -103,25 +96,6 @@ static const struct dce110_hw_seq_reg_offsets reg_offsets[] = {
  * Private definitions
  ******************************************************************************/
 /***************************PIPE_CONTROL***********************************/
-static void dce110_enable_fe_clock(
-	struct dc_context *ctx, uint8_t controller_id, bool enable)
-{
-	uint32_t value = 0;
-	uint32_t addr;
-
-	addr = HW_REG_DCFE(mmDCFE_CLOCK_CONTROL, controller_id);
-
-	value = dm_read_reg(ctx, addr);
-
-	set_reg_field_value(
-		value,
-		enable,
-		DCFE_CLOCK_CONTROL,
-		DCFE_CLOCK_ENABLE);
-
-	dm_write_reg(ctx, addr, value);
-}
-
 static void dce110_init_pte(struct dc_context *ctx)
 {
 	uint32_t addr;
@@ -1616,7 +1590,7 @@ static void set_plane_config(
 	memset(&tbl_entry, 0, sizeof(tbl_entry));
 	adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
 
-	dc->hwss.enable_fe_clock(ctx, pipe_ctx->pipe_idx, true);
+	dce_enable_fe_clock(dc->hwseq, pipe_ctx->pipe_idx, true);
 
 	set_default_colors(pipe_ctx);
 	if (pipe_ctx->stream->public.csc_color_matrix.enable_adjustment
@@ -1958,7 +1932,7 @@ static void dce110_program_front_end_for_pipe(
 	memset(&adjust, 0, sizeof(adjust));
 	adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
 
-	dc->hwss.enable_fe_clock(ctx, pipe_ctx->pipe_idx, true);
+	dce_enable_fe_clock(dc->hwseq, pipe_ctx->pipe_idx, true);
 
 	set_default_colors(pipe_ctx);
 	if (pipe_ctx->stream->public.csc_color_matrix.enable_adjustment
@@ -2160,7 +2134,6 @@ static const struct hw_sequencer_funcs dce110_funcs = {
 	.crtc_switch_to_clk_src = dce110_crtc_switch_to_clk_src,
 	.enable_display_power_gating = dce110_enable_display_power_gating,
 	.power_down_front_end = dce110_power_down_fe,
-	.enable_fe_clock = dce110_enable_fe_clock,
 	.pipe_control_lock = dce110_pipe_control_lock,
 	.set_blender_mode = dce110_set_blender_mode,
 	.clock_gating_power_up = dal_dc_clock_gating_dce110_power_up,
drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c +32 -1
index cac8a19f28ed..e0e3178b9134 100644
@@ -46,6 +46,7 @@
 #include "dce110/dce110_opp.h"
 #include "dce110/dce110_opp_v.h"
 #include "dce110/dce110_clock_source.h"
+#include "dce/dce_hwseq.h"
 #include "dce110/dce110_hw_sequencer.h"
 
 #include "reg_helper.h"
@@ -421,10 +422,40 @@ static struct stream_encoder *dce110_stream_encoder_create(
 	return NULL;
 }
 
+#define SRII(reg_name, block, id)\
+	.reg_name[id] = mm ## block ## id ## _ ## reg_name
+
+static const struct dce_hwseq_registers hwseq_reg = {
+		HWSEQ_COMMON_REG_LIST_BASE()
+};
+
+static const struct dce_hwseq_shift hwseq_shift = {
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT)
+};
+
+static const struct dce_hwseq_mask hwseq_mask = {
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK)
+};
+
+static struct dce_hwseq *dce110_hwseq_create(
+	struct dc_context *ctx)
+{
+	struct dce_hwseq *hws = dm_alloc(sizeof(struct dce_hwseq));
+
+	if (hws) {
+		hws->ctx = ctx;
+		hws->regs = &hwseq_reg;
+		hws->shifts = &hwseq_shift;
+		hws->masks = &hwseq_mask;
+	}
+	return hws;
+}
+
 static const struct resource_create_funcs res_create_funcs = {
 	.read_dce_straps = read_dce_straps,
 	.create_audio = create_audio,
-	.create_stream_encoder = dce110_stream_encoder_create
+	.create_stream_encoder = dce110_stream_encoder_create,
+	.create_hwseq = dce110_hwseq_create,
 };
 
 
drivers/gpu/drm/amd/dal/dc/dce112/dce112_hw_sequencer.c +1 -29
index f5611d14dbc9..f8c2cfb64b11 100644
@@ -29,6 +29,7 @@
 #include "core_types.h"
 #include "dce112_hw_sequencer.h"
 
+#include "dce/dce_hwseq.h"
 #include "dce110/dce110_hw_sequencer.h"
 #include "gpu/dce112/dc_clock_gating_dce112.h"
 
@@ -37,7 +38,6 @@
 #include "dce/dce_11_2_sh_mask.h"
 
 struct dce112_hw_seq_reg_offsets {
-	uint32_t dcfe;
 	uint32_t blnd;
 	uint32_t crtc;
 };
@@ -51,40 +51,31 @@ enum blender_mode {
 
 static const struct dce112_hw_seq_reg_offsets reg_offsets[] = {
 {
-	.dcfe = (mmDCFE0_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND0_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC0_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFE1_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND1_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC1_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFE2_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND2_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC2_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFE3_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND3_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC3_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFE4_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND4_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC4_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 },
 {
-	.dcfe = (mmDCFE5_DCFE_CLOCK_CONTROL - mmDCFE_CLOCK_CONTROL),
 	.blnd = (mmBLND5_BLND_CONTROL - mmBLND_CONTROL),
 	.crtc = (mmCRTC5_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
 }
 };
 
-#define HW_REG_DCFE(reg, id)\
-	(reg + reg_offsets[id].dcfe)
-
 #define HW_REG_BLND(reg, id)\
 	(reg + reg_offsets[id].blnd)
 
@@ -95,24 +86,6 @@ static const struct dce112_hw_seq_reg_offsets reg_offsets[] = {
  * Private definitions
  ******************************************************************************/
 /***************************PIPE_CONTROL***********************************/
-static void dce112_enable_fe_clock(
-	struct dc_context *ctx, uint8_t controller_id, bool enable)
-{
-	uint32_t value = 0;
-	uint32_t addr;
-
-	addr = HW_REG_DCFE(mmDCFE_CLOCK_CONTROL, controller_id);
-
-	value = dm_read_reg(ctx, addr);
-
-	set_reg_field_value(
-		value,
-		enable,
-		DCFE_CLOCK_CONTROL,
-		DCFE_CLOCK_ENABLE);
-
-	dm_write_reg(ctx, addr, value);
-}
 
 static bool dce112_pipe_control_lock(
 	struct dc_context *ctx,
@@ -350,7 +323,6 @@ bool dce112_hw_sequencer_construct(struct core_dc *dc)
 	dc->hwss.clock_gating_power_up = dal_dc_clock_gating_dce112_power_up;
 	dc->hwss.pipe_control_lock = dce112_pipe_control_lock;
 	dc->hwss.set_blender_mode = dce112_set_blender_mode;
-	dc->hwss.enable_fe_clock = dce112_enable_fe_clock;
 
 	return true;
 }
drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c +32 -1
index 9f47bec557ea..01534872d3b8 100644
@@ -44,6 +44,7 @@
 #include "dce110/dce110_ipp.h"
 #include "dce112/dce112_clock_source.h"
 
+#include "dce/dce_hwseq.h"
 #include "dce112/dce112_hw_sequencer.h"
 
 #include "reg_helper.h"
@@ -471,10 +472,40 @@ static struct stream_encoder *dce112_stream_encoder_create(
 	return NULL;
 }
 
+#define SRII(reg_name, block, id)\
+	.reg_name[id] = mm ## block ## id ## _ ## reg_name
+
+static const struct dce_hwseq_registers hwseq_reg = {
+		HWSEQ_COMMON_REG_LIST_BASE()
+};
+
+static const struct dce_hwseq_shift hwseq_shift = {
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT)
+};
+
+static const struct dce_hwseq_mask hwseq_mask = {
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK)
+};
+
+static struct dce_hwseq *dce112_hwseq_create(
+	struct dc_context *ctx)
+{
+	struct dce_hwseq *hws = dm_alloc(sizeof(struct dce_hwseq));
+
+	if (hws) {
+		hws->ctx = ctx;
+		hws->regs = &hwseq_reg;
+		hws->shifts = &hwseq_shift;
+		hws->masks = &hwseq_mask;
+	}
+	return hws;
+}
+
 static const struct resource_create_funcs res_create_funcs = {
 	.read_dce_straps = read_dce_straps,
 	.create_audio = create_audio,
-	.create_stream_encoder = dce112_stream_encoder_create
+	.create_stream_encoder = dce112_stream_encoder_create,
+	.create_hwseq = dce112_hwseq_create,
 };
 
 static struct mem_input *dce112_mem_input_create(
drivers/gpu/drm/amd/dal/dc/dce80/dce80_hw_sequencer.c +1 -19
index 2841e3b7cb71..d52513ba46a8 100644
@@ -29,6 +29,7 @@
 #include "core_types.h"
 #include "dce80_hw_sequencer.h"
 
+#include "dce/dce_hwseq.h"
 #include "dce110/dce110_hw_sequencer.h"
 
 #include "gpu/dce80/dc_clock_gating_dce80.h"
@@ -87,24 +88,6 @@ static const struct dce80_hw_seq_reg_offsets reg_offsets[] = {
  ******************************************************************************/
 
 /***************************PIPE_CONTROL***********************************/
-static void dce80_enable_fe_clock(
-	struct dc_context *ctx, uint8_t controller_id, bool enable)
-{
-	uint32_t value = 0;
-	uint32_t addr;
-
-	addr = HW_REG_CRTC(mmCRTC_DCFE_CLOCK_CONTROL, controller_id);
-
-	value = dm_read_reg(ctx, addr);
-
-	set_reg_field_value(
-		value,
-		enable,
-		CRTC_DCFE_CLOCK_CONTROL,
-		CRTC_DCFE_CLOCK_ENABLE);
-
-	dm_write_reg(ctx, addr, value);
-}
 
 static bool dce80_pipe_control_lock(
 	struct dc_context *ctx,
@@ -241,7 +224,6 @@ bool dce80_hw_sequencer_construct(struct core_dc *dc)
 	dce110_hw_sequencer_construct(dc);
 
 	dc->hwss.clock_gating_power_up = dal_dc_clock_gating_dce80_power_up;
-	dc->hwss.enable_fe_clock = dce80_enable_fe_clock;
 	dc->hwss.enable_display_power_gating = dce80_enable_display_power_gating;
 	dc->hwss.pipe_control_lock = dce80_pipe_control_lock;
 	dc->hwss.set_blender_mode = dce80_set_blender_mode;
drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c +32 -1
index 7bf277e7bada..100c8c01aa21 100644
@@ -46,6 +46,7 @@
 #include "dce110/dce110_ipp.h"
 #include "dce110/dce110_clock_source.h"
 #include "dce/dce_audio.h"
+#include "dce/dce_hwseq.h"
 #include "dce80/dce80_hw_sequencer.h"
 
 #include "reg_helper.h"
@@ -437,10 +438,40 @@ static struct stream_encoder *dce80_stream_encoder_create(
 	return NULL;
 }
 
+#define SRII(reg_name, block, id)\
+	.reg_name[id] = mm ## block ## id ## _ ## reg_name
+
+static const struct dce_hwseq_registers hwseq_reg = {
+		HWSEQ_DCE8_REG_LIST_BASE()
+};
+
+static const struct dce_hwseq_shift hwseq_shift = {
+		HWSEQ_DCE8_MASK_SH_LIST_BASE(__SHIFT)
+};
+
+static const struct dce_hwseq_mask hwseq_mask = {
+		HWSEQ_DCE8_MASK_SH_LIST_BASE(_MASK)
+};
+
+static struct dce_hwseq *dce80_hwseq_create(
+	struct dc_context *ctx)
+{
+	struct dce_hwseq *hws = dm_alloc(sizeof(struct dce_hwseq));
+
+	if (hws) {
+		hws->ctx = ctx;
+		hws->regs = &hwseq_reg;
+		hws->shifts = &hwseq_shift;
+		hws->masks = &hwseq_mask;
+	}
+	return hws;
+}
+
 static const struct resource_create_funcs res_create_funcs = {
 	.read_dce_straps = read_dce_straps,
 	.create_audio = create_audio,
-	.create_stream_encoder = dce80_stream_encoder_create
+	.create_stream_encoder = dce80_stream_encoder_create,
+	.create_hwseq = dce80_hwseq_create,
 };
 
 static struct mem_input *dce80_mem_input_create(
drivers/gpu/drm/amd/dal/dc/dm_services.h +51 -39

112 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/inc/core_dc.h +1 -0
index 826ae7a8998f..7d6dc8ea75ab 100644
@@ -39,6 +39,7 @@ struct core_dc {
 
 	/* HW functions */
 	struct hw_sequencer_funcs hwss;
+	struct dce_hwseq *hwseq;
 
 	/* temp store of dm_pp_display_configuration
 	 * to compare to see if display config changed
drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h +0 -3
index 6435247a41e8..7091dc731d09 100644
@@ -121,9 +121,6 @@ struct hw_sequencer_funcs {
 	void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
 			struct dc_link_settings *link_settings);
 
-	void (*enable_fe_clock)(
-		struct dc_context *ctx, uint8_t controller_id, bool enable);
-
 	bool (*pipe_control_lock)(
 				struct dc_context *ctx,
 				uint8_t controller_idx,
drivers/gpu/drm/amd/dal/dc/inc/resource.h +4 -3
index 9606cb28cd62..33fb7d98b294 100644
@@ -52,15 +52,16 @@ struct resource_straps {
 
 struct resource_create_funcs {
 	void (*read_dce_straps)(
-		struct dc_context *ctx, struct resource_straps *straps);
+			struct dc_context *ctx, struct resource_straps *straps);
 
 	struct audio *(*create_audio)(
 			struct dc_context *ctx, unsigned int inst);
 
 	struct stream_encoder *(*create_stream_encoder)(
-			enum engine_id eng_id,
-			struct dc_context *ctx);
+			enum engine_id eng_id, struct dc_context *ctx);
 
+	struct dce_hwseq *(*create_hwseq)(
+			struct dc_context *ctx);
 };
 
 bool resource_construct(
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#68 lore raw

PATCH 67/76 drm/amd/dal: consolidate DCE hw_sequencer

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- move blnd programming to new method
- separate out DCE11 underlay support.
- fix stoney wrong offsets

---
 drivers/gpu/drm/amd/dal/dc/core/dc.c               |   6 +-
 drivers/gpu/drm/amd/dal/dc/dc_helper.c             |  16 +++
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c         |  81 +++++++++++
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h         |  98 ++++++++++++--
 .../drm/amd/dal/dc/dce100/dce100_hw_sequencer.c    | 114 ----------------
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    | 150 +--------------------
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    |  35 ++++-
 .../drm/amd/dal/dc/dce112/dce112_hw_sequencer.c    | 126 -----------------
 .../gpu/drm/amd/dal/dc/dce80/dce80_hw_sequencer.c  |  94 +------------
 drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h      |  13 +-
 drivers/gpu/drm/amd/dal/dc/inc/reg_helper.h        |  27 +++-
 11 files changed, 252 insertions(+), 508 deletions(-)
drivers/gpu/drm/amd/dal/dc/core/dc.c +3 -3
index 9c8550bc8c06..7636fc6d7052 100644
@@ -1446,7 +1446,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 
 			if (updates[i].flip_addr) {
 				core_dc->hwss.pipe_control_lock(
-							core_dc->ctx,
+							core_dc->hwseq,
 							pipe_ctx->pipe_idx,
 							PIPE_LOCK_CONTROL_SURFACE,
 							true);
@@ -1460,7 +1460,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 
 				if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
 					core_dc->hwss.pipe_control_lock(
-							core_dc->ctx,
+							core_dc->hwseq,
 							pipe_ctx->pipe_idx,
 							PIPE_LOCK_CONTROL_SURFACE |
 							PIPE_LOCK_CONTROL_GRAPHICS |
@@ -1486,7 +1486,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 			if (updates[j].surface == &pipe_ctx->surface->public) {
 				if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
 					core_dc->hwss.pipe_control_lock(
-							core_dc->ctx,
+							core_dc->hwseq,
 							pipe_ctx->pipe_idx,
 							PIPE_LOCK_CONTROL_GRAPHICS |
 							PIPE_LOCK_CONTROL_SCL |
drivers/gpu/drm/amd/dal/dc/dc_helper.c +16 -0
index 6ac801422c63..b3f7d40673e8 100644
@@ -61,6 +61,22 @@ uint32_t generic_reg_get3(const struct dc_context *ctx, uint32_t addr,
 	return reg_val;
 }
 
+uint32_t generic_reg_get5(const struct dc_context *ctx, uint32_t addr,
+		uint8_t shift1, uint32_t mask1, uint32_t *field_value1,
+		uint8_t shift2, uint32_t mask2, uint32_t *field_value2,
+		uint8_t shift3, uint32_t mask3, uint32_t *field_value3,
+		uint8_t shift4, uint32_t mask4, uint32_t *field_value4,
+		uint8_t shift5, uint32_t mask5, uint32_t *field_value5)
+{
+	uint32_t reg_val = dm_read_reg(ctx, addr);
+	*field_value1 = get_reg_field_value_ex(reg_val, mask1, shift1);
+	*field_value2 = get_reg_field_value_ex(reg_val, mask2, shift2);
+	*field_value3 = get_reg_field_value_ex(reg_val, mask3, shift3);
+	*field_value4 = get_reg_field_value_ex(reg_val, mask4, shift4);
+	*field_value5 = get_reg_field_value_ex(reg_val, mask5, shift5);
+	return reg_val;
+}
+
 /* note:  va version of this is pretty bad idea, since there is a output parameter pass by pointer
  * compiler won't be able to check for size match and is prone to stack corruption type of bugs
 
drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c +81 -0

90 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h +86 -12

137 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce100/dce100_hw_sequencer.c +0 -114

153 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c +5 -145

195 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c +30 -5
index e0e3178b9134..e19a69419c5c 100644
@@ -425,16 +425,39 @@ static struct stream_encoder *dce110_stream_encoder_create(
 #define SRII(reg_name, block, id)\
 	.reg_name[id] = mm ## block ## id ## _ ## reg_name
 
-static const struct dce_hwseq_registers hwseq_reg = {
-		HWSEQ_COMMON_REG_LIST_BASE()
+#define HWSEQ_DCE11_REG_LIST_BASE() \
+		HWSEQ_DCEF_REG_LIST(),\
+		SRII(CRTC_H_BLANK_START_END, CRTC, 0),\
+		SRII(CRTC_H_BLANK_START_END, CRTC, 1),\
+		SRII(BLND_V_UPDATE_LOCK, BLND, 0),\
+		SRII(BLND_V_UPDATE_LOCK, BLND, 1),\
+		SRII(BLND_CONTROL, BLND, 0),\
+		SRII(BLND_CONTROL, BLND, 1),\
+		.BLNDV_CONTROL = mmBLNDV_CONTROL
+
+static const struct dce_hwseq_registers hwseq_stoney_reg = {
+		HWSEQ_DCE11_REG_LIST_BASE(),
+		.CRTC_H_BLANK_START_END[2] = mmCRTCV_H_BLANK_START_END,
+		.BLND_V_UPDATE_LOCK[2] = mmBLNDV_V_UPDATE_LOCK,
+		.BLND_CONTROL[2] = mmBLNDV_CONTROL,
+};
+
+static const struct dce_hwseq_registers hwseq_cz_reg = {
+		HWSEQ_DCE11_REG_LIST_BASE(),
+		SRII(CRTC_H_BLANK_START_END, CRTC, 2),
+		SRII(BLND_V_UPDATE_LOCK, BLND, 2),
+		SRII(BLND_CONTROL, BLND, 2),
+		.CRTC_H_BLANK_START_END[3] = mmCRTCV_H_BLANK_START_END,
+		.BLND_V_UPDATE_LOCK[3] = mmBLNDV_V_UPDATE_LOCK,
+		.BLND_CONTROL[3] = mmBLNDV_CONTROL,
 };
 
 static const struct dce_hwseq_shift hwseq_shift = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT)
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT),
 };
 
 static const struct dce_hwseq_mask hwseq_mask = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK)
+		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK),
 };
 
 static struct dce_hwseq *dce110_hwseq_create(
@@ -444,9 +467,11 @@ static struct dce_hwseq *dce110_hwseq_create(
 
 	if (hws) {
 		hws->ctx = ctx;
-		hws->regs = &hwseq_reg;
+		hws->regs = ASIC_REV_IS_STONEY(ctx->asic_id.hw_internal_rev) ?
+				&hwseq_stoney_reg : &hwseq_cz_reg;
 		hws->shifts = &hwseq_shift;
 		hws->masks = &hwseq_mask;
+		hws->wa.blnd_crtc_trigger = true;
 	}
 	return hws;
 }
drivers/gpu/drm/amd/dal/dc/dce112/dce112_hw_sequencer.c +0 -126

174 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce80/dce80_hw_sequencer.c +1 -93

136 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h +4 -9
index 7091dc731d09..dcaac8a336d1 100644
@@ -121,17 +121,12 @@ struct hw_sequencer_funcs {
 	void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
 			struct dc_link_settings *link_settings);
 
-	bool (*pipe_control_lock)(
-				struct dc_context *ctx,
-				uint8_t controller_idx,
-				uint32_t control_mask,
+	void (*pipe_control_lock)(
+				struct dce_hwseq *hwseq,
+				unsigned int blnd_inst,
+				enum pipe_lock_control control_mask,
 				bool lock);
 
-	void (*set_blender_mode)(
-				struct core_dc *dc,
-				uint8_t controller_id,
-				uint32_t mode);
-
 	void (*set_displaymarks)(
 				const struct core_dc *dc,
 				struct validate_context *context);
drivers/gpu/drm/amd/dal/dc/inc/reg_helper.h +26 -1
index 4c1286dc3bdb..f0cf64b1d54e 100644
@@ -80,6 +80,15 @@
 				FN(reg, f3), v3,\
 				FN(reg, f4), v4)
 
+#define REG_SET_5(reg, init_value, f1, v1, f2, v2, f3, v3, f4, v4,	\
+		f5, v5)	\
+		REG_SET_N(reg, 6, init_value, \
+				FN(reg, f1), v1,\
+				FN(reg, f2), v2,\
+				FN(reg, f3), v3,\
+				FN(reg, f4), v4,\
+				FN(reg, f5), v5)
+
 #define REG_SET_6(reg, init_value, f1, v1, f2, v2, f3, v3, f4, v4,	\
 		f5, v5, f6, v6)	\
 		REG_SET_N(reg, 6, init_value, \
@@ -101,7 +110,8 @@
 				FN(reg, f6), v6,\
 				FN(reg, f7), v7)
 
-#define REG_SET_10(reg, init_value, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6, f7, v7, f8, v8, f9, v9, f10, v10)	\
+#define REG_SET_10(reg, init_value, f1, v1, f2, v2, f3, v3, f4, v4, f5, \
+		v5, f6, v6, f7, v7, f8, v8, f9, v9, f10, v10)	\
 		REG_SET_N(reg, 10, init_value, \
 				FN(reg, f1), v1,\
 				FN(reg, f2), v2, \
@@ -131,6 +141,14 @@
 				FN(reg_name, f2), v2, \
 				FN(reg_name, f3), v3)
 
+#define REG_GET_5(reg_name, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5)	\
+		generic_reg_get5(CTX, REG(reg_name), \
+				FN(reg_name, f1), v1, \
+				FN(reg_name, f2), v2, \
+				FN(reg_name, f3), v3, \
+				FN(reg_name, f4), v4, \
+				FN(reg_name, f5), v5)
+
 /* macro to poll and wait for a register field to read back given value */
 
 #define REG_WAIT(reg_name, field, val, delay, max_try)	\
@@ -260,4 +278,11 @@ uint32_t generic_reg_get3(const struct dc_context *ctx, uint32_t addr,
 		uint8_t shift2, uint32_t mask2, uint32_t *field_value2,
 		uint8_t shift3, uint32_t mask3, uint32_t *field_value3);
 
+uint32_t generic_reg_get5(const struct dc_context *ctx, uint32_t addr,
+		uint8_t shift1, uint32_t mask1, uint32_t *field_value1,
+		uint8_t shift2, uint32_t mask2, uint32_t *field_value2,
+		uint8_t shift3, uint32_t mask3, uint32_t *field_value3,
+		uint8_t shift4, uint32_t mask4, uint32_t *field_value4,
+		uint8_t shift5, uint32_t mask5, uint32_t *field_value5);
+
 #endif /* DRIVERS_GPU_DRM_AMD_DAL_DEV_DC_INC_REG_HELPER_H_ */
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#69 lore raw

PATCH 68/76 drm/amd/dal: debug options

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- disable_clock_gate
- disable_power_gate

---
 drivers/gpu/drm/amd/dal/dc/dc.h                                | 8 +++++---
 drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c | 5 +++++
 2 files changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/dal/dc/dc.h +5 -3
index 4c969eb26e85..6bb3aeb53261 100644
@@ -137,13 +137,15 @@ struct dc_config {
 
 struct dc_debug {
 	bool surface_visual_confirm;
-	bool disable_stutter;
-	bool disable_dcc;
-	bool disable_dfs_bypass;
 	bool max_disp_clk;
 	bool target_trace;
 	bool surface_trace;
 	bool validation_trace;
+	bool disable_stutter;
+	bool disable_dcc;
+	bool disable_dfs_bypass;
+	bool disable_power_gate;
+	bool disable_clock_gate;
 };
 
 struct dc {
drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c +5 -0
index 7671e49ffa49..19543db48f99 100644
@@ -102,4 +102,9 @@ void dal_dc_clock_gating_dce110_power_up(
 		force_hw_base_light_sleep(ctx);
 		underlay_clock_enable(ctx);
 	}
+
+#if 0
+    if (ctx->dc->debug.disable_clock_gate)
+    	return;   /* clock gating not implemented so nothing to disable */
+#endif
 }
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#70 lore raw

PATCH 69/76 drm/amd/dal: remove dc_clock_gating in gpu

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- also fix force_hw_base_light_sleep. wrong DCE version is hooked up
- fix previous commit underlay isn't powered up when FE is powered up

---
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c         |  39 ++++++++
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h         |  72 +++++++++++---
 .../drm/amd/dal/dc/dce100/dce100_hw_sequencer.c    |  26 -----
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    |   4 +-
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    |   5 +-
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    |  24 ++---
 .../drm/amd/dal/dc/dce112/dce112_hw_sequencer.c    |   2 -
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    |   4 +-
 .../gpu/drm/amd/dal/dc/dce80/dce80_hw_sequencer.c  |   3 -
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c  |   6 +-
 drivers/gpu/drm/amd/dal/dc/gpu/Makefile            |   6 +-
 .../amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c | 110 ---------------------
 .../amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.h |  33 -------
 .../amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c |  89 -----------------
 .../amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.h |  33 -------
 .../amd/dal/dc/gpu/dce80/dc_clock_gating_dce80.c   |  52 ----------
 .../amd/dal/dc/gpu/dce80/dc_clock_gating_dce80.h   |  31 ------
 drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h      |   3 -
 18 files changed, 119 insertions(+), 423 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.h
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.h
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dce80/dc_clock_gating_dce80.c
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dce80/dc_clock_gating_dce80.h
drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c +39 -0
index 80f827ba63b4..3a453bf395bb 100644
@@ -122,3 +122,42 @@ void dce_set_blender_mode(struct dce_hwseq *hws,
 		BLND_MODE, blnd_mode,
 		BLND_MULTIPLIED_MODE, multiplied_mode);
 }
+
+
+static void dce_disable_sram_shut_down(struct dce_hwseq *hws)
+{
+	if (REG(DC_MEM_GLOBAL_PWR_REQ_CNTL))
+		REG_UPDATE(DC_MEM_GLOBAL_PWR_REQ_CNTL,
+				DC_MEM_GLOBAL_PWR_REQ_DIS, 1);
+}
+
+static void dce_underlay_clock_enable(struct dce_hwseq *hws)
+{
+	/* todo: why do we need this at boot? is dce_enable_fe_clock enough? */
+	if (REG(DCFEV_CLOCK_CONTROL))
+		REG_UPDATE(DCFEV_CLOCK_CONTROL,
+				DCFEV_CLOCK_ENABLE, 1);
+}
+
+static void enable_hw_base_light_sleep(void)
+{
+	/* TODO: implement */
+}
+
+static void disable_sw_manual_control_light_sleep(void)
+{
+	/* TODO: implement */
+}
+
+void dce_clock_gating_power_up(
+		struct dce_hwseq *hws,
+		bool enable)
+{
+	if (enable) {
+		enable_hw_base_light_sleep();
+		disable_sw_manual_control_light_sleep();
+	} else {
+		dce_disable_sram_shut_down(hws);
+		dce_underlay_clock_enable(hws);
+	}
+}
drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h +60 -12

126 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce100/dce100_hw_sequencer.c +0 -26
index a7fa7ede2ec2..e2fe024e1182 100644
@@ -122,30 +122,6 @@ static void set_bandwidth(struct core_dc *dc)
 	/* Do nothing until we have proper bandwitdth calcs */
 }
 
-static void enable_hw_base_light_sleep(void)
-{
-	/* TODO: implement */
-}
-
-static void disable_sw_manual_control_light_sleep(void)
-{
-	/* TODO: implement */
-}
-
-static void enable_sw_manual_control_light_sleep(void)
-{
-	/* TODO: implement */
-}
-
-static void dal_dc_clock_gating_dce100_power_up(struct dc_context *ctx, bool enable)
-{
-	if (enable) {
-		enable_hw_base_light_sleep();
-		disable_sw_manual_control_light_sleep();
-	} else {
-		enable_sw_manual_control_light_sleep();
-	}
-}
 
 /**************************************************************************/
 
@@ -154,8 +130,6 @@ bool dce100_hw_sequencer_construct(struct core_dc *dc)
 	dce110_hw_sequencer_construct(dc);
 
 	/* TODO: dce80 is empty implementation at the moment*/
-	dc->hwss.clock_gating_power_up = dal_dc_clock_gating_dce100_power_up;
-
 	dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating;
 	dc->hwss.set_displaymarks = set_displaymarks;
 	dc->hwss.increase_watermarks_for_pipe = set_display_mark_for_pipe_if_needed;
drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c +2 -2
index 2451327de092..4b8c1e79caaa 100644
@@ -455,11 +455,11 @@ static const struct dce_hwseq_registers hwseq_reg = {
 };
 
 static const struct dce_hwseq_shift hwseq_shift = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT)
+		HWSEQ_DCE10_MASK_SH_LIST(__SHIFT)
 };
 
 static const struct dce_hwseq_mask hwseq_mask = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK)
+		HWSEQ_DCE10_MASK_SH_LIST(_MASK)
 };
 
 static struct dce_hwseq *dce100_hwseq_create(
drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c +1 -4
index 10b55e77ecc0..7ebe090c75f2 100644
@@ -33,8 +33,6 @@
 #include "dce110_hw_sequencer.h"
 #include "dce110_timing_generator.h"
 
-#include "gpu/dce110/dc_clock_gating_dce110.h"
-
 #include "bios/bios_parser_helper.h"
 #include "timing_generator.h"
 #include "mem_input.h"
@@ -1677,7 +1675,7 @@ static void init_hw(struct core_dc *dc)
 			true);
 	}
 
-	dc->hwss.clock_gating_power_up(dc->ctx, false);
+	dce_clock_gating_power_up(dc->hwseq, false);;
 	/***************************************/
 
 	for (i = 0; i < dc->link_count; i++) {
@@ -1996,7 +1994,6 @@ static const struct hw_sequencer_funcs dce110_funcs = {
 	.enable_display_power_gating = dce110_enable_display_power_gating,
 	.power_down_front_end = dce110_power_down_fe,
 	.pipe_control_lock = dce_pipe_control_lock,
-	.clock_gating_power_up = dal_dc_clock_gating_dce110_power_up,
 	.set_display_clock = dce110_set_display_clock,
 	.set_displaymarks = dce110_set_displaymarks,
 	.increase_watermarks_for_pipe = dce110_increase_watermarks_for_pipe,
drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c +9 -15
index e19a69419c5c..3572301e09c0 100644
@@ -426,38 +426,32 @@ static struct stream_encoder *dce110_stream_encoder_create(
 	.reg_name[id] = mm ## block ## id ## _ ## reg_name
 
 #define HWSEQ_DCE11_REG_LIST_BASE() \
-		HWSEQ_DCEF_REG_LIST(),\
+		SR(DC_MEM_GLOBAL_PWR_REQ_CNTL), \
+		SR(DCFEV_CLOCK_CONTROL), \
+		SRII(DCFE_CLOCK_CONTROL, DCFE, 0), \
+		SRII(DCFE_CLOCK_CONTROL, DCFE, 1), \
 		SRII(CRTC_H_BLANK_START_END, CRTC, 0),\
 		SRII(CRTC_H_BLANK_START_END, CRTC, 1),\
 		SRII(BLND_V_UPDATE_LOCK, BLND, 0),\
 		SRII(BLND_V_UPDATE_LOCK, BLND, 1),\
 		SRII(BLND_CONTROL, BLND, 0),\
 		SRII(BLND_CONTROL, BLND, 1),\
-		.BLNDV_CONTROL = mmBLNDV_CONTROL
+		SR(BLNDV_CONTROL)
 
 static const struct dce_hwseq_registers hwseq_stoney_reg = {
-		HWSEQ_DCE11_REG_LIST_BASE(),
-		.CRTC_H_BLANK_START_END[2] = mmCRTCV_H_BLANK_START_END,
-		.BLND_V_UPDATE_LOCK[2] = mmBLNDV_V_UPDATE_LOCK,
-		.BLND_CONTROL[2] = mmBLNDV_CONTROL,
+		HWSEQ_ST_REG_LIST()
 };
 
 static const struct dce_hwseq_registers hwseq_cz_reg = {
-		HWSEQ_DCE11_REG_LIST_BASE(),
-		SRII(CRTC_H_BLANK_START_END, CRTC, 2),
-		SRII(BLND_V_UPDATE_LOCK, BLND, 2),
-		SRII(BLND_CONTROL, BLND, 2),
-		.CRTC_H_BLANK_START_END[3] = mmCRTCV_H_BLANK_START_END,
-		.BLND_V_UPDATE_LOCK[3] = mmBLNDV_V_UPDATE_LOCK,
-		.BLND_CONTROL[3] = mmBLNDV_CONTROL,
+		HWSEQ_CZ_REG_LIST()
 };
 
 static const struct dce_hwseq_shift hwseq_shift = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT),
+		HWSEQ_DCE11_MASK_SH_LIST(__SHIFT),
 };
 
 static const struct dce_hwseq_mask hwseq_mask = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK),
+		HWSEQ_DCE11_MASK_SH_LIST(_MASK),
 };
 
 static struct dce_hwseq *dce110_hwseq_create(
drivers/gpu/drm/amd/dal/dc/dce112/dce112_hw_sequencer.c +0 -2
index 4021b0b1e3a9..1b5182a0c79e 100644
@@ -30,7 +30,6 @@
 #include "dce112_hw_sequencer.h"
 
 #include "dce110/dce110_hw_sequencer.h"
-#include "gpu/dce112/dc_clock_gating_dce112.h"
 
 /* include DCE11.2 register header files */
 #include "dce/dce_11_2_d.h"
@@ -196,7 +195,6 @@ bool dce112_hw_sequencer_construct(struct core_dc *dc)
 	dce110_hw_sequencer_construct(dc);
 	dc->hwss.crtc_switch_to_clk_src = dce112_crtc_switch_to_clk_src;
 	dc->hwss.enable_display_power_gating = dce112_enable_display_power_gating;
-	dc->hwss.clock_gating_power_up = dal_dc_clock_gating_dce112_power_up;
 
 	return true;
 }
drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c +2 -2
index 01534872d3b8..514669153910 100644
@@ -480,11 +480,11 @@ static const struct dce_hwseq_registers hwseq_reg = {
 };
 
 static const struct dce_hwseq_shift hwseq_shift = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(__SHIFT)
+		HWSEQ_DCE112_MASK_SH_LIST(__SHIFT)
 };
 
 static const struct dce_hwseq_mask hwseq_mask = {
-		HWSEQ_COMMON_MASK_SH_LIST_BASE(_MASK)
+		HWSEQ_DCE112_MASK_SH_LIST(_MASK)
 };
 
 static struct dce_hwseq *dce112_hwseq_create(
drivers/gpu/drm/amd/dal/dc/dce80/dce80_hw_sequencer.c +0 -3
index a69e609b9e75..c7a2b768bcd1 100644
@@ -32,8 +32,6 @@
 #include "dce/dce_hwseq.h"
 #include "dce110/dce110_hw_sequencer.h"
 
-#include "gpu/dce80/dc_clock_gating_dce80.h"
-
 /* include DCE8 register header files */
 #include "dce/dce_8_0_d.h"
 #include "dce/dce_8_0_sh_mask.h"
@@ -132,7 +130,6 @@ bool dce80_hw_sequencer_construct(struct core_dc *dc)
 {
 	dce110_hw_sequencer_construct(dc);
 
-	dc->hwss.clock_gating_power_up = dal_dc_clock_gating_dce80_power_up;
 	dc->hwss.enable_display_power_gating = dce80_enable_display_power_gating;
 	dc->hwss.pipe_control_lock = dce_pipe_control_lock;
 	dc->hwss.set_displaymarks = set_displaymarks;
drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c +3 -3
index 100c8c01aa21..1279136d1764 100644
@@ -442,15 +442,15 @@ static struct stream_encoder *dce80_stream_encoder_create(
 	.reg_name[id] = mm ## block ## id ## _ ## reg_name
 
 static const struct dce_hwseq_registers hwseq_reg = {
-		HWSEQ_DCE8_REG_LIST_BASE()
+		HWSEQ_DCE8_REG_LIST()
 };
 
 static const struct dce_hwseq_shift hwseq_shift = {
-		HWSEQ_DCE8_MASK_SH_LIST_BASE(__SHIFT)
+		HWSEQ_DCE8_MASK_SH_LIST(__SHIFT)
 };
 
 static const struct dce_hwseq_mask hwseq_mask = {
-		HWSEQ_DCE8_MASK_SH_LIST_BASE(_MASK)
+		HWSEQ_DCE8_MASK_SH_LIST(_MASK)
 };
 
 static struct dce_hwseq *dce80_hwseq_create(
drivers/gpu/drm/amd/dal/dc/gpu/Makefile +3 -3
index 06f405a6cf45..ec2ef4994ade 100644
@@ -12,7 +12,7 @@ AMD_DAL_FILES += $(AMD_DAL_GPU)
 ###############################################################################
 # DCE 80 family
 ###############################################################################
-GPU_DCE80 = display_clock_dce80.o dc_clock_gating_dce80.o
+GPU_DCE80 = display_clock_dce80.o
 
 AMD_DAL_GPU_DCE80 = $(addprefix $(AMDDALPATH)/dc/gpu/dce80/,$(GPU_DCE80))
 
@@ -22,13 +22,13 @@ AMD_DAL_FILES += $(AMD_DAL_GPU_DCE80)
 ###############################################################################
 # DCE 110 family
 ###############################################################################
-GPU_DCE110 = display_clock_dce110.o dc_clock_gating_dce110.o
+GPU_DCE110 = display_clock_dce110.o
 
 AMD_DAL_GPU_DCE110 = $(addprefix $(AMDDALPATH)/dc/gpu/dce110/,$(GPU_DCE110))
 
 AMD_DAL_FILES += $(AMD_DAL_GPU_DCE110)
 
-GPU_DCE112 = display_clock_dce112.o dc_clock_gating_dce112.o
+GPU_DCE112 = display_clock_dce112.o
 
 AMD_DAL_GPU_DCE112 = $(addprefix $(AMDDALPATH)/dc/gpu/dce112/,$(GPU_DCE112))
 
drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.c deleted +0 -110

110 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/gpu/dce110/dc_clock_gating_dce110.h deleted +0 -33
deleted file mode 100644
index 1bfd75a1fb51..000000000000
@@ -1,33 +0,0 @@
-/*
- * Copyright 2012-15 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 __DAL_DC_CLOCK_GATING_DCE110_H__
-#define __DAL_DC_CLOCK_GATING_DCE110_H__
-
-void dal_dc_clock_gating_dce110_power_up(
-		struct dc_context *ctx,
-		bool enable);
-
-#endif /* __DAL_DC_CLOCK_GATING_DCE110_H__ */
drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.c deleted +0 -89

89 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/gpu/dce112/dc_clock_gating_dce112.h deleted +0 -33
deleted file mode 100644
index 118da647de18..000000000000
@@ -1,33 +0,0 @@
-/*
- * Copyright 2012-15 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 __DAL_DC_CLOCK_GATING_DCE112_H__
-#define __DAL_DC_CLOCK_GATING_DCE112_H__
-
-void dal_dc_clock_gating_dce112_power_up(
-		struct dc_context *ctx,
-		bool enable);
-
-#endif /* __DAL_DC_CLOCK_GATING_DCE110_H__ */
drivers/gpu/drm/amd/dal/dc/gpu/dce80/dc_clock_gating_dce80.c deleted +0 -52

52 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/gpu/dce80/dc_clock_gating_dce80.h deleted +0 -31
deleted file mode 100644
index f4111c5a5e63..000000000000
@@ -1,31 +0,0 @@
-/*
- * Copyright 2012-15 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 __DAL_DC_CLOCK_GATING_DCE80_H__
-#define __DAL_DC_CLOCK_GATING_DCE80_H__
-
-void dal_dc_clock_gating_dce80_power_up(struct dc_context *ctx, bool enable);
-
-#endif /* __DAL_DC_CLOCK_GATING_DCE80_H__ */
drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h +0 -3
index dcaac8a336d1..e568ed891a06 100644
@@ -98,9 +98,6 @@ struct hw_sequencer_funcs {
 
 	void (*crtc_switch_to_clk_src)(struct clock_source *, uint8_t);
 
-	/* power management */
-	void (*clock_gating_power_up)(struct dc_context *ctx, bool enable);
-
 	void (*enable_display_pipe_clock_gating)(
 					struct dc_context *ctx,
 					bool clock_gating);
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#71 lore raw

PATCH 70/76 drm/amd/dal: dce_crtc_switch_to_clk_src

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- fix crtc_switch_to_clk_src
- fix programming phypll ids into ppll

---
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c         | 36 +++++++++++-
 drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h         | 68 +++++++++++++++++++---
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    |  2 +-
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    | 35 +----------
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    | 13 -----
 .../drm/amd/dal/dc/dce112/dce112_hw_sequencer.c    | 35 -----------
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    |  2 +-
 drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h      |  2 -
 8 files changed, 98 insertions(+), 95 deletions(-)
drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.c +34 -2
index 3a453bf395bb..014043c13d7a 100644
@@ -149,8 +149,7 @@ static void disable_sw_manual_control_light_sleep(void)
 	/* TODO: implement */
 }
 
-void dce_clock_gating_power_up(
-		struct dce_hwseq *hws,
+void dce_clock_gating_power_up(struct dce_hwseq *hws,
 		bool enable)
 {
 	if (enable) {
@@ -161,3 +160,36 @@ void dce_clock_gating_power_up(
 		dce_underlay_clock_enable(hws);
 	}
 }
+
+void dce_crtc_switch_to_clk_src(struct dce_hwseq *hws,
+		struct clock_source *clk_src,
+		unsigned int tg_inst)
+{
+	if (clk_src->id == CLOCK_SOURCE_ID_DP_DTO) {
+		REG_UPDATE(PIXEL_RATE_CNTL[tg_inst],
+				DP_DTO0_ENABLE, 1);
+
+	} else if (clk_src->id >= CLOCK_SOURCE_COMBO_PHY_PLL0) {
+		uint32_t rate_source = clk_src->id - CLOCK_SOURCE_COMBO_PHY_PLL0;
+
+		REG_UPDATE_2(PHYPLL_PIXEL_RATE_CNTL[tg_inst],
+				PHYPLL_PIXEL_RATE_SOURCE, rate_source,
+				PIXEL_RATE_PLL_SOURCE, 0);
+
+		REG_UPDATE(PIXEL_RATE_CNTL[tg_inst],
+				DP_DTO0_ENABLE, 0);
+
+	} else if (clk_src->id <= CLOCK_SOURCE_ID_PLL2) {
+		uint32_t rate_source = clk_src->id - CLOCK_SOURCE_ID_PLL0;
+
+		REG_UPDATE_2(PIXEL_RATE_CNTL[tg_inst],
+				PIXEL_RATE_SOURCE, rate_source,
+				DP_DTO0_ENABLE, 0);
+
+		if (REG(PHYPLL_PIXEL_RATE_CNTL[tg_inst]))
+			REG_UPDATE(PHYPLL_PIXEL_RATE_CNTL[tg_inst],
+					PIXEL_RATE_PLL_SOURCE, 1);
+	} else {
+		DC_ERR("unknown clock source");
+	}
+}
drivers/gpu/drm/amd/dal/dc/dce/dce_hwseq.h +59 -9

130 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c +1 -1
index 4b8c1e79caaa..23791ca55856 100644
@@ -451,7 +451,7 @@ static struct stream_encoder *dce100_stream_encoder_create(
 	.reg_name[id] = mm ## block ## id ## _ ## reg_name
 
 static const struct dce_hwseq_registers hwseq_reg = {
-		HWSEQ_COMMON_REG_LIST_BASE()
+		HWSEQ_DCE10_REG_LIST()
 };
 
 static const struct dce_hwseq_shift hwseq_shift = {
drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c +3 -32
index 7ebe090c75f2..ef00588b8179 100644
@@ -148,35 +148,6 @@ static void dce110_init_pte(struct dc_context *ctx)
 		dm_write_reg(ctx, addr, value);
 	}
 }
-
-static void dce110_crtc_switch_to_clk_src(
-				struct clock_source *clk_src, uint8_t crtc_inst)
-{
-	uint32_t pixel_rate_cntl_value;
-	uint32_t addr;
-
-	/* These addresses are the same across DCE8 - DCE11.2 */
-	addr = mmCRTC0_PIXEL_RATE_CNTL + crtc_inst *
-			(mmCRTC1_PIXEL_RATE_CNTL - mmCRTC0_PIXEL_RATE_CNTL);
-
-	pixel_rate_cntl_value = dm_read_reg(clk_src->ctx, addr);
-
-	if (clk_src->dp_clk_src)
-		set_reg_field_value(pixel_rate_cntl_value, 1,
-			CRTC0_PIXEL_RATE_CNTL, DP_DTO0_ENABLE);
-	else {
-		set_reg_field_value(pixel_rate_cntl_value,
-				0,
-				CRTC0_PIXEL_RATE_CNTL,
-				DP_DTO0_ENABLE);
-
-		set_reg_field_value(pixel_rate_cntl_value,
-				clk_src->id - CLOCK_SOURCE_ID_PLL0,
-				CRTC0_PIXEL_RATE_CNTL,
-				CRTC0_PIXEL_RATE_SOURCE);
-	}
-	dm_write_reg(clk_src->ctx, addr, pixel_rate_cntl_value);
-}
 /**************************************************************************/
 
 static void enable_display_pipe_clock_gating(
@@ -1037,7 +1008,8 @@ static void switch_dp_clock_sources(
 					res_ctx, pipe_ctx->clock_source);
 				pipe_ctx->clock_source = clk_src;
 				resource_reference_clock_source(res_ctx, clk_src);
-				dc->hwss.crtc_switch_to_clk_src(clk_src, i);
+
+				dce_crtc_switch_to_clk_src(dc->hwseq, clk_src, i);
 			}
 		}
 	}
@@ -1278,7 +1250,7 @@ enum dc_status dce110_apply_ctx_to_hw(
 
 		if (pipe_ctx->stream == pipe_ctx_old->stream) {
 			if (pipe_ctx_old->clock_source != pipe_ctx->clock_source)
-				dc->hwss.crtc_switch_to_clk_src(
+				dce_crtc_switch_to_clk_src(dc->hwseq,
 						pipe_ctx->clock_source, i);
 			continue;
 		}
@@ -1990,7 +1962,6 @@ static const struct hw_sequencer_funcs dce110_funcs = {
 	.disable_stream = dce110_disable_stream,
 	.unblank_stream = dce110_unblank_stream,
 	.enable_display_pipe_clock_gating = enable_display_pipe_clock_gating,
-	.crtc_switch_to_clk_src = dce110_crtc_switch_to_clk_src,
 	.enable_display_power_gating = dce110_enable_display_power_gating,
 	.power_down_front_end = dce110_power_down_fe,
 	.pipe_control_lock = dce_pipe_control_lock,
drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c +0 -13
index 3572301e09c0..87ae249779a9 100644
@@ -425,19 +425,6 @@ static struct stream_encoder *dce110_stream_encoder_create(
 #define SRII(reg_name, block, id)\
 	.reg_name[id] = mm ## block ## id ## _ ## reg_name
 
-#define HWSEQ_DCE11_REG_LIST_BASE() \
-		SR(DC_MEM_GLOBAL_PWR_REQ_CNTL), \
-		SR(DCFEV_CLOCK_CONTROL), \
-		SRII(DCFE_CLOCK_CONTROL, DCFE, 0), \
-		SRII(DCFE_CLOCK_CONTROL, DCFE, 1), \
-		SRII(CRTC_H_BLANK_START_END, CRTC, 0),\
-		SRII(CRTC_H_BLANK_START_END, CRTC, 1),\
-		SRII(BLND_V_UPDATE_LOCK, BLND, 0),\
-		SRII(BLND_V_UPDATE_LOCK, BLND, 1),\
-		SRII(BLND_CONTROL, BLND, 0),\
-		SRII(BLND_CONTROL, BLND, 1),\
-		SR(BLNDV_CONTROL)
-
 static const struct dce_hwseq_registers hwseq_stoney_reg = {
 		HWSEQ_ST_REG_LIST()
 };
drivers/gpu/drm/amd/dal/dc/dce112/dce112_hw_sequencer.c +0 -35
index 1b5182a0c79e..204f613467b7 100644
@@ -66,40 +66,6 @@ static const struct dce112_hw_seq_reg_offsets reg_offsets[] = {
 /*******************************************************************************
  * Private definitions
  ******************************************************************************/
-/***************************PIPE_CONTROL***********************************/
-
-static void dce112_crtc_switch_to_clk_src(
-				struct clock_source *clk_src, uint8_t crtc_inst)
-{
-	uint32_t pixel_rate_cntl_value;
-	uint32_t phypll_pixel_rate_cntl_value = 0;
-	uint32_t addr, phypll_addr;
-
-	phypll_addr = mmCRTC0_PHYPLL_PIXEL_RATE_CNTL + crtc_inst *
-		(mmCRTC1_PHYPLL_PIXEL_RATE_CNTL - mmCRTC0_PHYPLL_PIXEL_RATE_CNTL);
-	addr = mmCRTC0_PIXEL_RATE_CNTL + crtc_inst *
-			(mmCRTC1_PIXEL_RATE_CNTL - mmCRTC0_PIXEL_RATE_CNTL);
-
-	pixel_rate_cntl_value = dm_read_reg(clk_src->ctx, addr);
-
-	if (clk_src->id == CLOCK_SOURCE_ID_DP_DTO)
-		set_reg_field_value(pixel_rate_cntl_value, 1,
-			CRTC0_PIXEL_RATE_CNTL, DP_DTO0_ENABLE);
-	else {
-
-		set_reg_field_value(pixel_rate_cntl_value,
-				clk_src->id - CLOCK_SOURCE_COMBO_PHY_PLL0,
-				CRTC0_PIXEL_RATE_CNTL,
-				CRTC0_PIXEL_RATE_SOURCE);
-
-		set_reg_field_value(phypll_pixel_rate_cntl_value,
-				clk_src->id - CLOCK_SOURCE_COMBO_PHY_PLL0,
-				CRTC0_PHYPLL_PIXEL_RATE_CNTL,
-				CRTC0_PHYPLL_PIXEL_RATE_SOURCE);
-		dm_write_reg(clk_src->ctx, phypll_addr, phypll_pixel_rate_cntl_value);
-	}
-	dm_write_reg(clk_src->ctx, addr, pixel_rate_cntl_value);
-}
 
 static void dce112_init_pte(struct dc_context *ctx)
 {
@@ -193,7 +159,6 @@ bool dce112_hw_sequencer_construct(struct core_dc *dc)
 	 * structure
 	 */
 	dce110_hw_sequencer_construct(dc);
-	dc->hwss.crtc_switch_to_clk_src = dce112_crtc_switch_to_clk_src;
 	dc->hwss.enable_display_power_gating = dce112_enable_display_power_gating;
 
 	return true;
drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c +1 -1
index 514669153910..634541eb55c5 100644
@@ -476,7 +476,7 @@ static struct stream_encoder *dce112_stream_encoder_create(
 	.reg_name[id] = mm ## block ## id ## _ ## reg_name
 
 static const struct dce_hwseq_registers hwseq_reg = {
-		HWSEQ_COMMON_REG_LIST_BASE()
+		HWSEQ_DCE112_REG_LIST()
 };
 
 static const struct dce_hwseq_shift hwseq_shift = {
drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h +0 -2
index e568ed891a06..16b10dca6e58 100644
@@ -96,8 +96,6 @@ struct hw_sequencer_funcs {
 	void (*encoder_set_lcd_backlight_level)(
 		struct link_encoder *enc, uint32_t level);
 
-	void (*crtc_switch_to_clk_src)(struct clock_source *, uint8_t);
-
 	void (*enable_display_pipe_clock_gating)(
 					struct dc_context *ctx,
 					bool clock_gating);
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#72 lore raw

PATCH 71/76 drm/amd/dal: include dm_services.h in reg_helper.h

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/dce/dce_audio.c          | 5 +----
 drivers/gpu/drm/amd/dal/dc/dce/dce_link_encoder.c   | 4 +---
 drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.c | 2 --
 drivers/gpu/drm/amd/dal/dc/inc/reg_helper.h         | 2 ++
 4 files changed, 4 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/dal/dc/dce/dce_audio.c +1 -4
index 6296d8fda690..dc44053e8575 100644
@@ -23,7 +23,7 @@
  *
  */
 
-#include "dm_services.h"
+#include "reg_helper.h"
 #include "dce_audio.h"
 #include "dce/dce_11_0_d.h"
 #include "dce/dce_11_0_sh_mask.h"
@@ -31,9 +31,6 @@
 #define DCE_AUD(audio)\
 	container_of(audio, struct dce_audio, base)
 
-
-#include "reg_helper.h"
-
 #define CTX \
 	aud->base.ctx
 #define REG(reg)\
drivers/gpu/drm/amd/dal/dc/dce/dce_link_encoder.c +1 -3
index 3b3c01a647bc..968d4187273c 100644
@@ -23,9 +23,8 @@
  *
  */
 
+#include "reg_helper.h"
 
-
-#include "dm_services.h"
 #include "core_types.h"
 #include "link_encoder.h"
 #include "dce_link_encoder.h"
@@ -38,7 +37,6 @@
 #include "dce/dce_11_0_d.h"
 #include "dce/dce_11_0_sh_mask.h"
 #include "dce/dce_11_0_enum.h"
-#include "reg_helper.h"
 
 #ifndef ATOM_S2_CURRENT_BL_LEVEL_MASK
 #define ATOM_S2_CURRENT_BL_LEVEL_MASK   0x0000FF00L
drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.c +0 -2
index 89e09150234e..050fef92f545 100644
@@ -23,8 +23,6 @@
  *
  */
 
-
-#include "dm_services.h"
 #include "dc_bios_types.h"
 #include "dce_stream_encoder.h"
 #include "reg_helper.h"
drivers/gpu/drm/amd/dal/dc/inc/reg_helper.h +2 -0
index f0cf64b1d54e..7a05141484c9 100644
@@ -25,6 +25,8 @@
 #ifndef DRIVERS_GPU_DRM_AMD_DAL_DEV_DC_INC_REG_HELPER_H_
 #define DRIVERS_GPU_DRM_AMD_DAL_DEV_DC_INC_REG_HELPER_H_
 
+#include "dm_services.h"
+
 /* macro for register read/write
  * user of macro need to define
  *
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#73 lore raw

PATCH 72/76 drm/amd/dal: consolidate mem_input

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- create dce_mem_input with regsiter offset/shift/mask abstracted
- move program_surface_config to new method

---
 drivers/gpu/drm/amd/dal/dc/dce/Makefile            |   3 +-
 drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.c     | 193 ++++++++++++++
 drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.h     | 134 ++++++++++
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    |  29 ++-
 .../gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c   | 278 +--------------------
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    |  25 +-
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    |  29 ++-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c |   2 +-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c  |  29 ++-
 drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h      |   6 +
 drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h      |   2 +
 11 files changed, 439 insertions(+), 291 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.c
 create mode 100644 drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.h
drivers/gpu/drm/amd/dal/dc/dce/Makefile +2 -1
index 738f33f64d64..be757b84790a 100644
@@ -5,7 +5,8 @@
 #   - register programming through common macros that look up register 
 #     offset/shift/mask stored in dce_hw struct
 
-DCE = dce_audio.o dce_stream_encoder.o dce_link_encoder.o dce_hwseq.o
+DCE = dce_audio.o dce_stream_encoder.o dce_link_encoder.o dce_hwseq.o \
+dce_mem_input.o
 
 AMD_DAL_DCE = $(addprefix $(AMDDALPATH)/dc/dce/,$(DCE))
 
drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.c new file +193 -0

193 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.h new file +134 -0

134 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c +26 -3
index 23791ca55856..c94695e603bd 100644
@@ -483,6 +483,24 @@ static const struct resource_create_funcs res_create_funcs = {
 	.create_hwseq = dce100_hwseq_create,
 };
 
+#define mi_inst_regs(id) { MI_REG_LIST(id) }
+static const struct dce_mem_input_registers mi_regs[] = {
+		mi_inst_regs(0),
+		mi_inst_regs(1),
+		mi_inst_regs(2),
+		mi_inst_regs(3),
+		mi_inst_regs(4),
+		mi_inst_regs(5),
+};
+
+static const struct dce_mem_input_shift mi_shifts = {
+		MI_DCE_MASK_SH_LIST(__SHIFT)
+};
+
+static const struct dce_mem_input_mask mi_masks = {
+		MI_DCE_MASK_SH_LIST(_MASK)
+};
+
 static struct mem_input *dce100_mem_input_create(
 	struct dc_context *ctx,
 	uint32_t inst,
@@ -494,9 +512,14 @@ static struct mem_input *dce100_mem_input_create(
 	if (!mem_input110)
 		return NULL;
 
-	if (dce110_mem_input_construct(mem_input110,
-				       ctx, inst, offset))
-		return &mem_input110->base;
+	if (dce110_mem_input_construct(mem_input110, ctx, inst, offset)) {
+		struct mem_input *mi = &mem_input110->base;
+
+		mi->regs = &mi_regs[inst];
+		mi->shifts = &mi_shifts;
+		mi->masks = &mi_masks;
+		return mi;
+	}
 
 	BREAK_TO_DEBUGGER();
 	dm_free(mem_input110);
drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c +1 -277

296 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c +22 -3
index 87ae249779a9..f9cebc9680a6 100644
@@ -464,6 +464,20 @@ static const struct resource_create_funcs res_create_funcs = {
 	.create_hwseq = dce110_hwseq_create,
 };
 
+#define mi_inst_regs(id) { MI_REG_LIST(id) }
+static const struct dce_mem_input_registers mi_regs[] = {
+		mi_inst_regs(0),
+		mi_inst_regs(1),
+		mi_inst_regs(2),
+};
+
+static const struct dce_mem_input_shift mi_shifts = {
+		MI_DCE_MASK_SH_LIST(__SHIFT)
+};
+
+static const struct dce_mem_input_mask mi_masks = {
+		MI_DCE_MASK_SH_LIST(_MASK)
+};
 
 static struct mem_input *dce110_mem_input_create(
 	struct dc_context *ctx,
@@ -476,9 +490,14 @@ static struct mem_input *dce110_mem_input_create(
 	if (!mem_input110)
 		return NULL;
 
-	if (dce110_mem_input_construct(mem_input110,
-				       ctx, inst, offset))
-		return &mem_input110->base;
+	if (dce110_mem_input_construct(mem_input110, ctx, inst, offset)) {
+		struct mem_input *mi = &mem_input110->base;
+
+		mi->regs = &mi_regs[inst];
+		mi->shifts = &mi_shifts;
+		mi->masks = &mi_masks;
+		return mi;
+	}
 
 	BREAK_TO_DEBUGGER();
 	dm_free(mem_input110);
drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c +26 -3
index 634541eb55c5..e0b3266fdef0 100644
@@ -508,6 +508,24 @@ static const struct resource_create_funcs res_create_funcs = {
 	.create_hwseq = dce112_hwseq_create,
 };
 
+#define mi_inst_regs(id) { MI_REG_LIST(id) }
+static const struct dce_mem_input_registers mi_regs[] = {
+		mi_inst_regs(0),
+		mi_inst_regs(1),
+		mi_inst_regs(2),
+		mi_inst_regs(3),
+		mi_inst_regs(4),
+		mi_inst_regs(5),
+};
+
+static const struct dce_mem_input_shift mi_shifts = {
+		MI_DCE_MASK_SH_LIST(__SHIFT)
+};
+
+static const struct dce_mem_input_mask mi_masks = {
+		MI_DCE_MASK_SH_LIST(_MASK)
+};
+
 static struct mem_input *dce112_mem_input_create(
 	struct dc_context *ctx,
 	uint32_t inst,
@@ -519,9 +537,14 @@ static struct mem_input *dce112_mem_input_create(
 	if (!mem_input110)
 		return NULL;
 
-	if (dce112_mem_input_construct(mem_input110,
-				       ctx, inst, offset))
-		return &mem_input110->base;
+	if (dce112_mem_input_construct(mem_input110, ctx, inst, offset)) {
+		struct mem_input *mi = &mem_input110->base;
+
+		mi->regs = &mi_regs[inst];
+		mi->shifts = &mi_shifts;
+		mi->masks = &mi_masks;
+		return mi;
+	}
 
 	BREAK_TO_DEBUGGER();
 	dm_free(mem_input110);
drivers/gpu/drm/amd/dal/dc/dce80/dce80_mem_input.c +1 -1
index 7cc3ae89b7ee..8da0e31f1b6a 100644
@@ -173,7 +173,7 @@ static struct mem_input_funcs dce80_mem_input_funcs = {
 	.mem_input_program_surface_flip_and_addr =
 			dce110_mem_input_program_surface_flip_and_addr,
 	.mem_input_program_surface_config =
-			dce110_mem_input_program_surface_config,
+			dce_mem_input_program_surface_config,
 	.mem_input_is_flip_pending =
 			dce110_mem_input_is_flip_pending,
 	.mem_input_update_dchub = NULL
drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c +26 -3
index 1279136d1764..3de40302eb89 100644
@@ -474,6 +474,24 @@ static const struct resource_create_funcs res_create_funcs = {
 	.create_hwseq = dce80_hwseq_create,
 };
 
+#define mi_inst_regs(id) { MI_REG_LIST(id) }
+static const struct dce_mem_input_registers mi_regs[] = {
+		mi_inst_regs(0),
+		mi_inst_regs(1),
+		mi_inst_regs(2),
+		mi_inst_regs(3),
+		mi_inst_regs(4),
+		mi_inst_regs(5),
+};
+
+static const struct dce_mem_input_shift mi_shifts = {
+		MI_DCE_MASK_SH_LIST(__SHIFT)
+};
+
+static const struct dce_mem_input_mask mi_masks = {
+		MI_DCE_MASK_SH_LIST(_MASK)
+};
+
 static struct mem_input *dce80_mem_input_create(
 	struct dc_context *ctx,
 	uint32_t inst,
@@ -485,9 +503,14 @@ static struct mem_input *dce80_mem_input_create(
 	if (!mem_input80)
 		return NULL;
 
-	if (dce80_mem_input_construct(mem_input80,
-				      ctx, inst, offsets))
-		return &mem_input80->base;
+	if (dce80_mem_input_construct(mem_input80, ctx, inst, offsets)) {
+		struct mem_input *mi = &mem_input80->base;
+
+		mi->regs = &mi_regs[inst];
+		mi->shifts = &mi_shifts;
+		mi->masks = &mi_masks;
+		return mi;
+	}
 
 	BREAK_TO_DEBUGGER();
 	dm_free(mem_input80);
drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h +6 -0
index a4e91cc719d6..e7026ec87bce 100644
@@ -29,6 +29,8 @@
 #include "include/grph_object_id.h"
 #include "inc/bandwidth_calcs.h"
 
+#include "dce/dce_mem_input.h" /* temporary */
+
 struct stutter_modes {
 	bool enhanced;
 	bool quad_dmif_buffer;
@@ -42,6 +44,10 @@ struct mem_input {
 	struct dc_plane_address current_address;
 	uint32_t inst;
 	struct stutter_modes stutter_mode;
+
+	const struct dce_mem_input_registers *regs;
+	const struct dce_mem_input_shift *shifts;
+	const struct dce_mem_input_mask *masks;
 };
 
 struct mem_input_funcs {
drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h +2 -0
index 16b10dca6e58..d16e70103300 100644
@@ -44,6 +44,8 @@ enum pipe_lock_control {
 	PIPE_LOCK_CONTROL_MODE = 1 << 4
 };
 
+struct dce_hwseq;
+
 struct hw_sequencer_funcs {
 
 	void (*init_hw)(struct core_dc *dc);
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#74 lore raw

PATCH 73/76 drm/amd/dal: Add reg check before access.

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.c | 4 ----
 drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.h | 8 --------
 2 files changed, 12 deletions(-)
drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.c +0 -4
index 050fef92f545..93ce4967e56b 100644
@@ -231,9 +231,6 @@ static void dce110_stream_encoder_dp_set_stream_attribute(
 	uint32_t h_back_porch;
 	struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc);
 
-	/* for bring up, disable dp double  TODO */
-	REG_UPDATE(DP_DB_CNTL, DP_DB_DISABLE, 1);
-
 	/* set pixel encoding */
 	switch (crtc_timing->pixel_encoding) {
 	case PIXEL_ENCODING_YCBCR422:
@@ -269,7 +266,6 @@ static void dce110_stream_encoder_dp_set_stream_attribute(
 		break;
 	}
 
-	misc1 = REG_READ(DP_MSA_MISC);
 	/* set color depth */
 
 	switch (crtc_timing->display_color_depth) {
drivers/gpu/drm/amd/dal/dc/dce/dce_stream_encoder.h +0 -8
index 2778f89e5abf..c34b52a186b6 100644
@@ -515,14 +515,6 @@ struct dce110_stream_enc_registers {
 	uint32_t HDMI_ACR_48_0;
 	uint32_t HDMI_ACR_48_1;
 	uint32_t TMDS_CNTL;
-	uint32_t DP_DB_CNTL;
-	uint32_t DP_MSA_MISC;
-	uint32_t DP_MSA_COLORIMETRY;
-	uint32_t DP_MSA_TIMING_PARAM1;
-	uint32_t DP_MSA_TIMING_PARAM2;
-	uint32_t DP_MSA_TIMING_PARAM3;
-	uint32_t DP_MSA_TIMING_PARAM4;
-	uint32_t HDMI_DB_CONTROL;
 };
 
 struct dce110_stream_encoder {
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#75 lore raw

PATCH 74/76 drm/amd/dal: Fix typo in mem_input

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/dal/dc/dce/dce_mem_input.h +3 -3
index 20b6287efc78..96c7736e223b 100644
@@ -85,7 +85,7 @@ struct dce_mem_input_registers {
 		MI_DCP_MASK_SH_LIST(mask_sh, ),\
 		MI_GFX8_TILE_MASK_SH_LIST(mask_sh, )
 
-#define MI_REG_FIED_LIST(type) \
+#define MI_REG_FIELD_LIST(type) \
 	type GRPH_ENABLE; \
 	type GRPH_X_START; \
 	type GRPH_Y_START; \
@@ -115,11 +115,11 @@ struct dce_mem_input_registers {
 	type GRPH_NUM_PIPES; \
 
 struct dce_mem_input_shift {
-	MI_REG_FIED_LIST(uint8_t)
+	MI_REG_FIELD_LIST(uint8_t)
 };
 
 struct dce_mem_input_mask {
-	MI_REG_FIED_LIST(uint32_t)
+	MI_REG_FIELD_LIST(uint32_t)
 };
 
 struct mem_input;
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#76 lore raw

PATCH 75/76 drm/amd/dal: Make bunch of scaler structs static

In reply to a message not in the archive
---
 .../drm/amd/dal/dc/dce110/dce110_transform_scl.c   | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_scl.c +11 -11
index 5e8472e835ca..9dea5018c6b9 100644
@@ -44,7 +44,7 @@
 
 #define SCL_PHASES 16
 
-const uint16_t filter_2tap_16p[18] = {
+static const uint16_t filter_2tap_16p[18] = {
 	4096, 0,
 	3840, 256,
 	3584, 512,
@@ -56,7 +56,7 @@ const uint16_t filter_2tap_16p[18] = {
 	2048, 2048
 };
 
-const uint16_t filter_3tap_16p_upscale[27] = {
+static const uint16_t filter_3tap_16p_upscale[27] = {
 	2048, 2048, 0,
 	1708, 2424, 16348,
 	1372, 2796, 16308,
@@ -68,7 +68,7 @@ const uint16_t filter_3tap_16p_upscale[27] = {
 	0, 4096, 0
 };
 
-const uint16_t filter_3tap_16p_117[27] = {
+static const uint16_t filter_3tap_16p_117[27] = {
 	2048, 2048, 0,
 	1824, 2276, 16376,
 	1600, 2496, 16380,
@@ -80,7 +80,7 @@ const uint16_t filter_3tap_16p_117[27] = {
 	428, 3236, 428
 };
 
-const uint16_t filter_3tap_16p_150[27] = {
+static const uint16_t filter_3tap_16p_150[27] = {
 	2048, 2048, 0,
 	1872, 2184, 36,
 	1692, 2308, 88,
@@ -92,7 +92,7 @@ const uint16_t filter_3tap_16p_150[27] = {
 	696, 2696, 696
 };
 
-const uint16_t filter_3tap_16p_183[27] = {
+static const uint16_t filter_3tap_16p_183[27] = {
 	2048, 2048, 0,
 	1892, 2104, 92,
 	1744, 2152, 196,
@@ -104,7 +104,7 @@ const uint16_t filter_3tap_16p_183[27] = {
 	900, 2292, 900
 };
 
-const uint16_t filter_4tap_16p_upscale[36] = {
+static const uint16_t filter_4tap_16p_upscale[36] = {
 	0, 4096, 0, 0,
 	16240, 4056, 180, 16380,
 	16136, 3952, 404, 16364,
@@ -116,7 +116,7 @@ const uint16_t filter_4tap_16p_upscale[36] = {
 	16128, 2304, 2304, 16128
 };
 
-const uint16_t filter_4tap_16p_117[36] = {
+static const uint16_t filter_4tap_16p_117[36] = {
 	428, 3236, 428, 0,
 	276, 3232, 604, 16364,
 	148, 3184, 800, 16340,
@@ -128,7 +128,7 @@ const uint16_t filter_4tap_16p_117[36] = {
 	16212, 2216, 2216, 16212
 };
 
-const uint16_t filter_4tap_16p_150[36] = {
+static const uint16_t filter_4tap_16p_150[36] = {
 	696, 2700, 696, 0,
 	560, 2700, 848, 16364,
 	436, 2676, 1008, 16348,
@@ -140,7 +140,7 @@ const uint16_t filter_4tap_16p_150[36] = {
 	16376, 2052, 2052, 16376
 };
 
-const uint16_t filter_4tap_16p_183[36] = {
+static const uint16_t filter_4tap_16p_183[36] = {
 	940, 2208, 940, 0,
 	832, 2200, 1052, 4,
 	728, 2180, 1164, 16,
@@ -325,7 +325,7 @@ static void set_coeff_update_complete(struct dce110_transform *xfm110)
 	dm_write_reg(xfm110->base.ctx, addr, value);
 }
 
-const uint16_t *get_filter_3tap_16p(struct fixed31_32 ratio)
+static const uint16_t *get_filter_3tap_16p(struct fixed31_32 ratio)
 {
 	if (ratio.value < dal_fixed31_32_one.value)
 		return filter_3tap_16p_upscale;
@@ -337,7 +337,7 @@ const uint16_t *get_filter_3tap_16p(struct fixed31_32 ratio)
 		return filter_3tap_16p_183;
 }
 
-const uint16_t *get_filter_4tap_16p(struct fixed31_32 ratio)
+static const uint16_t *get_filter_4tap_16p(struct fixed31_32 ratio)
 {
 	if (ratio.value < dal_fixed31_32_one.value)
 		return filter_4tap_16p_upscale;
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#77 lore raw

PATCH 76/76 drm/amd/dal: Expose Polaris validate functions

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.h +16 -0
index 9d2427752389..f21eb57857d4 100644
@@ -35,5 +35,21 @@ struct resource_pool *dce112_create_resource_pool(
 	uint8_t num_virtual_links,
 	struct core_dc *dc);
 
+enum dc_status dce112_validate_with_context(
+		const struct core_dc *dc,
+		const struct dc_validation_set set[],
+		int set_count,
+		struct validate_context *context);
+
+enum dc_status dce112_validate_guaranteed(
+		const struct core_dc *dc,
+		const struct dc_target *dc_target,
+		struct validate_context *context);
+
+enum dc_status dce112_validate_bandwidth(
+	const struct core_dc *dc,
+	struct validate_context *context);
+
+
 #endif /* __DC_RESOURCE_DCE112_H__ */
 
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#78 lore raw
In reply to a message not in the archive

I hate to shime in but from review point of view what i don't undersntand is why isn't there a single reviewable patchset for DAL ?

What i mean by that is a patchset in which you collapse all fixes and cleanup so that there is an easy way to review thing. Yes this means loosing history and major work to just spawn a new patchset but quite frankly in this state this thing is just unreviewable. The only sane way today is to look at git tree with the whole thing applied and avoid looking at individual patch. That not a sane way to do review in my mind.

That just my opinion other might disagree but i thought i would say that outloud.

Cheers,
Jérôme
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

#80 lore raw

Hi Jerome,

I understand the frustration but the intention of this set isn't to review the entirety of dal. Alex has been pulling our patches into his amd-staging-4.7 branch and dal has been used in our PRO driver stack. This is just making these patches a bit more public and inviting feedback instead of pulling them quietly into some public tree.

Cheers,
Harry

Quoted 10 lines · Jerome Glisse

I hate to shime in but from review point of view what i don't undersntand is why isn't there a single reviewable patchset for DAL ?

What i mean by that is a patchset in which you collapse all fixes and cleanup so that there is an easy way to review thing. Yes this means loosing history and major work to just spawn a new patchset but quite frankly in this state this thing is just unreviewable. The only sane way today is to look at git tree with the whole thing applied and avoid looking at individual patch. That not a sane way to do review in my mind.

Quoted 4 lines

That just my opinion other might disagree but i thought i would say that outloud.

Cheers,
Jérôme

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#81 lore raw
In reply to a message not in the archive
Quoted 9 lines · Jerome Glisse

I hate to shime in but from review point of view what i don't undersntand is why isn't there a single reviewable patchset for DAL ?

What i mean by that is a patchset in which you collapse all fixes and cleanup so that there is an easy way to review thing. Yes this means loosing history and major work to just spawn a new patchset but quite frankly in this state this thing is just unreviewable. The only sane way today is to look at git tree with the whole thing applied and avoid looking at individual patch. That not a sane way to do review in my mind.

As Harry mentioned, the display team is starting the process of moving their development to this mailing list so Harry will start sending regular development patches from the display team until they get fully ramped up on using the public mailing list.

As for upstreaming the new display code, we are still working on addressing all of the previous concerns, but it takes a while as we have a lot of customer deliverables and new asic work so the clean up and reorg has had to happen in parallel as time permits. I don't know that it makes a lot of sense to re-generate new patches for upstream again at this point if they are not likely to make it upstream. The idea of flagging the new display code as staging code was suggested a while ago so that we could work on clean up and better integration upstream, but I think that got shot down. We don't have the resources to rewrite the entire thing from scratch, so it needs to be an iterative process. Right now we share the Linux display code with the our pre-and post silicon validation and diagnostics teams (and we have plans to move other platforms to this code as well down the road) so we need to make sure we don't break them while we reorg the code for upstream.

For the most part, I agree with many of the changes we need to make to get the code upstream, it's just frustrating for us and for our users to have to use out of tree code to enable most advanced display functionality while we work through those issues. I understand the arguments for general upstream maintainability absent our support, but that has to be countered with being able to support features and asics now. Moreover, we've been working upstream for a long time now, so I don't think it's that likely that we are just going to disappear and leave hard to maintain code. We end up having to spend a lot of resources on maintaining big out of tree packages for OEMs and other customers that we could be spent on getting the code ready for upstream. It's a vicious cycle.

Alex

Quoted 9 lines

That just my opinion other might disagree but i thought i would say that outloud.

Cheers,
Jérôme
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx