Skip to contentSkip to conversation

DC Patches Feb 13, 2017

PATCH New Harry Wentland 1 participant 11 messages Feb 13, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover DC Patches Feb 13, 2017

A bunch of fixes today and one cleanup in regamma code.

Charlene Liu (1):
drm/amd/display: color distortion after DPMS+ background color fix

Dmytro Laktyushkin (2):
drm/amd/display: use disp clock value in context rather than
bw_results
drm/amd/display: fix psr status wait

Harry Wentland (1):
Revert "drm/amd/display: Changes for enable dcc mode."

Hersen Wu (1):
drm/amd/display: Audio is not switching to DP when HDMI/DP hot
plug/unplug

Reza Amini (1):
drm/amd/display: handle unsupported sink types

Sylvia Tsai (1):
drm/amd/display: Set ignore_msa_timing flag for freesync modes

Tony Cheng (1):
drm/amd/display: report cursor size base on the ASIC

Vitaly Prosyak (1):
drm/amd/display: Enable regamma 25 segments and use double buffer.

Zeyu Fan (1):
drm/amd/display: Fix program pix clk logic to unblock deep color set.

 drivers/gpu/drm/amd/display/dc/calcs/Makefile      |   2 +-
 .../gpu/drm/amd/display/dc/calcs/custom_float.c    | 197 ++++++++++++++
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  14 +-
 drivers/gpu/drm/amd/display/dc/core/dc_sink.c      |   4 +
 drivers/gpu/drm/amd/display/dc/dc.h                |   2 +
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  10 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h      |   7 +-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |  18 +-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h  |  46 +---
 .../drm/amd/display/dc/dce100/dce100_resource.c    |   3 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 283 ++++++---------------
 .../amd/display/dc/dce110/dce110_hw_sequencer.h    |   3 -
 .../drm/amd/display/dc/dce110/dce110_resource.c    |   2 +
 .../drm/amd/display/dc/dce112/dce112_resource.c    |   2 +
 .../gpu/drm/amd/display/dc/dce80/dce80_resource.c  |   3 +-
 drivers/gpu/drm/amd/display/dc/dm_services.h       |   2 +-
 drivers/gpu/drm/amd/display/dc/inc/custom_float.h  |  40 +++
 .../drm/amd/display/modules/freesync/freesync.c    |   6 +-
 18 files changed, 387 insertions(+), 257 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/calcs/custom_float.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/inc/custom_float.h
Signature · 6 lines
2.9.3

_______________________________________________
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): 20170213160229.11218-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/10 Revert "drm/amd/display: Changes for enable dcc mode."

I goofed this one up when pulling from the internal DC repo.

This reverts commit a73e57356fb89b6aaec3434256efb5210200d77d.

Change-Id: Ib0a30b69677b8365b5b1809e476962a488d5505d

---
 drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h      |  7 +++++-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h  | 26 +++-------------------
 2 files changed, 9 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.h +6 -1
index b026157a2eea..33c1754f04f1 100644
@@ -30,6 +30,7 @@
 #include "dmcu.h"
 
 #define DMCU_COMMON_REG_LIST_DCE_BASE() \
+	SR(DMCU_CTRL), \
 	SR(DMCU_RAM_ACCESS_CTRL), \
 	SR(DMCU_IRAM_WR_CTRL), \
 	SR(DMCU_IRAM_WR_DATA)
@@ -42,6 +43,8 @@
 	.field_name = reg_name ## __ ## field_name ## post_fix
 
 #define DMCU_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh) \
+	DMCU_SF(DMCU_CTRL, \
+			DMCU_ENABLE, mask_sh), \
 	DMCU_SF(DMCU_RAM_ACCESS_CTRL, \
 			IRAM_HOST_ACCESS_EN, mask_sh), \
 	DMCU_SF(DMCU_RAM_ACCESS_CTRL, \
@@ -55,7 +58,8 @@
 #define DMCU_REG_FIELD_LIST(type) \
 	type DMCU_IRAM_MEM_PWR_STATE; \
 	type IRAM_HOST_ACCESS_EN; \
-	type IRAM_WR_ADDR_AUTO_INC
+	type IRAM_WR_ADDR_AUTO_INC; \
+	type DMCU_ENABLE
 
 struct dce_dmcu_shift {
 	DMCU_REG_FIELD_LIST(uint8_t);
@@ -66,6 +70,7 @@ struct dce_dmcu_mask {
 };
 
 struct dce_dmcu_registers {
+	uint32_t DMCU_CTRL;
 	uint32_t DMCU_RAM_ACCESS_CTRL;
 	uint32_t DCI_MEM_PWR_STATUS;
 	uint32_t DMU_MEM_PWR_CNTL;
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +3 -23
index 053f72b91b3c..8a07665e693b 100644
@@ -39,18 +39,13 @@
 	SRI(DC_HPD_CONTROL, HPD, id)
 
 #define LE_COMMON_REG_LIST_BASE(id) \
-	SR(BL_PWM_CNTL), \
-	SR(BL_PWM_GRP1_REG_LOCK), \
-	SR(BL_PWM_PERIOD_CNTL), \
-	SR(LVTMA_PWRSEQ_CNTL), \
-	SR(LVTMA_PWRSEQ_STATE), \
-	SR(BL_PWM_CNTL2), \
-	SR(LVTMA_PWRSEQ_REF_DIV), \
 	SR(MASTER_COMM_DATA_REG1), \
 	SR(MASTER_COMM_DATA_REG2), \
 	SR(MASTER_COMM_DATA_REG3), \
 	SR(MASTER_COMM_CMD_REG), \
 	SR(MASTER_COMM_CNTL_REG), \
+	SR(LVTMA_PWRSEQ_CNTL), \
+	SR(LVTMA_PWRSEQ_STATE), \
 	SR(DMCU_RAM_ACCESS_CTRL), \
 	SR(DMCU_IRAM_RD_CTRL), \
 	SR(DMCU_IRAM_RD_DATA), \
@@ -81,22 +76,16 @@
 		LE_COMMON_REG_LIST_BASE(id), \
 		SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
 		SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
-		SR(BIOS_SCRATCH_2), \
-		SR(BL1_PWM_USER_LEVEL), \
 		SR(DCI_MEM_PWR_STATUS)
 
 	#define LE_DCE110_REG_LIST(id)\
 		LE_COMMON_REG_LIST_BASE(id), \
 		SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
 		SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
-		SR(BIOS_SCRATCH_2), \
-		SR(BL1_PWM_USER_LEVEL), \
 		SR(DCI_MEM_PWR_STATUS)
 
 	#define LE_DCE80_REG_LIST(id)\
-		SR(BIOS_SCRATCH_2), \
 		SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
-		SR(BL1_PWM_USER_LEVEL), \
 		LE_COMMON_REG_LIST_BASE(id)
 
 
@@ -110,24 +99,16 @@ struct dce110_link_enc_hpd_registers {
 };
 
 struct dce110_link_enc_registers {
-	/* BL registers */
-	uint32_t BL_PWM_CNTL;
-	uint32_t BL_PWM_GRP1_REG_LOCK;
-	uint32_t BL_PWM_PERIOD_CNTL;
+	/* Backlight registers */
 	uint32_t LVTMA_PWRSEQ_CNTL;
 	uint32_t LVTMA_PWRSEQ_STATE;
-	uint32_t BL_PWM_CNTL2;
-	uint32_t LVTMA_PWRSEQ_REF_DIV;
 
 	/* DMCU registers */
-	uint32_t BL1_PWM_USER_LEVEL;
-	uint32_t ABM0_BL1_PWM_USER_LEVEL;
 	uint32_t MASTER_COMM_DATA_REG1;
 	uint32_t MASTER_COMM_DATA_REG2;
 	uint32_t MASTER_COMM_DATA_REG3;
 	uint32_t MASTER_COMM_CMD_REG;
 	uint32_t MASTER_COMM_CNTL_REG;
-	uint32_t BIOS_SCRATCH_2;
 	uint32_t DMCU_RAM_ACCESS_CTRL;
 	uint32_t DCI_MEM_PWR_STATUS;
 	uint32_t DMU_MEM_PWR_CNTL;
@@ -136,7 +117,6 @@ struct dce110_link_enc_registers {
 	uint32_t DMCU_INTERRUPT_TO_UC_EN_MASK;
 	uint32_t SMU_INTERRUPT_CONTROL;
 
-
 	/* Common DP registers */
 	uint32_t DIG_BE_CNTL;
 	uint32_t DIG_BE_EN_CNTL;
Signature · 6 lines
2.9.3

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

PATCH 2/10 drm/amd/display: use disp clock value in context rather than bw_results

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Change-Id I05aeb2db7f2d43ec586436b406bb3b78886ff41b
---
 drivers/gpu/drm/amd/display/dc/core/dc.c                   | 14 ++++++--------
 drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c    |  2 +-
 .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c    | 10 +++++-----
 drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c    |  1 +
 drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c    |  1 +
 drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c      |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -8
index 9d2f78f21748..4c405f4b880e 100644
@@ -925,7 +925,7 @@ void pplib_apply_display_requirements(
 	/* TODO: dce11.2*/
 	pp_display_cfg->avail_mclk_switch_time_in_disp_active_us = 0;
 
-	pp_display_cfg->disp_clk_khz = context->bw_results.dispclk_khz;
+	pp_display_cfg->disp_clk_khz = context->dispclk_khz;
 
 	fill_display_configs(context, pp_display_cfg);
 
@@ -1065,8 +1065,7 @@ bool dc_pre_update_surfaces_to_stream(
 {
 	int i, j;
 	struct core_dc *core_dc = DC_TO_CORE(dc);
-	int prev_disp_clk = core_dc->current_context->bw_results.dispclk_khz;
-	int new_disp_clk;
+	int prev_disp_clk = core_dc->current_context->dispclk_khz;
 	struct dc_stream_status *stream_status = NULL;
 	struct validate_context *context;
 	struct validate_context *temp_context;
@@ -1152,17 +1151,16 @@ bool dc_pre_update_surfaces_to_stream(
 			ret = false;
 			goto unexpected_fail;
 		}
-	new_disp_clk = context->bw_results.dispclk_khz;
 
 	if (!IS_FPGA_MAXIMUS_DC(core_dc->ctx->dce_environment)
-			&& prev_disp_clk < new_disp_clk) {
+			&& prev_disp_clk < context->dispclk_khz) {
 		pplib_apply_display_requirements(core_dc, context,
 						&context->pp_display_cfg);
 		context->res_ctx.pool->display_clock->funcs->set_clock(
 				context->res_ctx.pool->display_clock,
-				new_disp_clk * 115 / 100);
-		core_dc->current_context->bw_results.dispclk_khz = new_disp_clk;
-		core_dc->current_context->dispclk_khz = new_disp_clk;
+				context->dispclk_khz * 115 / 100);
+		core_dc->current_context->bw_results.dispclk_khz = context->dispclk_khz;
+		core_dc->current_context->dispclk_khz = context->dispclk_khz;
 	}
 
 	for (i = 0; i < new_surface_count; i++)
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +1 -1
index 800b22e70c7e..55501b381692 100644
@@ -770,7 +770,7 @@ enum dc_status dce100_validate_bandwidth(
 	struct validate_context *context)
 {
 	/* TODO implement when needed but for now hardcode max value*/
-	context->bw_results.dispclk_khz = 681000;
+	context->dispclk_khz = 681000;
 
 	return DC_OK;
 }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +5 -5
index a1a5dc6fcb67..5e99f6c27c9a 100644
@@ -1651,7 +1651,7 @@ static void apply_min_clocks(
 	/* get the required state based on state dependent clocks:
 	 * display clock and pixel clock
 	 */
-	req_clocks.display_clk_khz = context->bw_results.dispclk_khz;
+	req_clocks.display_clk_khz = context->dispclk_khz;
 
 	req_clocks.pixel_clk_khz = get_max_pixel_clock_for_all_paths(
 			dc, context, true);
@@ -1776,11 +1776,11 @@ enum dc_status dce110_apply_ctx_to_hw(
 	/*TODO: when pplib works*/
 	apply_min_clocks(dc, context, &clocks_state, true);
 
-	if (context->bw_results.dispclk_khz
-			> dc->current_context->bw_results.dispclk_khz)
+	if (context->dispclk_khz
+			> dc->current_context->dispclk_khz)
 		context->res_ctx.pool->display_clock->funcs->set_clock(
 				context->res_ctx.pool->display_clock,
-				context->bw_results.dispclk_khz * 115 / 100);
+				context->dispclk_khz * 115 / 100);
 
 	for (i = 0; i < context->res_ctx.pool->pipe_count; i++) {
 		struct pipe_ctx *pipe_ctx_old =
@@ -2289,7 +2289,7 @@ static void dce110_set_bandwidth(struct core_dc *dc)
 
 	dc->current_context->res_ctx.pool->display_clock->funcs->set_clock(
 			dc->current_context->res_ctx.pool->display_clock,
-			dc->current_context->bw_results.dispclk_khz * 115 / 100);
+			dc->current_context->dispclk_khz * 115 / 100);
 }
 
 static void dce110_program_front_end_for_pipe(
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +1 -0
index 4c108d0fb164..ee4fda514de6 100644
@@ -926,6 +926,7 @@ enum dc_status dce110_validate_bandwidth(
 		result =  DC_FAIL_BANDWIDTH_VALIDATE;
 	else
 		result =  DC_OK;
+	context->dispclk_khz = context->bw_results.dispclk_khz;
 
 	if (result == DC_FAIL_BANDWIDTH_VALIDATE)
 		dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_VALIDATION,
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +1 -0
index 7e99b2b96794..54af84ebf2bc 100644
@@ -857,6 +857,7 @@ enum dc_status dce112_validate_bandwidth(
 		result =  DC_FAIL_BANDWIDTH_VALIDATE;
 	else
 		result =  DC_OK;
+	context->dispclk_khz = context->bw_results.dispclk_khz;
 
 	if (result == DC_FAIL_BANDWIDTH_VALIDATE)
 		dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_VALIDATION,
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +1 -1
index fea60aa5d297..3de8bfb47dce 100644
@@ -785,7 +785,7 @@ enum dc_status dce80_validate_bandwidth(
 	struct validate_context *context)
 {
 	/* TODO implement when needed but for now hardcode max value*/
-	context->bw_results.dispclk_khz = 681000;
+	context->dispclk_khz = 681000;
 	context->bw_results.required_yclk = 250000 * MEMORY_TYPE_MULTIPLIER;
 
 	return DC_OK;
Signature · 6 lines
2.9.3

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

PATCH 3/10 drm/amd/display: fix psr status wait

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Change-Id I66ad31b2a32b4aec0497e9bdbf69442c1b9f447a
---
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  | 18 +++++++++++++++---
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.h  | 22 +++++++++++-----------
 drivers/gpu/drm/amd/display/dc/dm_services.h       |  2 +-
 3 files changed, 27 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +15 -3
index 3847764688dd..60fdf58fc5cc 100644
@@ -38,6 +38,14 @@
 #include "dce/dce_11_0_sh_mask.h"
 #include "dce/dce_11_0_enum.h"
 
+#ifndef DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE__SHIFT
+#define DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE__SHIFT 0xa
+#endif
+
+#ifndef DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE_MASK
+#define DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE_MASK 0x00000400L
+#endif
+
 #ifndef HPD0_DC_HPD_CONTROL__DC_HPD_EN_MASK
 #define HPD0_DC_HPD_CONTROL__DC_HPD_EN_MASK  0x10000000L
 #endif
@@ -1557,15 +1565,19 @@ static void get_dmcu_psr_state(struct link_encoder *enc, uint32_t *psr_state)
 
 	uint32_t count = 0;
 	uint32_t psrStateOffset = 0xf0;
-	uint32_t value;
+	uint32_t value = -1;
 
 	/* Enable write access to IRAM */
 	REG_UPDATE(DMCU_RAM_ACCESS_CTRL, IRAM_HOST_ACCESS_EN, 1);
 
-	do {
+	while (REG(DCI_MEM_PWR_STATUS) && value != 0 && count++ < 10) {
 		dm_delay_in_microseconds(ctx, 2);
 		REG_GET(DCI_MEM_PWR_STATUS, DMCU_IRAM_MEM_PWR_STATE, &value);
-	} while (value != 0 && count++ < 10);
+	}
+	while (REG(DMU_MEM_PWR_CNTL) && value != 0 && count++ < 10) {
+		dm_delay_in_microseconds(ctx, 2);
+		REG_GET(DMU_MEM_PWR_CNTL, DMCU_IRAM_MEM_PWR_STATE, &value);
+	}
 
 	/* Write address to IRAM_RD_ADDR in DMCU_IRAM_RD_CTRL */
 	REG_WRITE(DMCU_IRAM_RD_CTRL, psrStateOffset);
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.h +11 -11
index 8a07665e693b..d382a6882d95 100644
@@ -72,17 +72,17 @@
 	SRI(DP_DPHY_FAST_TRAINING, DP, id), \
 	SRI(DP_SEC_CNTL1, DP, id)
 
-	#define LE_COMMON_REG_LIST(id)\
-		LE_COMMON_REG_LIST_BASE(id), \
-		SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
-		SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
-		SR(DCI_MEM_PWR_STATUS)
-
-	#define LE_DCE110_REG_LIST(id)\
-		LE_COMMON_REG_LIST_BASE(id), \
-		SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
-		SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
-		SR(DCI_MEM_PWR_STATUS)
+#define LE_COMMON_REG_LIST(id)\
+	LE_COMMON_REG_LIST_BASE(id), \
+	SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
+	SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
+	SR(DCI_MEM_PWR_STATUS)
+
+#define LE_DCE110_REG_LIST(id)\
+	LE_COMMON_REG_LIST_BASE(id), \
+	SRI(DP_DPHY_BS_SR_SWAP_CNTL, DP, id), \
+	SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
+	SR(DCI_MEM_PWR_STATUS)
 
 	#define LE_DCE80_REG_LIST(id)\
 		SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
drivers/gpu/drm/amd/display/dc/dm_services.h +1 -1
index 052a43af1bd3..73c0f1f83999 100644
@@ -103,7 +103,7 @@ static inline uint32_t dm_read_reg_func(
 	uint32_t value;
 
 	if (address == 0) {
-		DC_ERR("invalid register read. address = 0");
+		DC_ERR("invalid register read; address = 0\n");
 		return 0;
 	}
 
Signature · 6 lines
2.9.3

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

PATCH 4/10 drm/amd/display: Audio is not switching to DP when HDMI/DP hot plug/unplug

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

Change-Id I0bc1946decf41316a0fb27df3269418e94621625
---
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 100 +++++++++++++++------
 1 file changed, 75 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +75 -25
index 5e99f6c27c9a..6a5cec0d4e1f 100644
@@ -1732,7 +1732,6 @@ enum dc_status dce110_apply_ctx_to_hw(
 	struct dc_bios *dcb = dc->ctx->dc_bios;
 	enum dc_status status;
 	int i;
-	bool programmed_audio_dto = false;
 	enum dm_pp_clocks_state clocks_state = DM_PP_CLOCKS_STATE_INVALID;
 
 	/* Reset old context */
@@ -1782,6 +1781,80 @@ enum dc_status dce110_apply_ctx_to_hw(
 				context->res_ctx.pool->display_clock,
 				context->dispclk_khz * 115 / 100);
 
+	/* program audio wall clock. use HDMI as clock source if HDMI
+	 * audio active. Otherwise, use DP as clock source
+	 * first, loop to find any HDMI audio, if not, loop find DP audio
+	 */
+	/* Setup audio rate clock source */
+	/* Issue:
+	* Audio lag happened on DP monitor when unplug a HDMI monitor
+	*
+	* Cause:
+	* In case of DP and HDMI connected or HDMI only, DCCG_AUDIO_DTO_SEL
+	* is set to either dto0 or dto1, audio should work fine.
+	* In case of DP connected only, DCCG_AUDIO_DTO_SEL should be dto1,
+	* set to dto0 will cause audio lag.
+	*
+	* Solution:
+	* Not optimized audio wall dto setup. When mode set, iterate pipe_ctx,
+	* find first available pipe with audio, setup audio wall DTO per topology
+	* instead of per pipe.
+	*/
+	for (i = 0; i < context->res_ctx.pool->pipe_count; i++) {
+		struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
+
+		if (pipe_ctx->stream == NULL)
+			continue;
+
+		if (pipe_ctx->top_pipe)
+			continue;
+
+		if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A)
+			continue;
+
+		if (pipe_ctx->audio != NULL) {
+			struct audio_output audio_output;
+
+			build_audio_output(pipe_ctx, &audio_output);
+
+			pipe_ctx->audio->funcs->wall_dto_setup(
+				pipe_ctx->audio,
+				pipe_ctx->stream->signal,
+				&audio_output.crtc_info,
+				&audio_output.pll_info);
+			break;
+		}
+	}
+
+	/* no HDMI audio is found, try DP audio */
+	if (i == context->res_ctx.pool->pipe_count) {
+		for (i = 0; i < context->res_ctx.pool->pipe_count; i++) {
+			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
+
+			if (pipe_ctx->stream == NULL)
+				continue;
+
+			if (pipe_ctx->top_pipe)
+				continue;
+
+			if (!dc_is_dp_signal(pipe_ctx->stream->signal))
+				continue;
+
+			if (pipe_ctx->audio != NULL) {
+				struct audio_output audio_output;
+
+				build_audio_output(pipe_ctx, &audio_output);
+
+				pipe_ctx->audio->funcs->wall_dto_setup(
+					pipe_ctx->audio,
+					pipe_ctx->stream->signal,
+					&audio_output.crtc_info,
+					&audio_output.pll_info);
+				break;
+			}
+		}
+	}
+
 	for (i = 0; i < context->res_ctx.pool->pipe_count; i++) {
 		struct pipe_ctx *pipe_ctx_old =
 					&dc->current_context->res_ctx.pipe_ctx[i];
@@ -1797,21 +1870,7 @@ enum dc_status dce110_apply_ctx_to_hw(
 			continue;
 
 		if (context->res_ctx.pipe_ctx[i].audio != NULL) {
-			/* Setup audio rate clock source */
-			/* Issue:
-			* Audio lag happened on DP monitor when unplug a HDMI monitor
-			*
-			* Cause:
-			* In case of DP and HDMI connected or HDMI only, DCCG_AUDIO_DTO_SEL
-			* is set to either dto0 or dto1, audio should work fine.
-			* In case of DP connected only, DCCG_AUDIO_DTO_SEL should be dto1,
-			* set to dto0 will cause audio lag.
-			*
-			* Solution:
-			* Not optimized audio wall dto setup. When mode set, iterate pipe_ctx,
-			* find first available pipe with audio, setup audio wall DTO per topology
-			* instead of per pipe.
-			*/
+
 			struct audio_output audio_output;
 
 			build_audio_output(pipe_ctx, &audio_output);
@@ -1833,15 +1892,6 @@ enum dc_status dce110_apply_ctx_to_hw(
 					pipe_ctx->stream->signal,
 					&audio_output.crtc_info,
 					&pipe_ctx->stream->public.audio_info);
-
-			if (!programmed_audio_dto) {
-				pipe_ctx->audio->funcs->wall_dto_setup(
-					pipe_ctx->audio,
-					pipe_ctx->stream->signal,
-					&audio_output.crtc_info,
-					&audio_output.pll_info);
-				programmed_audio_dto = true;
-			}
 		}
 
 		status = apply_single_controller_ctx_to_hw(
Signature · 6 lines
2.9.3

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

PATCH 5/10 drm/amd/display: handle unsupported sink types

In reply to a message not in the archive

From: Reza Amini <[email protected]>

Change-Id I75e3abe9e122350cb06c2cd24528ceb974b70b59
---
 drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_sink.c +4 -0
index 9dff0bfd5b23..0a805ea1159a 100644
@@ -53,6 +53,10 @@ static bool construct(struct sink *sink, const struct dc_sink_init_data *init_pa
 
 	struct core_link *core_link = DC_LINK_TO_LINK(init_params->link);
 
+	if (!core_link) {
+		return false;
+	}
+
 	sink->protected.public.sink_signal = init_params->sink_signal;
 	sink->protected.link = core_link;
 	sink->protected.ctx = core_link->ctx;
Signature · 6 lines
2.9.3

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

PATCH 6/10 drm/amd/display: Enable regamma 25 segments and use double buffer.

In reply to a message not in the archive

From: Vitaly Prosyak <[email protected]>

Moved custom floating point calculation to the shared place between dce's.

Change-Id I21b6ddaec514924c520219f04c70934e5e1b6715
---
 drivers/gpu/drm/amd/display/dc/calcs/Makefile      |   2 +-
 .../gpu/drm/amd/display/dc/calcs/custom_float.c    | 197 +++++++++++++++++++++
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 171 +-----------------
 .../amd/display/dc/dce110/dce110_hw_sequencer.h    |   3 -
 drivers/gpu/drm/amd/display/dc/inc/custom_float.h  |  40 +++++
 5 files changed, 240 insertions(+), 173 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/calcs/custom_float.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/inc/custom_float.h
drivers/gpu/drm/amd/display/dc/calcs/Makefile +1 -1
index 4bb08aea6a03..2f4c8e771b8f 100644
@@ -3,7 +3,7 @@
 # It calculates Bandwidth and Watermarks values for HW programming
 #
 
-BW_CALCS = bandwidth_calcs.o bw_fixed.o
+BW_CALCS = bandwidth_calcs.o bw_fixed.o custom_float.o
 
 AMD_DAL_BW_CALCS = $(addprefix $(AMDDALPATH)/dc/calcs/,$(BW_CALCS))
 
drivers/gpu/drm/amd/display/dc/calcs/custom_float.c new file +197 -0

197 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -169

189 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +0 -3
index 68632dd28155..a6b4d0d2429f 100644
@@ -58,8 +58,5 @@ void dce110_power_down(struct core_dc *dc);
 
 void dce110_update_pending_status(struct pipe_ctx *pipe_ctx);
 
-bool dce110_translate_regamma_to_hw_format(const struct dc_transfer_func
-		*output_tf, struct pwl_params *regamma_params);
-
 #endif /* __DC_HWSS_DCE110_H__ */
 
drivers/gpu/drm/amd/display/dc/inc/custom_float.h new file +40 -0
new file mode 100644
index 000000000000..f57239672216
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2017 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 CUSTOM_FLOAT_H_
+#define CUSTOM_FLOAT_H_
+
+#include "bw_fixed.h"
+#include "hw_shared.h"
+#include "opp.h"
+
+
+bool convert_to_custom_float_format(
+	struct fixed31_32 value,
+	const struct custom_float_format *format,
+	uint32_t *result);
+
+
+#endif //CUSTOM_FLOAT_H_
Signature · 6 lines
2.9.3

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

PATCH 7/10 drm/amd/display: Set ignore_msa_timing flag for freesync modes

In reply to a message not in the archive

From: Sylvia Tsai <[email protected]>

- Set ignore_msa_timing_param to 1 only for modes that can support freesync

Change-Id I94122df078976933ba48326f3b32567bc1a9d628
---
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +5 -1
index 1ee732768f6e..b00b1df71f3e 100644
@@ -262,7 +262,11 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
 					enable_for_video = false;
 		}
 
-		if (caps->supported)
+		unsigned int nom_refresh_rate_micro_hz = (unsigned int)
+				(((unsigned long long) core_stream->public.timing.pix_clk_khz) * 1000ULL * 1000ULL * 1000ULL
+				/ core_stream->public.timing.h_total / core_stream->public.timing.v_total);
+
+		if (caps->supported && nom_refresh_rate_micro_hz >= caps->min_refresh_in_micro_hz && nom_refresh_rate_micro_hz <= caps->max_refresh_in_micro_hz)
 			core_stream->public.ignore_msa_timing_param = 1;
 
 		core_freesync->num_entities++;
Signature · 6 lines
2.9.3

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

PATCH 8/10 drm/amd/display: Fix program pix clk logic to unblock deep color set.

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

Change-Id I27a24b526d7bdb8241ffe5ad1dfac58e56d71f22
---
 drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +5 -5
index a9f39218ce82..87eba4be3249 100644
@@ -854,16 +854,16 @@ static bool dce110_program_pix_clk(
 		if (clock_source->id != CLOCK_SOURCE_ID_EXTERNAL
 			&& pix_clk_params->flags.ENABLE_SS && !dc_is_dp_signal(
 							pix_clk_params->signal_type)) {
-
 			if (!enable_spread_spectrum(clk_src,
 							pix_clk_params->signal_type,
 							pll_settings))
 				return false;
-			/* Resync deep color DTO */
-			dce110_program_pixel_clk_resync(clk_src,
-						pix_clk_params->signal_type,
-						pix_clk_params->color_depth);
 		}
+		/* Resync deep color DTO */
+		dce110_program_pixel_clk_resync(clk_src,
+					pix_clk_params->signal_type,
+					pix_clk_params->color_depth);
+
 		break;
 	case DCE_VERSION_11_2:
 		if (clock_source->id != CLOCK_SOURCE_ID_DP_DTO) {
Signature · 6 lines
2.9.3

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

PATCH 9/10 drm/amd/display: report cursor size base on the ASIC

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id I257828f5e768e746b9ee0596e4b1dbd26fcbbf01
---
 drivers/gpu/drm/amd/display/dc/dc.h                     | 2 ++
 drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c   | 1 +
 5 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
index d7f848495d8a..13e7134fccb8 100644
@@ -47,6 +47,8 @@ struct dc_caps {
 	uint32_t max_slave_planes;
 	uint32_t max_downscale_ratio;
 	uint32_t i2c_speed_in_khz;
+
+	unsigned int max_cursor_size;
 };
 
 
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +1 -0
index 55501b381692..9ed7c06132fe 100644
@@ -984,6 +984,7 @@ static bool construct(
 	pool->base.pipe_count = res_cap.num_timing_generator;
 	dc->public.caps.max_downscale_ratio = 200;
 	dc->public.caps.i2c_speed_in_khz = 40;
+	dc->public.caps.max_cursor_size = 128;
 
 	for (i = 0; i < pool->base.pipe_count; i++) {
 		pool->base.timing_generators[i] =
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +1 -0
index ee4fda514de6..f6e546addbd3 100644
@@ -1274,6 +1274,7 @@ static bool construct(
 
 	dc->public.caps.max_downscale_ratio = 150;
 	dc->public.caps.i2c_speed_in_khz = 100;
+	dc->public.caps.max_cursor_size = 128;
 
 	/*************************************************
 	 *  Create resources                             *
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +1 -0
index 54af84ebf2bc..526c106f6ebf 100644
@@ -1256,6 +1256,7 @@ static bool construct(
 	pool->base.pipe_count = pool->base.res_cap->num_timing_generator;
 	dc->public.caps.max_downscale_ratio = 200;
 	dc->public.caps.i2c_speed_in_khz = 100;
+	dc->public.caps.max_cursor_size = 128;
 
 	/*************************************************
 	 *  Create resources                             *
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +1 -0
index 3de8bfb47dce..272c7fc31406 100644
@@ -935,6 +935,7 @@ static bool construct(
 	pool->base.pipe_count = res_cap.num_timing_generator;
 	dc->public.caps.max_downscale_ratio = 200;
 	dc->public.caps.i2c_speed_in_khz = 40;
+	dc->public.caps.max_cursor_size = 128;
 
 	/*************************************************
 	 *  Create resources                             *
Signature · 6 lines
2.9.3

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

PATCH 10/10 drm/amd/display: color distortion after DPMS+ background color fix

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

Change-Id I1573c7aa95f857d126aadd2f61f152779795aff4
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -0
index 88a2fa99f5da..0afb3c64b651 100644
@@ -1054,6 +1054,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 	if (!pipe_ctx_old->stream) {
 		core_link_enable_stream(pipe_ctx);
 
+	resource_build_info_frame(pipe_ctx);
+	dce110_update_info_frame(pipe_ctx);
 		if (dc_is_dp_signal(pipe_ctx->stream->signal))
 			dce110_unblank_stream(pipe_ctx,
 				&stream->sink->link->public.cur_link_settings);
Signature · 6 lines
2.9.3

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