Skip to contentSkip to conversation

DC Patches Jul 9, 2018

PATCH Superseded Harry Wentland 3 participants 63 messages Jul 10, 2018 6 messages not in the archive

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

cover DC Patches Jul 9, 2018

Summary of changes:
* Drop DC logger completely
* CRC support for DCN
* Leave aux.transfer error handling to DRM
* Debugfs to program DP PHY for CTS

Alvin lee (1):
drm/amd/display: read DP sink and DP branch hardware and firmware
revision from DPCD

Charlene Liu (6):
drm/amd/display: Move common GPIO registers into a common define drm/amd/display: Define couple extra DCN registers drm/amd/display: add missing mask for dcn drm/amd/display: set default GPIO_ID_HPD drm/amd/display: introduce concept of send_reset_length for i2c
engines
drm/amd/display: add DalEnableHDMI20 key support

David Francis (2):
drm/amd/display: Add CRC support for DCN drm/amd/display: Expose couple OPTC functions through header

Dmytro Laktyushkin (8):
drm/amd/display: dcc always on for bw calculations on raven drm/amd/display: remove dentist_vco_freq from resource_pool drm/amd/display: drop unused register defines drm/amd/display: add additional info for cursor position programming drm/amd/display: add dcn cursor hotsport rotation and mirror support drm/amd/display: add max scl ratio to soc bounding box drm/amd/display: update dml to match DV dml drm/amd/display: properly turn autocal off

Eric Bernstein (3):
drm/amd/display: Separate HUBP surface size and rotation/mirror
programming
drm/amd/display: Add Azalia registers to HW sequencer drm/amd/display: Expose bunch of functions from dcn10_hw_sequencer

Eric Yang (1):
drm/amd/display: support access ddc for mst branch

Fatemeh Darbehani (1):
drm/amd/display: Return out_link_loss from interrupt handler

Harry Wentland (5):
Revert "drm/amd/display: Don't return ddc result and read_bytes in
same return value"
Revert "drm/amd/display: make dm_dp_aux_transfer return payload bytes
instead of size"
drm/amd/display: Serialize is_dp_sink_present drm/amd/display: Break out function to simply read aux reply drm/amd/display: Return aux replies directly to DRM

Hersen Wu (6):
drm/amd/display: Linux Set/Read link rate and lane count through
debugfs
drm/amd/display: set-read link rate and lane count through debugfs drm/amd/display: hook dp test pattern through debugfs drm/amd/display: Linux set/read lane settings through debugfs drm/amd/display: Linux hook test pattern through debufs drm/amd/display: dp dbeugfs allow link rate lane count greater than dp
rx reported caps

Hugo Hu (3):
drm/amd/display: Correct calculation of duration time. drm/amd/display: Patch for extend time to panel poweron. drm/amd/display: Initialize data structure for DalMpVisualConfirm.

Jerry (Fangzhi) Zuo (1):
drm/amd/display: Add YCbCr420 only support for HDMI 4K@60

Ken Chalmers (1):
drm/amd/display: Fix new stream count check in dc_add_stream_to_ctx

Krunoslav Kovac (1):
drm/amd/display: Implement cursor multiplier

Leo (Sunpeng) Li (3):
drm/amd/display: Fix compile error on older GCC versions drm/amd/display: Right shift AUX reply value sooner than later drm/amd/display: Read AUX channel even if only status byte is returned

Mikita Lipski (1):
drm/amd/display: add pp to dc powerlevel enum translator

Nicholas Kazlauskas (1):
drm/amd/display: Convert remaining loggers off dc_logger

Tony Cheng (8):
drm/amd/display: Add avoid_vbios_exec_table debug bit drm/amd/display: fix bug where we are creating bogus i2c aux drm/amd/display: generic indirect register access drm/amd/display: fix incorrect check for atom table size drm/amd/display: dal 3.1.53
drm/amd/display: Expose configure_encoder for link_encoder drm/amd/display: dal 3.1.54
drm/amd/display: dal 3.1.55

Yongqiang Sun (1):
drm/amd/display: expose dcn10_aux_initialize in header

Yue Hin Lau (1):
drm/amd/display: Add NULL check for local sink in edp_power_control

 drivers/gpu/drm/amd/display/TODO              |   8 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   7 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 694 ++++++++++++++++--
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  20 +-
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |  94 ++-
 .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  29 +-
 .../gpu/drm/amd/display/dc/basics/Makefile    |   2 +-
 .../drm/amd/display/dc/basics/log_helpers.c   |  71 +-
 .../gpu/drm/amd/display/dc/basics/logger.c    | 406 ----------
 .../drm/amd/display/dc/bios/bios_parser2.c    |   2 +-
 .../drm/amd/display/dc/calcs/calcs_logger.h   |   9 +-
 .../gpu/drm/amd/display/dc/calcs/dce_calcs.c  |   6 +-
 .../gpu/drm/amd/display/dc/calcs/dcn_calcs.c  |  19 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c      |  80 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |   8 +-
 .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 125 ++--
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  |  33 +-
 .../gpu/drm/amd/display/dc/core/dc_resource.c |   5 +-
 .../gpu/drm/amd/display/dc/core/dc_stream.c   |  23 +-
 drivers/gpu/drm/amd/display/dc/dc.h           |  10 +-
 drivers/gpu/drm/amd/display/dc/dc_helper.c    |  51 ++
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h  |   7 +-
 drivers/gpu/drm/amd/display/dc/dc_link.h      |  21 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |   6 +-
 drivers/gpu/drm/amd/display/dc/dc_types.h     |   3 +-
 .../gpu/drm/amd/display/dc/dce/dce_clocks.h   |   8 +-
 .../gpu/drm/amd/display/dc/dce/dce_hwseq.h    |   9 +-
 .../drm/amd/display/dc/dce/dce_link_encoder.c |   6 +
 .../display/dc/dce110/dce110_hw_sequencer.c   |  23 +-
 .../amd/display/dc/dce110/dce110_resource.c   |  34 +-
 .../amd/display/dc/dce112/dce112_resource.c   |  34 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c  |   4 +-
 .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c |  12 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c |  62 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h |  25 +-
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c |  69 +-
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.h |   7 +
 .../amd/display/dc/dcn10/dcn10_link_encoder.c |  19 +-
 .../amd/display/dc/dcn10/dcn10_link_encoder.h |  15 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c |  68 ++
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h |  60 +-
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |   3 +
 .../amd/display/dc/dml/display_mode_structs.h |   3 +
 .../gpu/drm/amd/display/dc/gpio/ddc_regs.h    |   7 +-
 .../drm/amd/display/dc/gpio/gpio_service.c    |   1 +
 .../drm/amd/display/dc/i2caux/aux_engine.c    |  15 +-
 .../drm/amd/display/dc/i2caux/aux_engine.h    |   6 +
 .../display/dc/i2caux/dce100/i2caux_dce100.c  |   1 +
 .../dc/i2caux/dce110/aux_engine_dce110.c      | 119 +--
 .../dc/i2caux/dce110/i2c_hw_engine_dce110.c   |  26 +-
 .../dc/i2caux/dce110/i2c_hw_engine_dce110.h   |   8 +
 .../display/dc/i2caux/dce110/i2caux_dce110.c  |  24 +-
 .../display/dc/i2caux/dce110/i2caux_dce110.h  |   1 +
 .../display/dc/i2caux/dce112/i2caux_dce112.c  |   1 +
 .../display/dc/i2caux/dce120/i2caux_dce120.c  |   1 +
 .../display/dc/i2caux/dcn10/i2caux_dcn10.c    |   1 +
 .../drm/amd/display/dc/i2caux/i2c_engine.h    |   2 +
 .../gpu/drm/amd/display/dc/i2caux/i2caux.c    |   1 -
 .../gpu/drm/amd/display/dc/inc/core_types.h   |   1 -
 .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h  |  23 +-
 .../gpu/drm/amd/display/dc/inc/hw_sequencer.h |   8 +
 .../gpu/drm/amd/display/dc/inc/reg_helper.h   |  46 ++
 .../gpu/drm/amd/display/include/dpcd_defs.h   |   3 +
 .../amd/display/include/logger_interface.h    | 138 ++--
 .../drm/amd/display/include/logger_types.h    |  59 --
 65 files changed, 1607 insertions(+), 1085 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/basics/logger.c
Signature · 6 lines
2.17.1

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

#2 lore raw

PATCH 1/54 Revert "drm/amd/display: Don't return ddc result and read_bytes in same return value"

This reverts commit 8a61bc085ffab3071c59efcbeff4044c034e7490.

---
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 20 ++++++++-----------
 .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 10 +++-------
 .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h  |  5 ++---
 3 files changed, 13 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +8 -12
index 8f42e5616390..d43a65c6ced8 100644
@@ -83,22 +83,21 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 	enum i2c_mot_mode mot = (msg->request & DP_AUX_I2C_MOT) ?
 		I2C_MOT_TRUE : I2C_MOT_FALSE;
 	enum ddc_result res;
-	uint32_t read_bytes = msg->size;
+	ssize_t read_bytes;
 
 	if (WARN_ON(msg->size > 16))
 		return -E2BIG;
 
 	switch (msg->request & ~DP_AUX_I2C_MOT) {
 	case DP_AUX_NATIVE_READ:
-		res = dal_ddc_service_read_dpcd_data(
+		read_bytes = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				false,
 				I2C_MOT_UNDEF,
 				msg->address,
 				msg->buffer,
-				msg->size,
-				&read_bytes);
-		break;
+				msg->size);
+		return read_bytes;
 	case DP_AUX_NATIVE_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
@@ -109,15 +108,14 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 				msg->size);
 		break;
 	case DP_AUX_I2C_READ:
-		res = dal_ddc_service_read_dpcd_data(
+		read_bytes = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				true,
 				mot,
 				msg->address,
 				msg->buffer,
-				msg->size,
-				&read_bytes);
-		break;
+				msg->size);
+		return read_bytes;
 	case DP_AUX_I2C_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
@@ -139,9 +137,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 		 r == DDC_RESULT_SUCESSFULL);
 #endif
 
-	if (res != DDC_RESULT_SUCESSFULL)
-		return -EIO;
-	return read_bytes;
+	return msg->size;
 }
 
 static enum drm_connector_status
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +3 -7
index ae48d603ebd6..49c2face1e7a 100644
@@ -629,14 +629,13 @@ bool dal_ddc_service_query_ddc_data(
 	return ret;
 }
 
-enum ddc_result dal_ddc_service_read_dpcd_data(
+ssize_t dal_ddc_service_read_dpcd_data(
 	struct ddc_service *ddc,
 	bool i2c,
 	enum i2c_mot_mode mot,
 	uint32_t address,
 	uint8_t *data,
-	uint32_t len,
-	uint32_t *read)
+	uint32_t len)
 {
 	struct aux_payload read_payload = {
 		.i2c_over_aux = i2c,
@@ -653,8 +652,6 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
 		.mot = mot
 	};
 
-	*read = 0;
-
 	if (len > DEFAULT_AUX_MAX_DATA_SIZE) {
 		BREAK_TO_DEBUGGER();
 		return DDC_RESULT_FAILED_INVALID_OPERATION;
@@ -664,8 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
 		ddc->ctx->i2caux,
 		ddc->ddc_pin,
 		&command)) {
-		*read = command.payloads->length;
-		return DDC_RESULT_SUCESSFULL;
+		return (ssize_t)command.payloads->length;
 	}
 
 	return DDC_RESULT_FAILED_OPERATION;
drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h +2 -3
index 30b3a08b91be..090b7a8dd67b 100644
@@ -102,14 +102,13 @@ bool dal_ddc_service_query_ddc_data(
 		uint8_t *read_buf,
 		uint32_t read_size);
 
-enum ddc_result dal_ddc_service_read_dpcd_data(
+ssize_t dal_ddc_service_read_dpcd_data(
 		struct ddc_service *ddc,
 		bool i2c,
 		enum i2c_mot_mode mot,
 		uint32_t address,
 		uint8_t *data,
-		uint32_t len,
-		uint32_t *read);
+		uint32_t len);
 
 enum ddc_result dal_ddc_service_write_dpcd_data(
 		struct ddc_service *ddc,
Signature · 6 lines
2.17.1

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

#4 lore raw

Re: [PATCH 01/54] Revert "drm/amd/display: Don't return ddc result and read_bytes in same return value"

Quoted 1 line · Harry Wentland

This reverts commit 8a61bc085ffab3071c59efcbeff4044c034e7490.

A revert commit needs a rationale (why did the commit need to be reverted?) in the commit log.

Since this same change went into 4.17 as commit 018d82e5f02ef3583411bcaa4e00c69786f46f19, please add

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

PATCH v2 1/1 Revert "drm/amd/display: Don't return ddc result and read_bytes in same return value"

In reply to a message not in the archive

This reverts commit 8a61bc085ffab3071c59efcbeff4044c034e7490.

Need to revert "make dm_dp_aux_transfer return payload bytes instead of size", which this commit is based on. That commit was problematic on other OSes. The real solution is to leave all the error checking to DRM and don't do it in DC, which is addressed by "Return aux replies directly to DRM" later in this patchset.

v2: Add reason for revert.

---
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 20 ++++++++-----------
 .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 10 +++-------
 .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h  |  5 ++---
 3 files changed, 13 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +8 -12
index 8f42e5616390..d43a65c6ced8 100644
@@ -83,22 +83,21 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 	enum i2c_mot_mode mot = (msg->request & DP_AUX_I2C_MOT) ?
 		I2C_MOT_TRUE : I2C_MOT_FALSE;
 	enum ddc_result res;
-	uint32_t read_bytes = msg->size;
+	ssize_t read_bytes;
 
 	if (WARN_ON(msg->size > 16))
 		return -E2BIG;
 
 	switch (msg->request & ~DP_AUX_I2C_MOT) {
 	case DP_AUX_NATIVE_READ:
-		res = dal_ddc_service_read_dpcd_data(
+		read_bytes = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				false,
 				I2C_MOT_UNDEF,
 				msg->address,
 				msg->buffer,
-				msg->size,
-				&read_bytes);
-		break;
+				msg->size);
+		return read_bytes;
 	case DP_AUX_NATIVE_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
@@ -109,15 +108,14 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 				msg->size);
 		break;
 	case DP_AUX_I2C_READ:
-		res = dal_ddc_service_read_dpcd_data(
+		read_bytes = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				true,
 				mot,
 				msg->address,
 				msg->buffer,
-				msg->size,
-				&read_bytes);
-		break;
+				msg->size);
+		return read_bytes;
 	case DP_AUX_I2C_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
@@ -139,9 +137,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 		 r == DDC_RESULT_SUCESSFULL);
 #endif
 
-	if (res != DDC_RESULT_SUCESSFULL)
-		return -EIO;
-	return read_bytes;
+	return msg->size;
 }
 
 static enum drm_connector_status
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +3 -7
index ae48d603ebd6..49c2face1e7a 100644
@@ -629,14 +629,13 @@ bool dal_ddc_service_query_ddc_data(
 	return ret;
 }
 
-enum ddc_result dal_ddc_service_read_dpcd_data(
+ssize_t dal_ddc_service_read_dpcd_data(
 	struct ddc_service *ddc,
 	bool i2c,
 	enum i2c_mot_mode mot,
 	uint32_t address,
 	uint8_t *data,
-	uint32_t len,
-	uint32_t *read)
+	uint32_t len)
 {
 	struct aux_payload read_payload = {
 		.i2c_over_aux = i2c,
@@ -653,8 +652,6 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
 		.mot = mot
 	};
 
-	*read = 0;
-
 	if (len > DEFAULT_AUX_MAX_DATA_SIZE) {
 		BREAK_TO_DEBUGGER();
 		return DDC_RESULT_FAILED_INVALID_OPERATION;
@@ -664,8 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
 		ddc->ctx->i2caux,
 		ddc->ddc_pin,
 		&command)) {
-		*read = command.payloads->length;
-		return DDC_RESULT_SUCESSFULL;
+		return (ssize_t)command.payloads->length;
 	}
 
 	return DDC_RESULT_FAILED_OPERATION;
drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h +2 -3
index 30b3a08b91be..090b7a8dd67b 100644
@@ -102,14 +102,13 @@ bool dal_ddc_service_query_ddc_data(
 		uint8_t *read_buf,
 		uint32_t read_size);
 
-enum ddc_result dal_ddc_service_read_dpcd_data(
+ssize_t dal_ddc_service_read_dpcd_data(
 		struct ddc_service *ddc,
 		bool i2c,
 		enum i2c_mot_mode mot,
 		uint32_t address,
 		uint8_t *data,
-		uint32_t len,
-		uint32_t *read);
+		uint32_t len);
 
 enum ddc_result dal_ddc_service_write_dpcd_data(
 		struct ddc_service *ddc,
Signature · 6 lines
2.17.1

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

PATCH 2/54 Revert "drm/amd/display: make dm_dp_aux_transfer return payload bytes instead of size"

In reply to a message not in the archive

This reverts commit cc195141133ac3e767d930bedd8294ceebf1f10b.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c   |  9 ++++-----
 drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c |  7 +++----
 .../gpu/drm/amd/display/dc/i2caux/aux_engine.c    | 15 +++++++++++++--
 drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c    |  1 -
 drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h  |  2 +-
 5 files changed, 21 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +4 -5
index d43a65c6ced8..db669c427dab 100644
@@ -83,21 +83,20 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 	enum i2c_mot_mode mot = (msg->request & DP_AUX_I2C_MOT) ?
 		I2C_MOT_TRUE : I2C_MOT_FALSE;
 	enum ddc_result res;
-	ssize_t read_bytes;
 
 	if (WARN_ON(msg->size > 16))
 		return -E2BIG;
 
 	switch (msg->request & ~DP_AUX_I2C_MOT) {
 	case DP_AUX_NATIVE_READ:
-		read_bytes = dal_ddc_service_read_dpcd_data(
+		res = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				false,
 				I2C_MOT_UNDEF,
 				msg->address,
 				msg->buffer,
 				msg->size);
-		return read_bytes;
+		break;
 	case DP_AUX_NATIVE_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
@@ -108,14 +107,14 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 				msg->size);
 		break;
 	case DP_AUX_I2C_READ:
-		read_bytes = dal_ddc_service_read_dpcd_data(
+		res = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				true,
 				mot,
 				msg->address,
 				msg->buffer,
 				msg->size);
-		return read_bytes;
+		break;
 	case DP_AUX_I2C_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +3 -4
index 49c2face1e7a..d5294798b0a5 100644
@@ -629,7 +629,7 @@ bool dal_ddc_service_query_ddc_data(
 	return ret;
 }
 
-ssize_t dal_ddc_service_read_dpcd_data(
+enum ddc_result dal_ddc_service_read_dpcd_data(
 	struct ddc_service *ddc,
 	bool i2c,
 	enum i2c_mot_mode mot,
@@ -660,9 +660,8 @@ ssize_t dal_ddc_service_read_dpcd_data(
 	if (dal_i2caux_submit_aux_command(
 		ddc->ctx->i2caux,
 		ddc->ddc_pin,
-		&command)) {
-		return (ssize_t)command.payloads->length;
-	}
+		&command))
+		return DDC_RESULT_SUCESSFULL;
 
 	return DDC_RESULT_FAILED_OPERATION;
 }
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c +13 -2
index 1d7309611978..0afd2fa57bbe 100644
@@ -128,8 +128,20 @@ static void process_read_reply(
 			ctx->status =
 				I2CAUX_TRANSACTION_STATUS_FAILED_PROTOCOL_ERROR;
 			ctx->operation_succeeded = false;
+		} else if (ctx->returned_byte < ctx->current_read_length) {
+			ctx->current_read_length -= ctx->returned_byte;
+
+			ctx->offset += ctx->returned_byte;
+
+			++ctx->invalid_reply_retry_aux_on_ack;
+
+			if (ctx->invalid_reply_retry_aux_on_ack >
+				AUX_INVALID_REPLY_RETRY_COUNTER) {
+				ctx->status =
+				I2CAUX_TRANSACTION_STATUS_FAILED_PROTOCOL_ERROR;
+				ctx->operation_succeeded = false;
+			}
 		} else {
-			ctx->current_read_length = ctx->returned_byte;
 			ctx->status = I2CAUX_TRANSACTION_STATUS_SUCCEEDED;
 			ctx->transaction_complete = true;
 			ctx->operation_succeeded = true;
@@ -290,7 +302,6 @@ static bool read_command(
 				ctx.operation_succeeded);
 	}
 
-	request->payload.length = ctx.reply.length;
 	return ctx.operation_succeeded;
 }
 
drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c +0 -1
index 14dc8c94d862..9b0bcc6b769b 100644
@@ -254,7 +254,6 @@ bool dal_i2caux_submit_aux_command(
 			break;
 		}
 
-		cmd->payloads->length = request.payload.length;
 		++index_of_payload;
 	}
 
drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h +1 -1
index 090b7a8dd67b..0bf73b742f1f 100644
@@ -102,7 +102,7 @@ bool dal_ddc_service_query_ddc_data(
 		uint8_t *read_buf,
 		uint32_t read_size);
 
-ssize_t dal_ddc_service_read_dpcd_data(
+enum ddc_result dal_ddc_service_read_dpcd_data(
 		struct ddc_service *ddc,
 		bool i2c,
 		enum i2c_mot_mode mot,
Signature · 6 lines
2.17.1

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

#8 lore raw

PATCH v2 1/1 Revert "drm/amd/display: make dm_dp_aux_transfer return payload bytes instead of size"

This reverts commit cc195141133ac3e767d930bedd8294ceebf1f10b.

This commit was problematic on other OSes. The real solution is to leave all the error checking to DRM and don't do it in DC, which is addressed by "Return aux replies directly to DRM" later in this patchset.

v2: Add reason for revert.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c   |  9 ++++-----
 drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c |  7 +++----
 .../gpu/drm/amd/display/dc/i2caux/aux_engine.c    | 15 +++++++++++++--
 drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c    |  1 -
 drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h  |  2 +-
 5 files changed, 21 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +4 -5
index d43a65c6ced8..db669c427dab 100644
@@ -83,21 +83,20 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 	enum i2c_mot_mode mot = (msg->request & DP_AUX_I2C_MOT) ?
 		I2C_MOT_TRUE : I2C_MOT_FALSE;
 	enum ddc_result res;
-	ssize_t read_bytes;
 
 	if (WARN_ON(msg->size > 16))
 		return -E2BIG;
 
 	switch (msg->request & ~DP_AUX_I2C_MOT) {
 	case DP_AUX_NATIVE_READ:
-		read_bytes = dal_ddc_service_read_dpcd_data(
+		res = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				false,
 				I2C_MOT_UNDEF,
 				msg->address,
 				msg->buffer,
 				msg->size);
-		return read_bytes;
+		break;
 	case DP_AUX_NATIVE_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
@@ -108,14 +107,14 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 				msg->size);
 		break;
 	case DP_AUX_I2C_READ:
-		read_bytes = dal_ddc_service_read_dpcd_data(
+		res = dal_ddc_service_read_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
 				true,
 				mot,
 				msg->address,
 				msg->buffer,
 				msg->size);
-		return read_bytes;
+		break;
 	case DP_AUX_I2C_WRITE:
 		res = dal_ddc_service_write_dpcd_data(
 				TO_DM_AUX(aux)->ddc_service,
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +3 -4
index 49c2face1e7a..d5294798b0a5 100644
@@ -629,7 +629,7 @@ bool dal_ddc_service_query_ddc_data(
 	return ret;
 }
 
-ssize_t dal_ddc_service_read_dpcd_data(
+enum ddc_result dal_ddc_service_read_dpcd_data(
 	struct ddc_service *ddc,
 	bool i2c,
 	enum i2c_mot_mode mot,
@@ -660,9 +660,8 @@ ssize_t dal_ddc_service_read_dpcd_data(
 	if (dal_i2caux_submit_aux_command(
 		ddc->ctx->i2caux,
 		ddc->ddc_pin,
-		&command)) {
-		return (ssize_t)command.payloads->length;
-	}
+		&command))
+		return DDC_RESULT_SUCESSFULL;
 
 	return DDC_RESULT_FAILED_OPERATION;
 }
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c +13 -2
index 1d7309611978..0afd2fa57bbe 100644
@@ -128,8 +128,20 @@ static void process_read_reply(
 			ctx->status =
 				I2CAUX_TRANSACTION_STATUS_FAILED_PROTOCOL_ERROR;
 			ctx->operation_succeeded = false;
+		} else if (ctx->returned_byte < ctx->current_read_length) {
+			ctx->current_read_length -= ctx->returned_byte;
+
+			ctx->offset += ctx->returned_byte;
+
+			++ctx->invalid_reply_retry_aux_on_ack;
+
+			if (ctx->invalid_reply_retry_aux_on_ack >
+				AUX_INVALID_REPLY_RETRY_COUNTER) {
+				ctx->status =
+				I2CAUX_TRANSACTION_STATUS_FAILED_PROTOCOL_ERROR;
+				ctx->operation_succeeded = false;
+			}
 		} else {
-			ctx->current_read_length = ctx->returned_byte;
 			ctx->status = I2CAUX_TRANSACTION_STATUS_SUCCEEDED;
 			ctx->transaction_complete = true;
 			ctx->operation_succeeded = true;
@@ -290,7 +302,6 @@ static bool read_command(
 				ctx.operation_succeeded);
 	}
 
-	request->payload.length = ctx.reply.length;
 	return ctx.operation_succeeded;
 }
 
drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c +0 -1
index 14dc8c94d862..9b0bcc6b769b 100644
@@ -254,7 +254,6 @@ bool dal_i2caux_submit_aux_command(
 			break;
 		}
 
-		cmd->payloads->length = request.payload.length;
 		++index_of_payload;
 	}
 
drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h +1 -1
index 090b7a8dd67b..0bf73b742f1f 100644
@@ -102,7 +102,7 @@ bool dal_ddc_service_query_ddc_data(
 		uint8_t *read_buf,
 		uint32_t read_size);
 
-ssize_t dal_ddc_service_read_dpcd_data(
+enum ddc_result dal_ddc_service_read_dpcd_data(
 		struct ddc_service *ddc,
 		bool i2c,
 		enum i2c_mot_mode mot,
Signature · 6 lines
2.17.1

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

PATCH 3/54 drm/amd/display: Separate HUBP surface size and rotation/mirror programming

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

Separate HUBP surface size and rotation/mirror programming so that HUBP revision without mirror/rotation do not access those register fields.

---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 23 ++++++++++++-------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 13 +++++++----
 2 files changed, 23 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +15 -8
index 5f686aa8fc84..75442183b5d6 100644
@@ -152,16 +152,14 @@ void hubp1_program_tiling(
 			PIPE_ALIGNED, info->gfx9.pipe_aligned);
 }
 
-void hubp1_program_size_and_rotation(
+void hubp1_program_size(
 	struct hubp *hubp,
-	enum dc_rotation_angle rotation,
 	enum surface_pixel_format format,
 	const union plane_size *plane_size,
-	struct dc_plane_dcc_param *dcc,
-	bool horizontal_mirror)
+	struct dc_plane_dcc_param *dcc)
 {
 	struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
-	uint32_t pitch, meta_pitch, pitch_c, meta_pitch_c, mirror;
+	uint32_t pitch, meta_pitch, pitch_c, meta_pitch_c;
 
 	/* Program data and meta surface pitch (calculation from addrlib)
 	 * 444 or 420 luma
@@ -192,13 +190,22 @@ void hubp1_program_size_and_rotation(
 	if (format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
 		REG_UPDATE_2(DCSURF_SURFACE_PITCH_C,
 			PITCH_C, pitch_c, META_PITCH_C, meta_pitch_c);
+}
+
+void hubp1_program_rotation(
+	struct hubp *hubp,
+	enum dc_rotation_angle rotation,
+	bool horizontal_mirror)
+{
+	struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
+	uint32_t mirror;
+
 
 	if (horizontal_mirror)
 		mirror = 1;
 	else
 		mirror = 0;
 
-
 	/* Program rotation angle and horz mirror - no mirror */
 	if (rotation == ROTATION_ANGLE_0)
 		REG_UPDATE_2(DCSURF_SURFACE_CONFIG,
@@ -495,8 +502,8 @@ void hubp1_program_surface_config(
 {
 	hubp1_dcc_control(hubp, dcc->enable, dcc->grph.independent_64b_blks);
 	hubp1_program_tiling(hubp, tiling_info, format);
-	hubp1_program_size_and_rotation(
-			hubp, rotation, format, plane_size, dcc, horizontal_mirror);
+	hubp1_program_size(hubp, format, plane_size, dcc);
+	hubp1_program_rotation(hubp, rotation, horizontal_mirror);
 	hubp1_program_pixel_format(hubp, format);
 }
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +8 -5
index e2f5238b8c11..20f3c206fcc3 100644
@@ -268,8 +268,6 @@
 	HUBP_SF(HUBPREQ0_DCSURF_SURFACE_PITCH, META_PITCH, mask_sh),\
 	HUBP_SF(HUBPREQ0_DCSURF_SURFACE_PITCH_C, PITCH_C, mask_sh),\
 	HUBP_SF(HUBPREQ0_DCSURF_SURFACE_PITCH_C, META_PITCH_C, mask_sh),\
-	HUBP_SF(HUBP0_DCSURF_SURFACE_CONFIG, ROTATION_ANGLE, mask_sh),\
-	HUBP_SF(HUBP0_DCSURF_SURFACE_CONFIG, H_MIRROR_EN, mask_sh),\
 	HUBP_SF(HUBP0_DCSURF_SURFACE_CONFIG, SURFACE_PIXEL_FORMAT, mask_sh),\
 	HUBP_SF(HUBPREQ0_DCSURF_FLIP_CONTROL, SURFACE_FLIP_TYPE, mask_sh),\
 	HUBP_SF(HUBPREQ0_DCSURF_FLIP_CONTROL, SURFACE_FLIP_MODE_FOR_STEREOSYNC, mask_sh),\
@@ -390,6 +388,8 @@
 #define HUBP_MASK_SH_LIST_DCN10(mask_sh)\
 	HUBP_MASK_SH_LIST_DCN(mask_sh),\
 	HUBP_MASK_SH_LIST_DCN_VM(mask_sh),\
+	HUBP_SF(HUBP0_DCSURF_SURFACE_CONFIG, ROTATION_ANGLE, mask_sh),\
+	HUBP_SF(HUBP0_DCSURF_SURFACE_CONFIG, H_MIRROR_EN, mask_sh),\
 	HUBP_SF(HUBPREQ0_PREFETCH_SETTINS, DST_Y_PREFETCH, mask_sh),\
 	HUBP_SF(HUBPREQ0_PREFETCH_SETTINS, VRATIO_PREFETCH, mask_sh),\
 	HUBP_SF(HUBPREQ0_PREFETCH_SETTINS_C, VRATIO_PREFETCH_C, mask_sh),\
@@ -683,12 +683,15 @@ void hubp1_program_pixel_format(
 	struct hubp *hubp,
 	enum surface_pixel_format format);
 
-void hubp1_program_size_and_rotation(
+void hubp1_program_size(
 	struct hubp *hubp,
-	enum dc_rotation_angle rotation,
 	enum surface_pixel_format format,
 	const union plane_size *plane_size,
-	struct dc_plane_dcc_param *dcc,
+	struct dc_plane_dcc_param *dcc);
+
+void hubp1_program_rotation(
+	struct hubp *hubp,
+	enum dc_rotation_angle rotation,
 	bool horizontal_mirror);
 
 void hubp1_program_tiling(
Signature · 6 lines
2.17.1

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

PATCH 4/54 drm/amd/display: Add avoid_vbios_exec_table debug bit

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index 0cb7e10d2505..59985baac11e 100644
@@ -249,6 +249,7 @@ struct dc_debug {
 	bool always_use_regamma;
 	bool p010_mpo_support;
 	bool recovery_enabled;
+	bool avoid_vbios_exec_table;
 
 };
 struct dc_state;
Signature · 6 lines
2.17.1

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

PATCH 5/54 drm/amd/display: support access ddc for mst branch

In reply to a message not in the archive

From: Eric Yang <[email protected]>

[Why]
Megachip dockings accesses ddc line through display driver when installing FW. Previously, we would fail every transaction because link attached to mst branch did not have their ddc transaction type set.

[How]
Set ddc transaction type when mst branch is connected.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -0
index 053ef83ea60f..d6259698470b 100644
@@ -498,6 +498,10 @@ static bool detect_dp(
 			sink_caps->signal = SIGNAL_TYPE_DISPLAY_PORT_MST;
 			link->type = dc_connection_mst_branch;
 
+			dal_ddc_service_set_transaction_type(
+							link->ddc,
+							sink_caps->transaction_type);
+
 			/*
 			 * This call will initiate MST topology discovery. Which
 			 * will detect MST ports and add new DRM connector DRM
Signature · 6 lines
2.17.1

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

PATCH 6/54 drm/amd/display: Implement cursor multiplier

In reply to a message not in the archive

From: Krunoslav Kovac <[email protected]>

DCN allows cursor multiplier when blending FP16 surface.

---
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h      |  1 +
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 15 +++++++++++++++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 12 ++++++++----
 3 files changed, 24 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index f285d3754221..7117f9f95b27 100644
@@ -490,6 +490,7 @@ struct dc_cursor_attributes {
 	uint32_t height;
 
 	enum dc_cursor_color_format color_format;
+	uint32_t sdr_white_level; // for boosting (SDR) cursor in HDR mode
 
 	/* In case we support HW Cursor rotation in the future */
 	enum dc_rotation_angle rotation_angle;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +15 -0
index 75442183b5d6..60e4fb8da9db 100644
@@ -27,6 +27,7 @@
 #include "reg_helper.h"
 #include "basics/conversion.h"
 #include "dcn10_hubp.h"
+#include "custom_float.h"
 
 #define REG(reg)\
 	hubp1->hubp_regs->reg
@@ -1052,6 +1053,18 @@ void hubp1_cursor_set_attributes(
 	enum cursor_pitch hw_pitch = hubp1_get_cursor_pitch(attr->pitch);
 	enum cursor_lines_per_chunk lpc = hubp1_get_lines_per_chunk(
 			attr->width, attr->color_format);
+	struct fixed31_32 multiplier;
+	uint32_t hw_mult = 0x3c00; // 1.0 default multiplier
+	struct custom_float_format fmt;
+
+	fmt.exponenta_bits = 5;
+	fmt.mantissa_bits = 10;
+	fmt.sign = true;
+
+	if (attr->sdr_white_level > 80) {
+		multiplier = dc_fixpt_from_fraction(attr->sdr_white_level, 80);
+		convert_to_custom_float_format(multiplier, &fmt, &hw_mult);
+	}
 
 	hubp->curs_attr = *attr;
 
@@ -1074,6 +1087,8 @@ void hubp1_cursor_set_attributes(
 			CURSOR0_DST_Y_OFFSET, 0,
 			 /* used to shift the cursor chunk request deadline */
 			CURSOR0_CHUNK_HDL_ADJUST, 3);
+
+	REG_UPDATE(CURSOR0_FP_SCALE_BIAS, CUR0_FP_SCALE, hw_mult);
 }
 
 void hubp1_cursor_set_position(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +8 -4
index 20f3c206fcc3..1abb369d9430 100644
@@ -133,7 +133,8 @@
 	SRI(CURSOR_CONTROL, CURSOR, id), \
 	SRI(CURSOR_POSITION, CURSOR, id), \
 	SRI(CURSOR_HOT_SPOT, CURSOR, id), \
-	SRI(CURSOR_DST_OFFSET, CURSOR, id)
+	SRI(CURSOR_DST_OFFSET, CURSOR, id), \
+	SRI(CURSOR0_FP_SCALE_BIAS, CNVC_CUR, id)
 
 #define HUBP_COMMON_REG_VARIABLE_LIST \
 	uint32_t DCHUBP_CNTL; \
@@ -241,7 +242,8 @@
 	uint32_t CURSOR_POSITION; \
 	uint32_t CURSOR_HOT_SPOT; \
 	uint32_t CURSOR_DST_OFFSET; \
-	uint32_t HUBP_CLK_CNTL
+	uint32_t HUBP_CLK_CNTL; \
+	uint32_t CURSOR0_FP_SCALE_BIAS
 
 #define HUBP_SF(reg_name, field_name, post_fix)\
 	.field_name = reg_name ## __ ## field_name ## post_fix
@@ -426,7 +428,8 @@
 	HUBP_SF(CURSOR0_CURSOR_POSITION, CURSOR_Y_POSITION, mask_sh), \
 	HUBP_SF(CURSOR0_CURSOR_HOT_SPOT, CURSOR_HOT_SPOT_X, mask_sh), \
 	HUBP_SF(CURSOR0_CURSOR_HOT_SPOT, CURSOR_HOT_SPOT_Y, mask_sh), \
-	HUBP_SF(CURSOR0_CURSOR_DST_OFFSET, CURSOR_DST_X_OFFSET, mask_sh)
+	HUBP_SF(CURSOR0_CURSOR_DST_OFFSET, CURSOR_DST_X_OFFSET, mask_sh), \
+	HUBP_SF(CNVC_CUR0_CURSOR0_FP_SCALE_BIAS, CUR0_FP_SCALE, mask_sh)
 
 #define DCN_HUBP_REG_FIELD_LIST(type) \
 	type HUBP_BLANK_EN;\
@@ -619,7 +622,8 @@
 	type CURSOR_HOT_SPOT_X; \
 	type CURSOR_HOT_SPOT_Y; \
 	type CURSOR_DST_X_OFFSET; \
-	type OUTPUT_FP
+	type OUTPUT_FP; \
+	type CUR0_FP_SCALE
 
 struct dcn_mi_registers {
 	HUBP_COMMON_REG_VARIABLE_LIST;
Signature · 6 lines
2.17.1

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

PATCH 7/54 drm/amd/display: Linux Set/Read link rate and lane count through debugfs

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

expose dc function to be called by linux dm

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 65 ++++++++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc_link.h | 17 +++++++
 2 files changed, 82 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +65 -0
index ffd4a423d8ff..03b3bd649712 100644
@@ -382,6 +382,71 @@ void dc_stream_set_static_screen_events(struct dc *dc,
 	dc->hwss.set_static_screen_control(pipes_affected, num_pipes_affected, events);
 }
 
+void dc_link_set_drive_settings(struct dc *dc,
+				struct link_training_settings *lt_settings,
+				const struct dc_link *link)
+{
+
+	int i;
+
+	for (i = 0; i < dc->link_count; i++) {
+		if (dc->links[i] == link)
+			break;
+	}
+
+	if (i >= dc->link_count)
+		ASSERT_CRITICAL(false);
+
+	dc_link_dp_set_drive_settings(dc->links[i], lt_settings);
+}
+
+void dc_link_perform_link_training(struct dc *dc,
+				   struct dc_link_settings *link_setting,
+				   bool skip_video_pattern)
+{
+	int i;
+
+	for (i = 0; i < dc->link_count; i++)
+		dc_link_dp_perform_link_training(
+			dc->links[i],
+			link_setting,
+			skip_video_pattern);
+}
+
+void dc_link_set_preferred_link_settings(struct dc *dc,
+					 struct dc_link_settings *link_setting,
+					 struct dc_link *link)
+{
+	link->preferred_link_setting = *link_setting;
+	dp_retrain_link_dp_test(link, link_setting, false);
+}
+
+void dc_link_enable_hpd(const struct dc_link *link)
+{
+	dc_link_dp_enable_hpd(link);
+}
+
+void dc_link_disable_hpd(const struct dc_link *link)
+{
+	dc_link_dp_disable_hpd(link);
+}
+
+
+void dc_link_set_test_pattern(struct dc_link *link,
+			      enum dp_test_pattern test_pattern,
+			      const struct link_training_settings *p_link_settings,
+			      const unsigned char *p_custom_pattern,
+			      unsigned int cust_pattern_size)
+{
+	if (link != NULL)
+		dc_link_dp_set_test_pattern(
+			link,
+			test_pattern,
+			p_link_settings,
+			p_custom_pattern,
+			cust_pattern_size);
+}
+
 static void destruct(struct dc *dc)
 {
 	dc_release_state(dc->current_state);
drivers/gpu/drm/amd/display/dc/dc_link.h +17 -0
index 8a716baa1203..83eea42452b5 100644
@@ -214,6 +214,23 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable);
  * DPCD access interfaces
  */
 
+void dc_link_set_drive_settings(struct dc *dc,
+				struct link_training_settings *lt_settings,
+				const struct dc_link *link);
+void dc_link_perform_link_training(struct dc *dc,
+				   struct dc_link_settings *link_setting,
+				   bool skip_video_pattern);
+void dc_link_set_preferred_link_settings(struct dc *dc,
+					 struct dc_link_settings *link_setting,
+					 struct dc_link *link);
+void dc_link_enable_hpd(const struct dc_link *link);
+void dc_link_disable_hpd(const struct dc_link *link);
+void dc_link_set_test_pattern(struct dc_link *link,
+			enum dp_test_pattern test_pattern,
+			const struct link_training_settings *p_link_settings,
+			const unsigned char *p_custom_pattern,
+			unsigned int cust_pattern_size);
+
 bool dc_submit_i2c(
 		struct dc *dc,
 		uint32_t link_index,
Signature · 6 lines
2.17.1

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

PATCH 8/54 drm/amd/display: Move common GPIO registers into a common define

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/gpio/ddc_regs.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/gpio/ddc_regs.h +5 -2
index 9c4a56c738c0..bf40725f982f 100644
@@ -82,13 +82,16 @@
 	DDC_GPIO_I2C_REG_LIST(cd),\
 	.ddc_setup = 0
 
-#define DDC_MASK_SH_LIST(mask_sh) \
+#define DDC_MASK_SH_LIST_COMMON(mask_sh) \
 		SF_DDC(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_ENABLE, mask_sh),\
 		SF_DDC(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_EDID_DETECT_ENABLE, mask_sh),\
 		SF_DDC(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_EDID_DETECT_MODE, mask_sh),\
 		SF_DDC(DC_GPIO_DDC1_MASK, DC_GPIO_DDC1DATA_PD_EN, mask_sh),\
 		SF_DDC(DC_GPIO_DDC1_MASK, DC_GPIO_DDC1CLK_PD_EN, mask_sh),\
-		SF_DDC(DC_GPIO_DDC1_MASK, AUX_PAD1_MODE, mask_sh),\
+		SF_DDC(DC_GPIO_DDC1_MASK, AUX_PAD1_MODE, mask_sh)
+
+#define DDC_MASK_SH_LIST(mask_sh) \
+		DDC_MASK_SH_LIST_COMMON(mask_sh),\
 		SF_DDC(DC_GPIO_I2CPAD_MASK, DC_GPIO_SDA_PD_DIS, mask_sh),\
 		SF_DDC(DC_GPIO_I2CPAD_MASK, DC_GPIO_SCL_PD_DIS, mask_sh)
 
Signature · 6 lines
2.17.1

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

PATCH 9/54 drm/amd/display: fix bug where we are creating bogus i2c aux

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

[WHY]
we were using 6 instances based on i2caux_dce110.c

[HOW]
pass in how many instances to ctor

---
 .../gpu/drm/amd/display/dc/i2caux/dce100/i2caux_dce100.c    | 1 +
 .../gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.c    | 6 ++++--
 .../gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.h    | 1 +
 .../gpu/drm/amd/display/dc/i2caux/dce112/i2caux_dce112.c    | 1 +
 .../gpu/drm/amd/display/dc/i2caux/dce120/i2caux_dce120.c    | 1 +
 drivers/gpu/drm/amd/display/dc/i2caux/dcn10/i2caux_dcn10.c  | 1 +
 6 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/i2caux/dce100/i2caux_dce100.c +1 -0
index e8d3781deaed..8b704ab0471c 100644
@@ -97,6 +97,7 @@ struct i2caux *dal_i2caux_dce100_create(
 
 	dal_i2caux_dce110_construct(i2caux_dce110,
 				    ctx,
+				    ARRAY_SIZE(dce100_aux_regs),
 				    dce100_aux_regs,
 				    dce100_hw_engine_regs,
 				    &i2c_shift,
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.c +4 -2
index 2a047f8ca0e9..e0557d353818 100644
@@ -199,6 +199,7 @@ static const struct dce110_i2c_hw_engine_mask i2c_mask = {
 void dal_i2caux_dce110_construct(
 	struct i2caux_dce110 *i2caux_dce110,
 	struct dc_context *ctx,
+	unsigned int num_i2caux_inst,
 	const struct dce110_aux_registers aux_regs[],
 	const struct dce110_i2c_hw_engine_registers i2c_hw_engine_regs[],
 	const struct dce110_i2c_hw_engine_shift *i2c_shift,
@@ -251,7 +252,7 @@ void dal_i2caux_dce110_construct(
 			dal_i2c_hw_engine_dce110_create(&hw_arg_dce110);
 
 		++i;
-	} while (i < ARRAY_SIZE(hw_ddc_lines));
+	} while (i < num_i2caux_inst);
 
 	/* Create AUX engines for all lines which has assisted HW AUX
 	 * 'i' (loop counter) used as DDC/AUX engine_id */
@@ -272,7 +273,7 @@ void dal_i2caux_dce110_construct(
 			dal_aux_engine_dce110_create(&aux_init_data);
 
 		++i;
-	} while (i < ARRAY_SIZE(hw_aux_lines));
+	} while (i < num_i2caux_inst);
 
 	/*TODO Generic I2C SW and HW*/
 }
@@ -303,6 +304,7 @@ struct i2caux *dal_i2caux_dce110_create(
 
 	dal_i2caux_dce110_construct(i2caux_dce110,
 				    ctx,
+				    ARRAY_SIZE(dce110_aux_regs),
 				    dce110_aux_regs,
 				    i2c_hw_engine_regs,
 				    &i2c_shift,
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.h +1 -0
index 1b1f71c60ac9..d3d8cc58666a 100644
@@ -45,6 +45,7 @@ struct i2caux *dal_i2caux_dce110_create(
 void dal_i2caux_dce110_construct(
 	struct i2caux_dce110 *i2caux_dce110,
 	struct dc_context *ctx,
+	unsigned int num_i2caux_inst,
 	const struct dce110_aux_registers *aux_regs,
 	const struct dce110_i2c_hw_engine_registers *i2c_hw_engine_regs,
 	const struct dce110_i2c_hw_engine_shift *i2c_shift,
drivers/gpu/drm/amd/display/dc/i2caux/dce112/i2caux_dce112.c +1 -0
index dafc1a727f7f..a9db04738724 100644
@@ -93,6 +93,7 @@ static void construct(
 {
 	dal_i2caux_dce110_construct(i2caux_dce110,
 				    ctx,
+				    ARRAY_SIZE(dce112_aux_regs),
 				    dce112_aux_regs,
 				    dce112_hw_engine_regs,
 				    &i2c_shift,
drivers/gpu/drm/amd/display/dc/i2caux/dce120/i2caux_dce120.c +1 -0
index 0e7b18260027..6a4f344c1db4 100644
@@ -111,6 +111,7 @@ struct i2caux *dal_i2caux_dce120_create(
 
 	dal_i2caux_dce110_construct(i2caux_dce110,
 				    ctx,
+				    ARRAY_SIZE(dce120_aux_regs),
 				    dce120_aux_regs,
 				    dce120_hw_engine_regs,
 				    &i2c_shift,
drivers/gpu/drm/amd/display/dc/i2caux/dcn10/i2caux_dcn10.c +1 -0
index e44a8901f38b..a59c1f50c1e8 100644
@@ -111,6 +111,7 @@ struct i2caux *dal_i2caux_dcn10_create(
 
 	dal_i2caux_dce110_construct(i2caux_dce110,
 				    ctx,
+				    ARRAY_SIZE(dcn10_aux_regs),
 				    dcn10_aux_regs,
 				    dcn10_hw_engine_regs,
 				    &i2c_shift,
Signature · 6 lines
2.17.1

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

PATCH 10/54 drm/amd/display: generic indirect register access

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

add generic indirect register access following our register access pattern

this will make it easier to review code and programming sequence, with all the complexity hidden in macro

---
 drivers/gpu/drm/amd/display/dc/dc_helper.c    | 51 +++++++++++++++++++
 .../gpu/drm/amd/display/dc/inc/reg_helper.h   | 46 +++++++++++++++++
 2 files changed, 97 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_helper.c +51 -0
index bd0fda0ceb91..e68077e65565 100644
@@ -255,3 +255,54 @@ uint32_t generic_reg_wait(const struct dc_context *ctx,
 
 	return reg_val;
 }
+
+void generic_write_indirect_reg(const struct dc_context *ctx,
+		uint32_t addr_index, uint32_t addr_data,
+		uint32_t index, uint32_t data)
+{
+	dm_write_reg(ctx, addr_index, index);
+	dm_write_reg(ctx, addr_data, data);
+}
+
+uint32_t generic_read_indirect_reg(const struct dc_context *ctx,
+		uint32_t addr_index, uint32_t addr_data,
+		uint32_t index)
+{
+	uint32_t value = 0;
+
+	dm_write_reg(ctx, addr_index, index);
+	value = dm_read_reg(ctx, addr_data);
+
+	return value;
+}
+
+
+uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx,
+		uint32_t addr_index, uint32_t addr_data,
+		uint32_t index, uint32_t reg_val, int n,
+		uint8_t shift1, uint32_t mask1, uint32_t field_value1,
+		...)
+{
+	uint32_t shift, mask, field_value;
+	int i = 1;
+
+	va_list ap;
+
+	va_start(ap, field_value1);
+
+	reg_val = set_reg_field_value_ex(reg_val, field_value1, mask1, shift1);
+
+	while (i < n) {
+		shift = va_arg(ap, uint32_t);
+		mask = va_arg(ap, uint32_t);
+		field_value = va_arg(ap, uint32_t);
+
+		reg_val = set_reg_field_value_ex(reg_val, field_value, mask, shift);
+		i++;
+	}
+
+	generic_write_indirect_reg(ctx, addr_index, addr_data, index, reg_val);
+	va_end(ap);
+
+	return reg_val;
+}
drivers/gpu/drm/amd/display/dc/inc/reg_helper.h +46 -0

50 lines not on this page · raw message

Signature · 6 lines
2.17.1

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

PATCH 11/54 drm/amd/display: fix incorrect check for atom table size

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

in case we have very few pins in the table, check fails and we can't boot

---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +1 -1
index aeb56e402ccc..eab007e1793c 100644
@@ -678,7 +678,7 @@ static enum bp_result bios_parser_get_gpio_pin_info(
 		return BP_RESULT_BADBIOSTABLE;
 
 	if (sizeof(struct atom_common_table_header) +
-			sizeof(struct atom_gpio_pin_lut_v2_1)
+			sizeof(struct atom_gpio_pin_assignment)
 			> le16_to_cpu(header->table_header.structuresize))
 		return BP_RESULT_BADBIOSTABLE;
 
Signature · 6 lines
2.17.1

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

PATCH 12/54 drm/amd/display: set-read link rate and lane count through debugfs

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

function description
get/ set DP configuration: lane_count, link_rate, spread_spectrum

valid lane count value: 1, 2, 4
valid link rate value:
06h = 1.62Gbps per lane
0Ah = 2.7Gbps per lane
0Ch = 3.24Gbps per lane
14h = 5.4Gbps per lane
1Eh = 8.1Gbps per lane

debugfs is located at /sys/kernel/debug/dri/0/DP-x/link_settings

--- to get dp configuration

xxd -l 300 phy_settings

It will list current, verified, reported, preferred dp configuration. current -- for current video mode
verified --- maximum configuration which pass link training reported --- DP rx report caps (DPCD register offset 0, 1 2) preferred --- user force settings

--- set (or force) dp configuration

echo <lane_count> <link_rate>

for example, to force to 2 lane, 2.7GHz,
echo 4 0xa > link_settings

spread_spectrum could not be changed dynamically.

in case invalid lane count, link rate are force, no hw programming will be done. please check link settings after force operation to see if HW get programming.

xxd -l 300 link_settings

check current and preferred settings.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 227 +++++++++++++++---
 1 file changed, 196 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +196 -31
index cf5ea69e46ad..9ff8833b52c4 100644
@@ -26,38 +26,211 @@
 #include <linux/debugfs.h>
 
 #include "dc.h"
-#include "dc_link.h"
 
 #include "amdgpu.h"
 #include "amdgpu_dm.h"
 #include "amdgpu_dm_debugfs.h"
 
-static ssize_t dp_link_rate_debugfs_read(struct file *f, char __user *buf,
+/* function description
+ * get/ set DP configuration: lane_count, link_rate, spread_spectrum
+ *
+ * valid lane count value: 1, 2, 4
+ * valid link rate value:
+ * 06h = 1.62Gbps per lane
+ * 0Ah = 2.7Gbps per lane
+ * 0Ch = 3.24Gbps per lane
+ * 14h = 5.4Gbps per lane
+ * 1Eh = 8.1Gbps per lane
+ *
+ * debugfs is located at /sys/kernel/debug/dri/0/DP-x/link_settings
+ *
+ * --- to get dp configuration
+ *
+ * xxd -l 300 phy_settings
+ *
+ * It will list current, verified, reported, preferred dp configuration.
+ * current -- for current video mode
+ * verified --- maximum configuration which pass link training
+ * reported --- DP rx report caps (DPCD register offset 0, 1 2)
+ * preferred --- user force settings
+ *
+ * --- set (or force) dp configuration
+ *
+ * echo <lane_count>  <link_rate>
+ *
+ * for example, to force to  2 lane, 2.7GHz,
+ * echo 4 0xa > link_settings
+ *
+ * spread_spectrum could not be changed dynamically.
+ *
+ * in case invalid lane count, link rate are force, no hw programming will be
+ * done. please check link settings after force operation to see if HW get
+ * programming.
+ *
+ * xxd -l 300 link_settings
+ *
+ * check current and preferred settings.
+ *
+ */
+static ssize_t dp_link_settings_read(struct file *f, char __user *buf,
 				 size_t size, loff_t *pos)
 {
-	/* TODO: create method to read link rate */
-	return 1;
-}
+	struct amdgpu_dm_connector *connector = file_inode(f)->i_private;
+	struct dc_link *link = connector->dc_link;
+	char *rd_buf = NULL;
+	char *rd_buf_ptr = NULL;
+	uint32_t rd_buf_size = 320;
+	int bytes_to_user;
+	uint8_t str_len = 0;
+	int r;
 
-static ssize_t dp_link_rate_debugfs_write(struct file *f, const char __user *buf,
-				 size_t size, loff_t *pos)
-{
-	/* TODO: create method to write link rate */
-	return 1;
-}
+	if (size == 0)
+		return 0;
 
-static ssize_t dp_lane_count_debugfs_read(struct file *f, char __user *buf,
-				 size_t size, loff_t *pos)
-{
-	/* TODO: create method to read lane count */
-	return 1;
+	rd_buf = kcalloc(rd_buf_size, sizeof(char), GFP_KERNEL);
+	if (!rd_buf)
+		return 0;
+
+	rd_buf_ptr = rd_buf;
+
+	str_len = strlen("Current:  %d  %d  %d  ");
+	snprintf(rd_buf_ptr, str_len, "Current:  %d  %d  %d  ",
+			link->cur_link_settings.lane_count,
+			link->cur_link_settings.link_rate,
+			link->cur_link_settings.link_spread);
+	rd_buf_ptr = rd_buf_ptr + str_len;
+
+	str_len = strlen("Verified:  %d  %d  %d  ");
+	snprintf(rd_buf_ptr, str_len, "Verified:  %d  %d  %d  ",
+			link->verified_link_cap.lane_count,
+			link->verified_link_cap.link_rate,
+			link->verified_link_cap.link_spread);
+	rd_buf_ptr = rd_buf_ptr + str_len;
+
+	str_len = strlen("Reported:  %d  %d  %d  ");
+	snprintf(rd_buf_ptr, str_len, "Reported:  %d  %d  %d  ",
+			link->reported_link_cap.lane_count,
+			link->reported_link_cap.link_rate,
+			link->reported_link_cap.link_spread);
+	rd_buf_ptr = rd_buf_ptr + str_len;
+
+	str_len = strlen("Preferred:  %d  %d  %d  ");
+	snprintf(rd_buf_ptr, str_len, "Preferred:  %d  %d  %d  ",
+			link->preferred_link_setting.lane_count,
+			link->preferred_link_setting.link_rate,
+			link->preferred_link_setting.link_spread);
+
+	r = copy_to_user(buf, rd_buf, rd_buf_size);
+
+	bytes_to_user = rd_buf_size - r;
+
+	if (r > rd_buf_size) {
+		bytes_to_user = 0;
+		DRM_DEBUG_DRIVER("data not copy to user");
+	}
+
+	kfree(rd_buf);
+	return bytes_to_user;
 }
 
-static ssize_t dp_lane_count_debugfs_write(struct file *f, const char __user *buf,
+static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 				 size_t size, loff_t *pos)
 {
-	/* TODO: create method to write lane count */
-	return 1;
+	struct amdgpu_dm_connector *connector = file_inode(f)->i_private;
+	struct dc_link *link = connector->dc_link;
+	struct dc *dc = (struct dc *)link->dc;
+	struct dc_link_settings prefer_link_settings;
+	char *wr_buf = NULL;
+	char *wr_buf_ptr = NULL;
+	uint32_t wr_buf_size = 40;
+	int r;
+	int bytes_from_user;
+	char *sub_str;
+	/* 0: lane_count; 1: link_rate */
+	uint8_t param_index = 0;
+	long param[2];
+	const char delimiter[3] = {' ', '\n', '\0'};
+	bool valid_input = false;
+
+	if (size == 0)
+		return 0;
+
+	wr_buf = kcalloc(wr_buf_size, sizeof(char), GFP_KERNEL);
+	if (!wr_buf)
+		return 0;
+	wr_buf_ptr = wr_buf;
+
+	r = copy_from_user(wr_buf_ptr, buf, wr_buf_size);
+
+	/* r is bytes not be copied */
+	if (r >= wr_buf_size) {
+		kfree(wr_buf);
+		DRM_DEBUG_DRIVER("user data not read\n");
+		return 0;
+	}
+
+	bytes_from_user = wr_buf_size - r;
+
+	while (isspace(*wr_buf_ptr))
+		wr_buf_ptr++;
+
+	while ((*wr_buf_ptr != '\0') && (param_index < 2)) {
+
+		sub_str = strsep(&wr_buf_ptr, delimiter);
+
+		r = kstrtol(sub_str, 16, &param[param_index]);
+
+		if (r)
+			DRM_DEBUG_DRIVER(" -EINVAL convert error happens!\n");
+
+		param_index++;
+		while (isspace(*wr_buf_ptr))
+			wr_buf_ptr++;
+	}
+
+	DRM_DEBUG_DRIVER("Lane_count:  %lx\n", param[0]);
+	DRM_DEBUG_DRIVER("link_rate:  %lx\n", param[1]);
+
+	switch (param[0]) {
+	case LANE_COUNT_ONE:
+	case LANE_COUNT_TWO:
+	case LANE_COUNT_FOUR:
+		valid_input = true;
+		break;
+	default:
+		break;
+	}
+
+	switch (param[1]) {
+	case LINK_RATE_LOW:
+	case LINK_RATE_HIGH:
+	case LINK_RATE_RBR2:
+	case LINK_RATE_HIGH2:
+	case LINK_RATE_HIGH3:
+		valid_input = true;
+		break;
+	default:
+		break;
+	}
+
+	if (!valid_input) {
+		kfree(wr_buf);
+		DRM_DEBUG_DRIVER("Invalid Input value  exceed  No HW will be programmed\n");
+		return bytes_from_user;
+	}
+
+	/* save user force lane_count, link_rate to preferred settings
+	 * spread spectrum will not be changed
+	 */
+	prefer_link_settings.link_spread = link->cur_link_settings.link_spread;
+	prefer_link_settings.lane_count = param[0];
+	prefer_link_settings.link_rate = param[1];
+
+	dc_link_set_preferred_link_settings(dc, &prefer_link_settings, link);
+
+	kfree(wr_buf);
+
+	return bytes_from_user;
 }
 
 static ssize_t dp_voltage_swing_debugfs_read(struct file *f, char __user *buf,
@@ -102,17 +275,10 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
 	return 1;
 }
 
-static const struct file_operations dp_link_rate_fops = {
-	.owner = THIS_MODULE,
-	.read = dp_link_rate_debugfs_read,
-	.write = dp_link_rate_debugfs_write,
-	.llseek = default_llseek
-};
-
-static const struct file_operations dp_lane_count_fops = {
+static const struct file_operations dp_link_settings_debugfs_fops = {
 	.owner = THIS_MODULE,
-	.read = dp_lane_count_debugfs_read,
-	.write = dp_lane_count_debugfs_write,
+	.read = dp_link_settings_read,
+	.write = dp_link_settings_write,
 	.llseek = default_llseek
 };
 
@@ -141,8 +307,7 @@ static const struct {
 	char *name;
 	const struct file_operations *fops;
 } dp_debugfs_entries[] = {
-		{"link_rate", &dp_link_rate_fops},
-		{"lane_count", &dp_lane_count_fops},
+		{"link_settings", &dp_link_settings_debugfs_fops},
 		{"voltage_swing", &dp_voltage_swing_fops},
 		{"pre_emphasis", &dp_pre_emphasis_fops},
 		{"phy_test_pattern", &dp_phy_test_pattern_fops}
Signature · 6 lines
2.17.1

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

PATCH 13/54 drm/amd/display: dal 3.1.53

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 59985baac11e..85533619440a 100644
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-#define DC_VER "3.1.52"
+#define DC_VER "3.1.53"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
Signature · 6 lines
2.17.1

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

PATCH 14/54 drm/amd/display: Correct calculation of duration time.

In reply to a message not in the archive

From: Hugo Hu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -2
index b96525036f94..e2098f3e5b45 100644
@@ -864,10 +864,10 @@ void hwss_edp_power_control(
 		if (power_up) {
 			unsigned long long current_ts = dm_get_timestamp(ctx);
 			unsigned long long duration_in_ms =
-					dm_get_elapse_time_in_ns(
+					div64_u64(dm_get_elapse_time_in_ns(
 							ctx,
 							current_ts,
-							div64_u64(link->link_trace.time_stamp.edp_poweroff, 1000000));
+							link->link_trace.time_stamp.edp_poweroff), 1000000);
 			unsigned long long wait_time_ms = 0;
 
 			/* max 500ms from LCDVDD off to on */
Signature · 6 lines
2.17.1

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

PATCH 15/54 drm/amd/display: Add Azalia registers to HW sequencer

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +4 -1
index 057407892618..f091d87f8f8b 100644
@@ -275,6 +275,8 @@ struct dce_hwseq_registers {
 	uint32_t MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB;
 	uint32_t MC_VM_SYSTEM_APERTURE_LOW_ADDR;
 	uint32_t MC_VM_SYSTEM_APERTURE_HIGH_ADDR;
+	uint32_t AZALIA_AUDIO_DTO;
+	uint32_t AZALIA_CONTROLLER_CLOCK_GATING;
 };
  /* set field name */
 #define HWS_SF(blk_name, reg_name, field_name, post_fix)\
@@ -500,7 +502,8 @@ struct dce_hwseq_registers {
 	type D1VGA_MODE_ENABLE; \
 	type D2VGA_MODE_ENABLE; \
 	type D3VGA_MODE_ENABLE; \
-	type D4VGA_MODE_ENABLE;
+	type D4VGA_MODE_ENABLE; \
+	type AZALIA_AUDIO_DTO_MODULE;
 
 struct dce_hwseq_shift {
 	HWSEQ_REG_FIELD_LIST(uint8_t)
Signature · 6 lines
2.17.1

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

PATCH 16/54 drm/amd/display: Define couple extra DCN registers

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h           | 1 +
 .../gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h    | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +1 -0
index f091d87f8f8b..df3203a1d278 100644
@@ -147,6 +147,7 @@
 	SR(DCCG_GATE_DISABLE_CNTL2), \
 	SR(DCFCLK_CNTL),\
 	SR(DCFCLK_CNTL), \
+	SR(DC_MEM_GLOBAL_PWR_REQ_CNTL), \
 	/* todo:  get these from GVM instead of reading registers ourselves */\
 	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32),\
 	MMHUB_SR(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32),\
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h +7 -2
index 2a97cdb2cfbb..d8ef30bed9ff 100644
@@ -42,6 +42,7 @@
 #define LE_DCN_COMMON_REG_LIST(id) \
 	SRI(DIG_BE_CNTL, DIG, id), \
 	SRI(DIG_BE_EN_CNTL, DIG, id), \
+	SRI(TMDS_CTL_BITS, DIG, id), \
 	SRI(DP_CONFIG, DP, id), \
 	SRI(DP_DPHY_CNTL, DP, id), \
 	SRI(DP_DPHY_PRBS_CNTL, DP, id), \
@@ -64,6 +65,7 @@
 	SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \
 	SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id)
 
+
 #define LE_DCN10_REG_LIST(id)\
 	LE_DCN_COMMON_REG_LIST(id)
 
@@ -100,6 +102,7 @@ struct dcn10_link_enc_registers {
 	uint32_t DP_DPHY_BS_SR_SWAP_CNTL;
 	uint32_t DP_DPHY_HBR2_PATTERN_CONTROL;
 	uint32_t DP_SEC_CNTL1;
+	uint32_t TMDS_CTL_BITS;
 };
 
 #define LE_SF(reg_name, field_name, post_fix)\
@@ -110,6 +113,7 @@ struct dcn10_link_enc_registers {
 	LE_SF(DIG0_DIG_BE_CNTL, DIG_HPD_SELECT, mask_sh),\
 	LE_SF(DIG0_DIG_BE_CNTL, DIG_MODE, mask_sh),\
 	LE_SF(DIG0_DIG_BE_CNTL, DIG_FE_SOURCE_SELECT, mask_sh),\
+	LE_SF(DIG0_TMDS_CTL_BITS, TMDS_CTL0, mask_sh), \
 	LE_SF(DP0_DP_DPHY_CNTL, DPHY_BYPASS, mask_sh),\
 	LE_SF(DP0_DP_DPHY_CNTL, DPHY_ATEST_SEL_LANE0, mask_sh),\
 	LE_SF(DP0_DP_DPHY_CNTL, DPHY_ATEST_SEL_LANE1, mask_sh),\
@@ -198,10 +202,11 @@ struct dcn10_link_enc_registers {
 	type DP_MSE_SAT_SLOT_COUNT3;\
 	type DP_MSE_SAT_UPDATE;\
 	type DP_MSE_16_MTP_KEEPOUT;\
+	type DC_HPD_EN;\
+	type TMDS_CTL0;\
 	type AUX_HPD_SEL;\
 	type AUX_LS_READ_EN;\
-	type AUX_RX_RECEIVE_WINDOW;\
-	type DC_HPD_EN
+	type AUX_RX_RECEIVE_WINDOW
 
 struct dcn10_link_enc_shift {
 	DCN_LINK_ENCODER_REG_FIELD_LIST(uint8_t);
Signature · 6 lines
2.17.1

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

PATCH 17/54 drm/amd/display: Expose configure_encoder for link_encoder

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 3 +--
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +1 -2
index fd9dc70190a8..18a7cac4f6e3 100644
@@ -445,12 +445,11 @@ static uint8_t get_frontend_source(
 	}
 }
 
-static void configure_encoder(
+void configure_encoder(
 	struct dcn10_link_encoder *enc10,
 	const struct dc_link_settings *link_settings)
 {
 	/* set number of lanes */
-
 	REG_SET(DP_CONFIG, 0,
 			DP_UDI_LANES, link_settings->lane_count - LANE_COUNT_ONE);
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h +4 -0
index d8ef30bed9ff..cd3bb5d40579 100644
@@ -271,6 +271,10 @@ void dcn10_link_encoder_setup(
 	struct link_encoder *enc,
 	enum signal_type signal);
 
+void configure_encoder(
+	struct dcn10_link_encoder *enc10,
+	const struct dc_link_settings *link_settings);
+
 /* enables TMDS PHY output */
 /* TODO: still need depth or just pass in adjusted pixel clock? */
 void dcn10_link_encoder_enable_tmds_output(
Signature · 6 lines
2.17.1

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

PATCH 18/54 drm/amd/display: Serialize is_dp_sink_present

In reply to a message not in the archive

Access to GPIO needs to be serialized. Aux transactions are already serialized in DRM but we also need to serialize access to the GPIO pin for purposes of DP dongle detection.

Call is_dp_sink_present through DM so we can lock correctly. This follows the same pattern used for DPCD transactions.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c    | 16 ++++++++++++++++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c    |  4 ++--
 drivers/gpu/drm/amd/display/dc/dc_link.h         |  2 ++
 drivers/gpu/drm/amd/display/dc/dm_helpers.h      |  3 +++
 4 files changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +16 -0
index b19dc4cfc030..7b51b8fde3fe 100644
@@ -454,6 +454,22 @@ bool dm_helpers_submit_i2c(
 	return result;
 }
 
+bool dm_helpers_is_dp_sink_present(struct dc_link *link)
+{
+	bool dp_sink_present;
+	struct amdgpu_dm_connector *aconnector = link->priv;
+
+	if (!aconnector) {
+		BUG_ON("Failed to found connector for link!");
+		return true;
+	}
+
+	mutex_lock(&aconnector->dm_dp_aux.aux.hw_mutex);
+	dp_sink_present = dc_link_is_dp_sink_present(link);
+	mutex_unlock(&aconnector->dm_dp_aux.aux.hw_mutex);
+	return dp_sink_present;
+}
+
 enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_context *ctx,
 		struct dc_link *link,
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
index d6259698470b..bbe43fdba036 100644
@@ -313,7 +313,7 @@ static enum signal_type get_basic_signal_type(
  * @brief
  * Check whether there is a dongle on DP connector
  */
-static bool is_dp_sink_present(struct dc_link *link)
+bool dc_link_is_dp_sink_present(struct dc_link *link)
 {
 	enum gpio_result gpio_result;
 	uint32_t clock_pin = 0;
@@ -406,7 +406,7 @@ static enum signal_type link_detect_sink(
 			 * we assume signal is DVI; it could be corrected
 			 * to HDMI after dongle detection
 			 */
-			if (!is_dp_sink_present(link))
+			if (!dm_helpers_is_dp_sink_present(link))
 				result = SIGNAL_TYPE_DVI_SINGLE_LINK;
 		}
 	}
drivers/gpu/drm/amd/display/dc/dc_link.h +2 -0
index 83eea42452b5..eda4a5d3ff1c 100644
@@ -210,6 +210,8 @@ bool dc_link_dp_set_test_pattern(
 
 void dc_link_enable_hpd_filter(struct dc_link *link, bool enable);
 
+bool dc_link_is_dp_sink_present(struct dc_link *link);
+
 /*
  * DPCD access interfaces
  */
drivers/gpu/drm/amd/display/dc/dm_helpers.h +3 -0
index 034369fbb9e2..7e6b9f5b8906 100644
@@ -103,6 +103,9 @@ bool dm_helpers_submit_i2c(
 		const struct dc_link *link,
 		struct i2c_command *cmd);
 
+bool dm_helpers_is_dp_sink_present(
+		struct dc_link *link);
+
 enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_context *ctx,
 		struct dc_link *link,
Signature · 6 lines
2.17.1

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

PATCH 19/54 drm/amd/display: Break out function to simply read aux reply

In reply to a message not in the archive

DRM's DP helpers take care of dealing with the error code for us. In order not to step on each other's toes we'll need to be able to simply read auch channel replies without further logic based on return values.

---
 .../drm/amd/display/dc/i2caux/aux_engine.h    |   6 +
 .../dc/i2caux/dce110/aux_engine_dce110.c      | 119 ++++++++++--------
 2 files changed, 76 insertions(+), 49 deletions(-)
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h +6 -0
index b01488f710d5..c33a2898d967 100644
@@ -44,6 +44,12 @@ struct aux_engine_funcs {
 	void (*process_channel_reply)(
 		struct aux_engine *engine,
 		struct aux_reply_transaction_data *reply);
+	int (*read_channel_reply)(
+		struct aux_engine *engine,
+		uint32_t size,
+		uint8_t *buffer,
+		uint8_t *reply_result,
+		uint32_t *sw_status);
 	enum aux_channel_operation_result (*get_channel_status)(
 		struct aux_engine *engine,
 		uint8_t *returned_bytes);
drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c +70 -49

154 lines not on this page · raw message

Signature · 6 lines
2.17.1

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

PATCH 20/54 drm/amd/display: Return aux replies directly to DRM

In reply to a message not in the archive

Currently we still go through DC code that does error checking, retries, etc. There's no need for that since DRM already does that for us. This simplifies the code a bit and makes it easier to debug.

This also ensures we correctly tell DRM how many bytes have actually been read, as we should. This allows DRM to correctly read the EDID on the Chamelium DP port.

---
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |  89 ++++++++-----
 .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 120 ++++++++----------
 .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h  |  22 +---
 3 files changed, 117 insertions(+), 114 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +56 -33
index db669c427dab..00b44d0eda32 100644
@@ -80,52 +80,72 @@ static void log_dpcd(uint8_t type,
 static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 				  struct drm_dp_aux_msg *msg)
 {
-	enum i2c_mot_mode mot = (msg->request & DP_AUX_I2C_MOT) ?
-		I2C_MOT_TRUE : I2C_MOT_FALSE;
-	enum ddc_result res;
+	ssize_t result = 0;
+	enum i2caux_transaction_action action;
+	enum aux_transaction_type type;
 
 	if (WARN_ON(msg->size > 16))
 		return -E2BIG;
 
 	switch (msg->request & ~DP_AUX_I2C_MOT) {
 	case DP_AUX_NATIVE_READ:
-		res = dal_ddc_service_read_dpcd_data(
-				TO_DM_AUX(aux)->ddc_service,
-				false,
-				I2C_MOT_UNDEF,
-				msg->address,
-				msg->buffer,
-				msg->size);
+		type = AUX_TRANSACTION_TYPE_DP;
+		action = I2CAUX_TRANSACTION_ACTION_DP_READ;
+
+		result = dc_link_aux_transfer(TO_DM_AUX(aux)->ddc_service,
+					      msg->address,
+					      &msg->reply,
+					      msg->buffer,
+					      msg->size,
+					      type,
+					      action);
 		break;
 	case DP_AUX_NATIVE_WRITE:
-		res = dal_ddc_service_write_dpcd_data(
-				TO_DM_AUX(aux)->ddc_service,
-				false,
-				I2C_MOT_UNDEF,
-				msg->address,
-				msg->buffer,
-				msg->size);
+		type = AUX_TRANSACTION_TYPE_DP;
+		action = I2CAUX_TRANSACTION_ACTION_DP_WRITE;
+
+		dc_link_aux_transfer(TO_DM_AUX(aux)->ddc_service,
+				     msg->address,
+				     &msg->reply,
+				     msg->buffer,
+				     msg->size,
+				     type,
+				     action);
+		result = msg->size;
 		break;
 	case DP_AUX_I2C_READ:
-		res = dal_ddc_service_read_dpcd_data(
-				TO_DM_AUX(aux)->ddc_service,
-				true,
-				mot,
-				msg->address,
-				msg->buffer,
-				msg->size);
+		type = AUX_TRANSACTION_TYPE_I2C;
+		if (msg->request & DP_AUX_I2C_MOT)
+			action = I2CAUX_TRANSACTION_ACTION_I2C_READ_MOT;
+		else
+			action = I2CAUX_TRANSACTION_ACTION_I2C_READ;
+
+		result = dc_link_aux_transfer(TO_DM_AUX(aux)->ddc_service,
+					      msg->address,
+					      &msg->reply,
+					      msg->buffer,
+					      msg->size,
+					      type,
+					      action);
 		break;
 	case DP_AUX_I2C_WRITE:
-		res = dal_ddc_service_write_dpcd_data(
-				TO_DM_AUX(aux)->ddc_service,
-				true,
-				mot,
-				msg->address,
-				msg->buffer,
-				msg->size);
+		type = AUX_TRANSACTION_TYPE_I2C;
+		if (msg->request & DP_AUX_I2C_MOT)
+			action = I2CAUX_TRANSACTION_ACTION_I2C_WRITE_MOT;
+		else
+			action = I2CAUX_TRANSACTION_ACTION_I2C_WRITE;
+
+		dc_link_aux_transfer(TO_DM_AUX(aux)->ddc_service,
+				     msg->address,
+				     &msg->reply,
+				     msg->buffer,
+				     msg->size,
+				     type,
+				     action);
+		result = msg->size;
 		break;
 	default:
-		return 0;
+		return -EINVAL;
 	}
 
 #ifdef TRACE_DPCD
@@ -136,7 +156,10 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 		 r == DDC_RESULT_SUCESSFULL);
 #endif
 
-	return msg->size;
+	if (result < 0) /* DC doesn't know about kernel error codes */
+		result = -EIO;
+
+	return result;
 }
 
 static enum drm_connector_status
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +54 -66

138 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h +7 -15
index 0bf73b742f1f..538b83303b86 100644
@@ -102,21 +102,13 @@ bool dal_ddc_service_query_ddc_data(
 		uint8_t *read_buf,
 		uint32_t read_size);
 
-enum ddc_result dal_ddc_service_read_dpcd_data(
-		struct ddc_service *ddc,
-		bool i2c,
-		enum i2c_mot_mode mot,
-		uint32_t address,
-		uint8_t *data,
-		uint32_t len);
-
-enum ddc_result dal_ddc_service_write_dpcd_data(
-		struct ddc_service *ddc,
-		bool i2c,
-		enum i2c_mot_mode mot,
-		uint32_t address,
-		const uint8_t *data,
-		uint32_t len);
+int dc_link_aux_transfer(struct ddc_service *ddc,
+			     unsigned int address,
+			     uint8_t *reply,
+			     void *buffer,
+			     unsigned int size,
+			     enum aux_transaction_type type,
+			     enum i2caux_transaction_action action);
 
 void dal_ddc_service_write_scdc_data(
 		struct ddc_service *ddc_service,
Signature · 6 lines
2.17.1

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

PATCH 21/54 drm/amd/display: Convert remaining loggers off dc_logger

In reply to a message not in the archive

From: Nicholas Kazlauskas <[email protected]>

- Removed dal/dm/dc loggers from linux, switched to kernel prints
- Modified functions that used these directly to use macros
- dc_logger support is completely dropped from Linux

---
 drivers/gpu/drm/amd/display/TODO              |   8 +-
 .../gpu/drm/amd/display/dc/basics/Makefile    |   2 +-
 .../drm/amd/display/dc/basics/log_helpers.c   |  71 +--
 .../gpu/drm/amd/display/dc/basics/logger.c    | 406 ------------------
 .../drm/amd/display/dc/calcs/calcs_logger.h   |   9 +-
 .../gpu/drm/amd/display/dc/calcs/dce_calcs.c  |   6 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c      |  15 +-
 .../gpu/drm/amd/display/dc/core/dc_stream.c   |  23 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |   5 +-
 drivers/gpu/drm/amd/display/dc/dc_types.h     |   2 -
 .../amd/display/dc/dce110/dce110_resource.c   |  34 +-
 .../amd/display/dc/dce112/dce112_resource.c   |  34 +-
 .../amd/display/include/logger_interface.h    | 138 ++----
 .../drm/amd/display/include/logger_types.h    |  59 ---
 14 files changed, 99 insertions(+), 713 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/basics/logger.c
drivers/gpu/drm/amd/display/TODO +4 -4
index 357d59648401..a8a6c106e8c7 100644
@@ -97,10 +97,10 @@ share it with drivers. But that's a very long term goal, and by far not just an
 issue with DC - other drivers, especially around DP sink handling, are equally
 guilty.
 
-19. The DC logger is still a rather sore thing, but I know that the DRM_DEBUG
-stuff just isn't up to the challenges either. We need to figure out something
-that integrates better with DRM and linux debug printing, while not being
-useless with filtering output. dynamic debug printing might be an option.
+19. DONE - The DC logger is still a rather sore thing, but I know that the
+DRM_DEBUG stuff just isn't up to the challenges either. We need to figure out
+something that integrates better with DRM and linux debug printing, while not
+being useless with filtering output. dynamic debug printing might be an option.
 
 20. Use kernel i2c device to program HDMI retimer. Some boards have an HDMI
 retimer that we need to program to pass PHY compliance. Currently that's
drivers/gpu/drm/amd/display/dc/basics/Makefile +1 -1
index b49ea96b5dae..a50a76471107 100644
@@ -25,7 +25,7 @@
 # subcomponents.
 
 BASICS = conversion.o fixpt31_32.o \
-	logger.o log_helpers.o vector.o
+	log_helpers.o vector.o
 
 AMD_DAL_BASICS = $(addprefix $(AMDDALPATH)/dc/basics/,$(BASICS))
 
drivers/gpu/drm/amd/display/dc/basics/log_helpers.c +3 -68

80 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/basics/logger.c deleted +0 -406

406 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/calcs/calcs_logger.h +4 -5
index fc3f98fb09ea..62435bfc274d 100644
@@ -25,10 +25,9 @@
 
 #ifndef _CALCS_CALCS_LOGGER_H_
 #define _CALCS_CALCS_LOGGER_H_
-#define DC_LOGGER \
-	logger
+#define DC_LOGGER ctx->logger
 
-static void print_bw_calcs_dceip(struct dal_logger *logger, const struct bw_calcs_dceip *dceip)
+static void print_bw_calcs_dceip(struct dc_context *ctx, const struct bw_calcs_dceip *dceip)
 {
 
 	DC_LOG_BANDWIDTH_CALCS("#####################################################################");
@@ -122,7 +121,7 @@ static void print_bw_calcs_dceip(struct dal_logger *logger, const struct bw_calc
 
 }
 
-static void print_bw_calcs_vbios(struct dal_logger *logger, const struct bw_calcs_vbios *vbios)
+static void print_bw_calcs_vbios(struct dc_context *ctx, const struct bw_calcs_vbios *vbios)
 {
 
 	DC_LOG_BANDWIDTH_CALCS("#####################################################################");
@@ -181,7 +180,7 @@ static void print_bw_calcs_vbios(struct dal_logger *logger, const struct bw_calc
 
 }
 
-static void print_bw_calcs_data(struct dal_logger *logger, struct bw_calcs_data *data)
+static void print_bw_calcs_data(struct dc_context *ctx, struct bw_calcs_data *data)
 {
 
 	int i, j, k;
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +3 -3
index 2c4e8f0cb2dc..160d11a15eac 100644
@@ -3010,9 +3010,9 @@ bool bw_calcs(struct dc_context *ctx,
 		struct bw_fixed low_yclk = vbios->low_yclk;
 
 		if (ctx->dc->debug.bandwidth_calcs_trace) {
-			print_bw_calcs_dceip(ctx->logger, dceip);
-			print_bw_calcs_vbios(ctx->logger, vbios);
-			print_bw_calcs_data(ctx->logger, data);
+			print_bw_calcs_dceip(ctx, dceip);
+			print_bw_calcs_vbios(ctx, vbios);
+			print_bw_calcs_data(ctx, data);
 		}
 		calculate_bandwidth(dceip, vbios, data);
 
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -14
index 03b3bd649712..f02d92c7eca3 100644
@@ -465,9 +465,6 @@ static void destruct(struct dc *dc)
 	if (dc->ctx->created_bios)
 		dal_bios_parser_destroy(&dc->ctx->dc_bios);
 
-	if (dc->ctx->logger)
-		dal_logger_destroy(&dc->ctx->logger);
-
 	kfree(dc->ctx);
 	dc->ctx = NULL;
 
@@ -490,7 +487,6 @@ static void destruct(struct dc *dc)
 static bool construct(struct dc *dc,
 		const struct dc_init_data *init_params)
 {
-	struct dal_logger *logger;
 	struct dc_context *dc_ctx;
 	struct bw_calcs_dceip *dc_dceip;
 	struct bw_calcs_vbios *dc_vbios;
@@ -555,14 +551,7 @@ static bool construct(struct dc *dc,
 	}
 
 	/* Create logger */
-	logger = dal_logger_create(dc_ctx, init_params->log_mask);
 
-	if (!logger) {
-		/* can *not* call logger. call base driver 'print error' */
-		dm_error("%s: failed to create Logger!\n", __func__);
-		goto fail;
-	}
-	dc_ctx->logger = logger;
 	dc_ctx->dce_environment = init_params->dce_environment;
 
 	dc_version = resource_parse_asic_id(init_params->asic_id);
@@ -981,9 +970,7 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
 	for (i = 0; i < context->stream_count; i++) {
 		struct dc_stream_state *stream = context->streams[i];
 
-		dc_stream_log(stream,
-				dc->ctx->logger,
-				LOG_DC);
+		dc_stream_log(dc, stream);
 	}
 
 	result = dc_commit_state_no_check(dc, context);
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +8 -15
index 3732a1de9d6c..0223f4867e8d 100644
@@ -30,6 +30,8 @@
 #include "ipp.h"
 #include "timing_generator.h"
 
+#define DC_LOGGER dc->ctx->logger
+
 /*******************************************************************************
  * Private functions
  ******************************************************************************/
@@ -317,16 +319,10 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
 	return ret;
 }
 
-
-void dc_stream_log(
-	const struct dc_stream_state *stream,
-	struct dal_logger *dm_logger,
-	enum dc_log_type log_type)
+void dc_stream_log(const struct dc *dc, const struct dc_stream_state *stream)
 {
-
-	dm_logger_write(dm_logger,
-			log_type,
-			"core_stream 0x%x: src: %d, %d, %d, %d; dst: %d, %d, %d, %d, colorSpace:%d\n",
+	DC_LOG_DC(
+			"core_stream 0x%p: src: %d, %d, %d, %d; dst: %d, %d, %d, %d, colorSpace:%d\n",
 			stream,
 			stream->src.x,
 			stream->src.y,
@@ -337,21 +333,18 @@ void dc_stream_log(
 			stream->dst.width,
 			stream->dst.height,
 			stream->output_color_space);
-	dm_logger_write(dm_logger,
-			log_type,
+	DC_LOG_DC(
 			"\tpix_clk_khz: %d, h_total: %d, v_total: %d, pixelencoder:%d, displaycolorDepth:%d\n",
 			stream->timing.pix_clk_khz,
 			stream->timing.h_total,
 			stream->timing.v_total,
 			stream->timing.pixel_encoding,
 			stream->timing.display_color_depth);
-	dm_logger_write(dm_logger,
-			log_type,
+	DC_LOG_DC(
 			"\tsink name: %s, serial: %d\n",
 			stream->sink->edid_caps.display_name,
 			stream->sink->edid_caps.serial_number);
-	dm_logger_write(dm_logger,
-			log_type,
+	DC_LOG_DC(
 			"\tlink: %d\n",
 			stream->sink->link->link_index);
 }
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -4
index f0e8d19efa4a..532b2aff2227 100644
@@ -159,10 +159,7 @@ void dc_commit_updates_for_stream(struct dc *dc,
 /*
  * Log the current stream state.
  */
-void dc_stream_log(
-	const struct dc_stream_state *stream,
-	struct dal_logger *dc_logger,
-	enum dc_log_type log_type);
+void dc_stream_log(const struct dc *dc, const struct dc_stream_state *stream);
 
 uint8_t dc_get_current_stream_count(struct dc *dc);
 struct dc_stream_state *dc_get_stream_at_index(struct dc *dc, uint8_t i);
drivers/gpu/drm/amd/display/dc/dc_types.h +0 -2
index 94672490b917..59bf0d5f58e8 100644
@@ -77,8 +77,6 @@ struct dc_context {
 	struct dc *dc;
 
 	void *driver_context; /* e.g. amdgpu_device */
-
-	struct dal_logger *logger;
 	void *cgs_device;
 
 	enum dce_environment dce_environment;
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +14 -20
index 3edaa006bd57..1c902e49a712 100644
@@ -794,43 +794,38 @@ static bool dce110_validate_bandwidth(
 
 	if (memcmp(&dc->current_state->bw.dce,
 			&context->bw.dce, sizeof(context->bw.dce))) {
-		struct log_entry log_entry;
-		dm_logger_open(
-			dc->ctx->logger,
-			&log_entry,
-			LOG_BANDWIDTH_CALCS);
-		dm_logger_append(&log_entry, "%s: finish,\n"
+
+		DC_LOG_BANDWIDTH_CALCS(
+			"%s: finish,\n"
+			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
+			"stutMark_b: %d stutMark_a: %d\n"
 			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
-			"stutMark_b: %d stutMark_a: %d\n",
+			"stutMark_b: %d stutMark_a: %d\n"
+			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
+			"stutMark_b: %d stutMark_a: %d stutter_mode_enable: %d\n"
+			"cstate: %d pstate: %d nbpstate: %d sync: %d dispclk: %d\n"
+			"sclk: %d sclk_sleep: %d yclk: %d blackout_recovery_time_us: %d\n"
+			,
 			__func__,
 			context->bw.dce.nbp_state_change_wm_ns[0].b_mark,
 			context->bw.dce.nbp_state_change_wm_ns[0].a_mark,
 			context->bw.dce.urgent_wm_ns[0].b_mark,
 			context->bw.dce.urgent_wm_ns[0].a_mark,
 			context->bw.dce.stutter_exit_wm_ns[0].b_mark,
-			context->bw.dce.stutter_exit_wm_ns[0].a_mark);
-		dm_logger_append(&log_entry,
-			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
-			"stutMark_b: %d stutMark_a: %d\n",
+			context->bw.dce.stutter_exit_wm_ns[0].a_mark,
 			context->bw.dce.nbp_state_change_wm_ns[1].b_mark,
 			context->bw.dce.nbp_state_change_wm_ns[1].a_mark,
 			context->bw.dce.urgent_wm_ns[1].b_mark,
 			context->bw.dce.urgent_wm_ns[1].a_mark,
 			context->bw.dce.stutter_exit_wm_ns[1].b_mark,
-			context->bw.dce.stutter_exit_wm_ns[1].a_mark);
-		dm_logger_append(&log_entry,
-			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
-			"stutMark_b: %d stutMark_a: %d stutter_mode_enable: %d\n",
+			context->bw.dce.stutter_exit_wm_ns[1].a_mark,
 			context->bw.dce.nbp_state_change_wm_ns[2].b_mark,
 			context->bw.dce.nbp_state_change_wm_ns[2].a_mark,
 			context->bw.dce.urgent_wm_ns[2].b_mark,
 			context->bw.dce.urgent_wm_ns[2].a_mark,
 			context->bw.dce.stutter_exit_wm_ns[2].b_mark,
 			context->bw.dce.stutter_exit_wm_ns[2].a_mark,
-			context->bw.dce.stutter_mode_enable);
-		dm_logger_append(&log_entry,
-			"cstate: %d pstate: %d nbpstate: %d sync: %d dispclk: %d\n"
-			"sclk: %d sclk_sleep: %d yclk: %d blackout_recovery_time_us: %d\n",
+			context->bw.dce.stutter_mode_enable,
 			context->bw.dce.cpuc_state_change_enable,
 			context->bw.dce.cpup_state_change_enable,
 			context->bw.dce.nbp_state_change_enable,
@@ -840,7 +835,6 @@ static bool dce110_validate_bandwidth(
 			context->bw.dce.sclk_deep_sleep_khz,
 			context->bw.dce.yclk_khz,
 			context->bw.dce.blackout_recovery_time_us);
-		dm_logger_close(&log_entry);
 	}
 	return result;
 }
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +14 -20
index 9e1afb11e6ad..30d5b32892d6 100644
@@ -744,43 +744,38 @@ bool dce112_validate_bandwidth(
 
 	if (memcmp(&dc->current_state->bw.dce,
 			&context->bw.dce, sizeof(context->bw.dce))) {
-		struct log_entry log_entry;
-		dm_logger_open(
-			dc->ctx->logger,
-			&log_entry,
-			LOG_BANDWIDTH_CALCS);
-		dm_logger_append(&log_entry, "%s: finish,\n"
+
+		DC_LOG_BANDWIDTH_CALCS(
+			"%s: finish,\n"
+			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
+			"stutMark_b: %d stutMark_a: %d\n"
 			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
-			"stutMark_b: %d stutMark_a: %d\n",
+			"stutMark_b: %d stutMark_a: %d\n"
+			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
+			"stutMark_b: %d stutMark_a: %d stutter_mode_enable: %d\n"
+			"cstate: %d pstate: %d nbpstate: %d sync: %d dispclk: %d\n"
+			"sclk: %d sclk_sleep: %d yclk: %d blackout_recovery_time_us: %d\n"
+			,
 			__func__,
 			context->bw.dce.nbp_state_change_wm_ns[0].b_mark,
 			context->bw.dce.nbp_state_change_wm_ns[0].a_mark,
 			context->bw.dce.urgent_wm_ns[0].b_mark,
 			context->bw.dce.urgent_wm_ns[0].a_mark,
 			context->bw.dce.stutter_exit_wm_ns[0].b_mark,
-			context->bw.dce.stutter_exit_wm_ns[0].a_mark);
-		dm_logger_append(&log_entry,
-			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
-			"stutMark_b: %d stutMark_a: %d\n",
+			context->bw.dce.stutter_exit_wm_ns[0].a_mark,
 			context->bw.dce.nbp_state_change_wm_ns[1].b_mark,
 			context->bw.dce.nbp_state_change_wm_ns[1].a_mark,
 			context->bw.dce.urgent_wm_ns[1].b_mark,
 			context->bw.dce.urgent_wm_ns[1].a_mark,
 			context->bw.dce.stutter_exit_wm_ns[1].b_mark,
-			context->bw.dce.stutter_exit_wm_ns[1].a_mark);
-		dm_logger_append(&log_entry,
-			"nbpMark_b: %d nbpMark_a: %d urgentMark_b: %d urgentMark_a: %d\n"
-			"stutMark_b: %d stutMark_a: %d stutter_mode_enable: %d\n",
+			context->bw.dce.stutter_exit_wm_ns[1].a_mark,
 			context->bw.dce.nbp_state_change_wm_ns[2].b_mark,
 			context->bw.dce.nbp_state_change_wm_ns[2].a_mark,
 			context->bw.dce.urgent_wm_ns[2].b_mark,
 			context->bw.dce.urgent_wm_ns[2].a_mark,
 			context->bw.dce.stutter_exit_wm_ns[2].b_mark,
 			context->bw.dce.stutter_exit_wm_ns[2].a_mark,
-			context->bw.dce.stutter_mode_enable);
-		dm_logger_append(&log_entry,
-			"cstate: %d pstate: %d nbpstate: %d sync: %d dispclk: %d\n"
-			"sclk: %d sclk_sleep: %d yclk: %d blackout_recovery_time_us: %d\n",
+			context->bw.dce.stutter_mode_enable,
 			context->bw.dce.cpuc_state_change_enable,
 			context->bw.dce.cpup_state_change_enable,
 			context->bw.dce.nbp_state_change_enable,
@@ -790,7 +785,6 @@ bool dce112_validate_bandwidth(
 			context->bw.dce.sclk_deep_sleep_khz,
 			context->bw.dce.yclk_khz,
 			context->bw.dce.blackout_recovery_time_us);
-		dm_logger_close(&log_entry);
 	}
 	return result;
 }
drivers/gpu/drm/amd/display/include/logger_interface.h +46 -92

181 lines not on this page · raw message

drivers/gpu/drm/amd/display/include/logger_types.h +0 -59

63 lines not on this page · raw message

Signature · 6 lines
2.17.1

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

PATCH 22/54 drm/amd/display: read DP sink and DP branch hardware and firmware revision from DPCD

In reply to a message not in the archive

From: Alvin lee <[email protected]>

- define new dpcd address in drm
- implement new members in dpcd_caps to store values read from new dpcd address

---
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 25 +++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc.h           |  5 ++++
 .../gpu/drm/amd/display/include/dpcd_defs.h   |  3 +++
 3 files changed, 33 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +25 -0
index ba52768d4aac..c8d2593ada0f 100644
@@ -2262,6 +2262,11 @@ static void get_active_converter_info(
 
 		link->dpcd_caps.branch_hw_revision =
 			dp_hw_fw_revision.ieee_hw_rev;
+
+		memmove(
+			link->dpcd_caps.branch_fw_revision,
+			dp_hw_fw_revision.ieee_fw_rev,
+			sizeof(dp_hw_fw_revision.ieee_fw_rev));
 	}
 }
 
@@ -2317,6 +2322,7 @@ static bool retrieve_link_cap(struct dc_link *link)
 	enum dc_status status = DC_ERROR_UNEXPECTED;
 	uint32_t read_dpcd_retry_cnt = 3;
 	int i;
+	struct dp_sink_hw_fw_revision dp_hw_fw_revision;
 
 	memset(dpcd_data, '\0', sizeof(dpcd_data));
 	memset(&down_strm_port_count,
@@ -2411,6 +2417,25 @@ static bool retrieve_link_cap(struct dc_link *link)
 			(sink_id.ieee_oui[1] << 8) +
 			(sink_id.ieee_oui[2]);
 
+	memmove(
+		link->dpcd_caps.sink_dev_id_str,
+		sink_id.ieee_device_id,
+		sizeof(sink_id.ieee_device_id));
+
+	core_link_read_dpcd(
+		link,
+		DP_SINK_HW_REVISION_START,
+		(uint8_t *)&dp_hw_fw_revision,
+		sizeof(dp_hw_fw_revision));
+
+	link->dpcd_caps.sink_hw_revision =
+		dp_hw_fw_revision.ieee_hw_rev;
+
+	memmove(
+		link->dpcd_caps.sink_fw_revision,
+		dp_hw_fw_revision.ieee_fw_rev,
+		sizeof(dp_hw_fw_revision.ieee_fw_rev));
+
 	/* Connectivity log: detection */
 	CONN_DATA_DETECT(link, dpcd_data, sizeof(dpcd_data), "Rx Caps: ");
 
drivers/gpu/drm/amd/display/dc/dc.h +5 -0
index 85533619440a..1b36e763f3b0 100644
@@ -628,9 +628,14 @@ struct dpcd_caps {
 	struct dc_dongle_caps dongle_caps;
 
 	uint32_t sink_dev_id;
+	int8_t sink_dev_id_str[6];
+	int8_t sink_hw_revision;
+	int8_t sink_fw_revision[2];
+
 	uint32_t branch_dev_id;
 	int8_t branch_dev_name[6];
 	int8_t branch_hw_revision;
+	int8_t branch_fw_revision[2];
 
 	bool allow_invalid_MSA_timing_param;
 	bool panel_mode_edp;
drivers/gpu/drm/amd/display/include/dpcd_defs.h +3 -0
index d8e52e3b8e3c..1c66166d0a94 100644
@@ -27,6 +27,9 @@
 #define __DAL_DPCD_DEFS_H__
 
 #include <drm/drm_dp_helper.h>
+#ifndef DP_SINK_HW_REVISION_START // can remove this once the define gets into linux drm_dp_helper.h
+#define DP_SINK_HW_REVISION_START 0x409
+#endif
 
 enum dpcd_revision {
 	DPCD_REV_10 = 0x10,
Signature · 6 lines
2.17.1

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

PATCH 23/54 drm/amd/display: dcc always on for bw calculations on raven

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 .../gpu/drm/amd/display/dc/calcs/dcn_calcs.c  | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +18 -1
index e44b8d3d6891..080f777d705e 100644
@@ -250,7 +250,24 @@ static void pipe_ctx_to_e2e_pipe_params (
 	else if (pipe->bottom_pipe != NULL && pipe->bottom_pipe->plane_state == pipe->plane_state)
 		input->src.is_hsplit = true;
 
-	input->src.dcc                 = pipe->plane_state->dcc.enable;
+	if (pipe->plane_res.dpp->ctx->dc->debug.optimized_watermark) {
+		/*
+		 * this method requires us to always re-calculate watermark when dcc change
+		 * between flip.
+		 */
+		input->src.dcc = pipe->plane_state->dcc.enable ? 1 : 0;
+	} else {
+		/*
+		 * allow us to disable dcc on the fly without re-calculating WM
+		 *
+		 * extra overhead for DCC is quite small.  for 1080p WM without
+		 * DCC is only 0.417us lower (urgent goes from 6.979us to 6.562us)
+		 */
+		unsigned int bpe;
+
+		input->src.dcc = pipe->plane_res.dpp->ctx->dc->res_pool->hubbub->funcs->
+			dcc_support_pixel_format(pipe->plane_state->format, &bpe) ? 1 : 0;
+	}
 	input->src.dcc_rate            = 1;
 	input->src.meta_pitch          = pipe->plane_state->dcc.grph.meta_pitch;
 	input->src.source_scan         = dm_horz;
Signature · 6 lines
2.17.1

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

PATCH 24/54 drm/amd/display: hook dp test pattern through debugfs

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

set PHY layer or Link layer test pattern
PHY test pattern is used for PHY SI check.
Link layer test will not affect PHY SI.

- normal video mode
0 = DP_TEST_PATTERN_VIDEO_MODE

- PHY test pattern supported
1 = DP_TEST_PATTERN_D102
2 = DP_TEST_PATTERN_SYMBOL_ERROR
3 = DP_TEST_PATTERN_PRBS7
4 = DP_TEST_PATTERN_80BIT_CUSTOM
5 = DP_TEST_PATTERN_CP2520_1
6 = DP_TEST_PATTERN_CP2520_2 = DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE 7 = DP_TEST_PATTERN_CP2520_3

- DP PHY Link Training Patterns
8 = DP_TEST_PATTERN_TRAINING_PATTERN1
9 = DP_TEST_PATTERN_TRAINING_PATTERN2
0xa = DP_TEST_PATTERN_TRAINING_PATTERN3
0xb = DP_TEST_PATTERN_TRAINING_PATTERN4

- DP Link Layer Test pattern
0xc = DP_TEST_PATTERN_COLOR_SQUARES
0xd = DP_TEST_PATTERN_COLOR_SQUARES_CEA
0xe = DP_TEST_PATTERN_VERTICAL_BARS
0xf = DP_TEST_PATTERN_HORIZONTAL_BARS
0x10= DP_TEST_PATTERN_COLOR_RAMP

debugfs phy_test_pattern is located at /syskernel/debug/dri/0/DP-x

--- set test pattern
echo <test pattern #> > test_pattern

- custom test pattern
If test pattern # is not supported, NO HW programming will be done for DP_TEST_PATTERN_80BIT_CUSTOM, it needs extra 10 bytes of data for the user pattern. input 10 bytes data are separated by space

echo 0x4 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99 0xaa > test_pattern

--- reset test pattern
echo 0 > test_pattern

--- HPD detection is disabled when set PHY test pattern

when PHY test pattern (pattern # within [1,7]) is set, HPD pin of HW ASIC is disable. User could unplug DP display from DP connected and plug scope to check test pattern PHY SI.
If there is need unplug scope and plug DP display back, do steps below:
echo 0 > phy_test_pattern
unplug scope
plug DP display.

"echo 0 > phy_test_pattern" will re-enable HPD pin again so that video sw driver could detect "unplug scope" and "plug DP display"

---
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 222 +++++++++++++++++-
 1 file changed, 211 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +211 -11
index 9ff8833b52c4..8ddbf219dd23 100644
@@ -261,18 +261,219 @@ static ssize_t dp_pre_emphasis_debugfs_write(struct file *f, const char __user *
 	return 1;
 }
 
-static ssize_t dp_phy_test_pattern_debugfs_read(struct file *f, char __user *buf,
-				 size_t size, loff_t *pos)
-{
-	/* TODO: create method to read PHY test pattern */
-	return 1;
-}
-
+/* function description
+ *
+ * set PHY layer or Link layer test pattern
+ * PHY test pattern is used for PHY SI check.
+ * Link layer test will not affect PHY SI.
+ *
+ * Reset Test Pattern:
+ * 0 = DP_TEST_PATTERN_VIDEO_MODE
+ *
+ * PHY test pattern supported:
+ * 1 = DP_TEST_PATTERN_D102
+ * 2 = DP_TEST_PATTERN_SYMBOL_ERROR
+ * 3 = DP_TEST_PATTERN_PRBS7
+ * 4 = DP_TEST_PATTERN_80BIT_CUSTOM
+ * 5 = DP_TEST_PATTERN_CP2520_1
+ * 6 = DP_TEST_PATTERN_CP2520_2 = DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE
+ * 7 = DP_TEST_PATTERN_CP2520_3
+ *
+ * DP PHY Link Training Patterns
+ * 8 = DP_TEST_PATTERN_TRAINING_PATTERN1
+ * 9 = DP_TEST_PATTERN_TRAINING_PATTERN2
+ * a = DP_TEST_PATTERN_TRAINING_PATTERN3
+ * b = DP_TEST_PATTERN_TRAINING_PATTERN4
+ *
+ * DP Link Layer Test pattern
+ * c = DP_TEST_PATTERN_COLOR_SQUARES
+ * d = DP_TEST_PATTERN_COLOR_SQUARES_CEA
+ * e = DP_TEST_PATTERN_VERTICAL_BARS
+ * f = DP_TEST_PATTERN_HORIZONTAL_BARS
+ * 10= DP_TEST_PATTERN_COLOR_RAMP
+ *
+ * debugfs phy_test_pattern is located at /syskernel/debug/dri/0/DP-x
+ *
+ * --- set test pattern
+ * echo <test pattern #> > test_pattern
+ *
+ * If test pattern # is not supported, NO HW programming will be done.
+ * for DP_TEST_PATTERN_80BIT_CUSTOM, it needs extra 10 bytes of data
+ * for the user pattern. input 10 bytes data are separated by space
+ *
+ * echo 0x4 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99 0xaa > test_pattern
+ *
+ * --- reset test pattern
+ * echo 0 > test_pattern
+ *
+ * --- HPD detection is disabled when set PHY test pattern
+ *
+ * when PHY test pattern (pattern # within [1,7]) is set, HPD pin of HW ASIC
+ * is disable. User could unplug DP display from DP connected and plug scope to
+ * check test pattern PHY SI.
+ * If there is need unplug scope and plug DP display back, do steps below:
+ * echo 0 > phy_test_pattern
+ * unplug scope
+ * plug DP display.
+ *
+ * "echo 0 > phy_test_pattern" will re-enable HPD pin again so that video sw
+ * driver could detect "unplug scope" and "plug DP display"
+ */
 static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __user *buf,
 				 size_t size, loff_t *pos)
 {
-	/* TODO: create method to write PHY test pattern */
-	return 1;
+	struct amdgpu_dm_connector *connector = file_inode(f)->i_private;
+	struct dc_link *link = connector->dc_link;
+	char *wr_buf = NULL;
+	char *wr_buf_ptr = NULL;
+	uint32_t wr_buf_size = 100;
+	int r;
+	int bytes_from_user;
+	char *sub_str;
+	uint8_t param_index = 0;
+	long param[11];
+	const char delimiter[3] = {' ', '\n', '\0'};
+	enum dp_test_pattern test_pattern = DP_TEST_PATTERN_UNSUPPORTED;
+	bool disable_hpd = false;
+	bool valid_test_pattern = false;
+	uint8_t custom_pattern[10] = {0};
+	struct dc_link_settings prefer_link_settings = {LANE_COUNT_UNKNOWN,
+			LINK_RATE_UNKNOWN, LINK_SPREAD_DISABLED};
+	struct dc_link_settings cur_link_settings = {LANE_COUNT_UNKNOWN,
+			LINK_RATE_UNKNOWN, LINK_SPREAD_DISABLED};
+	struct link_training_settings link_training_settings;
+	int i;
+
+	if (size == 0)
+		return 0;
+
+	wr_buf = kcalloc(wr_buf_size, sizeof(char), GFP_KERNEL);
+	if (!wr_buf)
+		return 0;
+	wr_buf_ptr = wr_buf;
+
+	r = copy_from_user(wr_buf_ptr, buf, wr_buf_size);
+
+	/* r is bytes not be copied */
+	if (r >= wr_buf_size) {
+		kfree(wr_buf);
+		DRM_DEBUG_DRIVER("user data not be read\n");
+		return 0;
+	}
+
+	bytes_from_user = wr_buf_size - r;
+
+	while (isspace(*wr_buf_ptr))
+		wr_buf_ptr++;
+
+	while ((*wr_buf_ptr != '\0') && (param_index < 1)) {
+		sub_str = strsep(&wr_buf_ptr, delimiter);
+		r = kstrtol(sub_str, 16, &param[param_index]);
+
+		if (r)
+			DRM_DEBUG_DRIVER("string to int convert error code: %d\n", r);
+
+		param_index++;
+		while (isspace(*wr_buf_ptr))
+			wr_buf_ptr++;
+
+		/* DP_TEST_PATTERN_80BIT_CUSTOM need extra 80 bits
+		 * whci are 10 bytes separte by space
+		 */
+		if (param[0] != 0x4)
+			break;
+	}
+
+	test_pattern = param[0];
+
+	switch (test_pattern) {
+	case DP_TEST_PATTERN_VIDEO_MODE:
+	case DP_TEST_PATTERN_COLOR_SQUARES:
+	case DP_TEST_PATTERN_COLOR_SQUARES_CEA:
+	case DP_TEST_PATTERN_VERTICAL_BARS:
+	case DP_TEST_PATTERN_HORIZONTAL_BARS:
+	case DP_TEST_PATTERN_COLOR_RAMP:
+		valid_test_pattern = true;
+		break;
+
+	case DP_TEST_PATTERN_D102:
+	case DP_TEST_PATTERN_SYMBOL_ERROR:
+	case DP_TEST_PATTERN_PRBS7:
+	case DP_TEST_PATTERN_80BIT_CUSTOM:
+	case DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE:
+	case DP_TEST_PATTERN_TRAINING_PATTERN4:
+		disable_hpd = true;
+		valid_test_pattern = true;
+		break;
+
+	default:
+		valid_test_pattern = false;
+		test_pattern = DP_TEST_PATTERN_UNSUPPORTED;
+		break;
+	}
+
+	if (!valid_test_pattern) {
+		kfree(wr_buf);
+		DRM_DEBUG_DRIVER("Invalid Test Pattern Parameters\n");
+		return bytes_from_user;
+	}
+
+	if (test_pattern == DP_TEST_PATTERN_80BIT_CUSTOM) {
+		for (i = 0; i < 10; i++)
+			custom_pattern[i] = (uint8_t) param[i + 1];
+	}
+
+	/* Usage: set DP physical test pattern using debugfs with normal DP
+	 * panel. Then plug out DP panel and connect a scope to measure
+	 * For normal video mode and test pattern generated from CRCT,
+	 * they are visibile to user. So do not disable HPD.
+	 * Video Mode is also set to clear the test pattern, so enable HPD
+	 * because it might have been disabled after a test pattern was set.
+	 * AUX depends on HPD * sequence dependent, do not move!
+	 */
+	if (!disable_hpd)
+		dc_link_enable_hpd(link);
+
+	prefer_link_settings.lane_count = link->verified_link_cap.lane_count;
+	prefer_link_settings.link_rate = link->verified_link_cap.link_rate;
+	prefer_link_settings.link_spread = link->verified_link_cap.link_spread;
+
+	cur_link_settings.lane_count = link->cur_link_settings.lane_count;
+	cur_link_settings.link_rate = link->cur_link_settings.link_rate;
+	cur_link_settings.link_spread = link->cur_link_settings.link_spread;
+
+	link_training_settings.link_settings = cur_link_settings;
+
+
+	if (test_pattern != DP_TEST_PATTERN_VIDEO_MODE) {
+		if (prefer_link_settings.lane_count != LANE_COUNT_UNKNOWN &&
+			prefer_link_settings.link_rate !=  LINK_RATE_UNKNOWN &&
+			(prefer_link_settings.lane_count != cur_link_settings.lane_count ||
+			prefer_link_settings.link_rate != cur_link_settings.link_rate))
+			link_training_settings.link_settings = prefer_link_settings;
+	}
+
+	for (i = 0; i < (unsigned int)(link_training_settings.link_settings.lane_count); i++)
+		link_training_settings.lane_settings[i] = link->cur_lane_setting;
+
+	dc_link_set_test_pattern(
+		link,
+		test_pattern,
+		&link_training_settings,
+		custom_pattern,
+		10);
+
+	/* Usage: Set DP physical test pattern using AMDDP with normal DP panel
+	 * Then plug out DP panel and connect a scope to measure DP PHY signal.
+	 * Need disable interrupt to avoid SW driver disable DP output. This is
+	 * done after the test pattern is set.
+	 */
+	if (valid_test_pattern && disable_hpd)
+		dc_link_disable_hpd(link);
+
+	kfree(wr_buf);
+
+	return bytes_from_user;
 }
 
 static const struct file_operations dp_link_settings_debugfs_fops = {
@@ -298,7 +499,6 @@ static const struct file_operations dp_pre_emphasis_fops = {
 
 static const struct file_operations dp_phy_test_pattern_fops = {
 	.owner = THIS_MODULE,
-	.read = dp_phy_test_pattern_debugfs_read,
 	.write = dp_phy_test_pattern_debugfs_write,
 	.llseek = default_llseek
 };
@@ -310,7 +510,7 @@ static const struct {
 		{"link_settings", &dp_link_settings_debugfs_fops},
 		{"voltage_swing", &dp_voltage_swing_fops},
 		{"pre_emphasis", &dp_pre_emphasis_fops},
-		{"phy_test_pattern", &dp_phy_test_pattern_fops}
+		{"test_pattern", &dp_phy_test_pattern_fops}
 };
 
 int connector_debugfs_init(struct amdgpu_dm_connector *connector)
Signature · 6 lines
2.17.1

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

PATCH 25/54 drm/amd/display: remove dentist_vco_freq from resource_pool

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/inc/core_types.h +0 -1
index 00d728e629fa..1db26bc0bec3 100644
@@ -148,7 +148,6 @@ struct resource_pool {
 	unsigned int underlay_pipe_index;
 	unsigned int stream_enc_count;
 	unsigned int ref_clock_inKhz;
-	unsigned int dentist_vco_freq_khz;
 	unsigned int timing_generator_count;
 
 	/*
Signature · 6 lines
2.17.1

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

PATCH 26/54 drm/amd/display: drop unused register defines

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h +2 -6
index 7ce0a54e548f..8a6b2d328467 100644
@@ -44,18 +44,14 @@
 	CLK_SF(DENTIST_DISPCLK_CNTL, DENTIST_DPREFCLK_WDIVIDER, mask_sh)
 
 #define CLK_COMMON_MASK_SH_LIST_DCN_COMMON_BASE(mask_sh) \
-	CLK_SF(DENTIST_DISPCLK_CNTL, DENTIST_DPPCLK_WDIVIDER, mask_sh),\
 	CLK_SF(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_WDIVIDER, mask_sh),\
-	CLK_SF(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_CHG_DONE, mask_sh),\
-	CLK_SF(DENTIST_DISPCLK_CNTL, DENTIST_DPPCLK_CHG_DONE, mask_sh)
+	CLK_SF(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_CHG_DONE, mask_sh)
 
 #define CLK_REG_FIELD_LIST(type) \
 	type DPREFCLK_SRC_SEL; \
 	type DENTIST_DPREFCLK_WDIVIDER; \
 	type DENTIST_DISPCLK_WDIVIDER; \
-	type DENTIST_DPPCLK_WDIVIDER; \
-	type DENTIST_DISPCLK_CHG_DONE; \
-	type DENTIST_DPPCLK_CHG_DONE;
+	type DENTIST_DISPCLK_CHG_DONE;
 
 struct dccg_shift {
 	CLK_REG_FIELD_LIST(uint8_t)
Signature · 6 lines
2.17.1

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

PATCH 27/54 drm/amd/display: add additional info for cursor position programming

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h               | 5 +++--
 .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c    | 7 ++++---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c           | 4 ++--
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c          | 4 ++--
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  | 7 ++++---
 5 files changed, 15 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +3 -2
index 7117f9f95b27..afda2d442156 100644
@@ -404,9 +404,10 @@ struct dc_cursor_position {
 struct dc_cursor_mi_param {
 	unsigned int pixel_clk_khz;
 	unsigned int ref_clk_khz;
-	unsigned int viewport_x_start;
-	unsigned int viewport_width;
+	struct rect viewport;
 	struct fixed31_32 h_scale_ratio;
+	struct fixed31_32 v_scale_ratio;
+	enum dc_rotation_angle rotation;
 };
 
 /* IPP related types */
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -3
index e2098f3e5b45..8fa090c2abc2 100644
@@ -2783,9 +2783,10 @@ void dce110_set_cursor_position(struct pipe_ctx *pipe_ctx)
 	struct dc_cursor_mi_param param = {
 		.pixel_clk_khz = pipe_ctx->stream->timing.pix_clk_khz,
 		.ref_clk_khz = pipe_ctx->stream->ctx->dc->res_pool->ref_clock_inKhz,
-		.viewport_x_start = pipe_ctx->plane_res.scl_data.viewport.x,
-		.viewport_width = pipe_ctx->plane_res.scl_data.viewport.width,
-		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz
+		.viewport = pipe_ctx->plane_res.scl_data.viewport,
+		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
+		.v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
+		.rotation = pipe_ctx->plane_state->rotation
 	};
 
 	if (pipe_ctx->plane_state->address.type
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +2 -2
index 742fd497ed00..a558efa9b34a 100644
@@ -445,10 +445,10 @@ void dpp1_set_cursor_position(
 		uint32_t width)
 {
 	struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
-	int src_x_offset = pos->x - pos->x_hotspot - param->viewport_x_start;
+	int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x;
 	uint32_t cur_en = pos->enable ? 1 : 0;
 
-	if (src_x_offset >= (int)param->viewport_width)
+	if (src_x_offset >= (int)param->viewport.width)
 		cur_en = 0;  /* not visible beyond right edge*/
 
 	if (src_x_offset + (int)width <= 0)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +2 -2
index 60e4fb8da9db..5b5ece0e84ce 100644
@@ -1097,7 +1097,7 @@ void hubp1_cursor_set_position(
 		const struct dc_cursor_mi_param *param)
 {
 	struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
-	int src_x_offset = pos->x - pos->x_hotspot - param->viewport_x_start;
+	int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x;
 	uint32_t cur_en = pos->enable ? 1 : 0;
 	uint32_t dst_x_offset = (src_x_offset >= 0) ? src_x_offset : 0;
 
@@ -1121,7 +1121,7 @@ void hubp1_cursor_set_position(
 				dc_fixpt_from_int(dst_x_offset),
 				param->h_scale_ratio));
 
-	if (src_x_offset >= (int)param->viewport_width)
+	if (src_x_offset >= (int)param->viewport.width)
 		cur_en = 0;  /* not visible beyond right edge*/
 
 	if (src_x_offset + (int)hubp->curs_attr.width <= 0)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +4 -3
index 12cb82806b4b..80cb7fd1a97f 100644
@@ -2543,9 +2543,10 @@ static void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
 	struct dc_cursor_mi_param param = {
 		.pixel_clk_khz = pipe_ctx->stream->timing.pix_clk_khz,
 		.ref_clk_khz = pipe_ctx->stream->ctx->dc->res_pool->ref_clock_inKhz,
-		.viewport_x_start = pipe_ctx->plane_res.scl_data.viewport.x,
-		.viewport_width = pipe_ctx->plane_res.scl_data.viewport.width,
-		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz
+		.viewport = pipe_ctx->plane_res.scl_data.viewport,
+		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
+		.v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
+		.rotation = pipe_ctx->plane_state->rotation
 	};
 
 	if (pipe_ctx->plane_state->address.type
Signature · 6 lines
2.17.1

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

PATCH 28/54 drm/amd/display: Patch for extend time to panel poweron.

In reply to a message not in the archive

From: Hugo Hu <[email protected]>

[WHY]
In eDP spec, the min duration in LCDVDD on-off-on sequence should be 500ms, some BOE panels need 700ms to pass.
[HOW]
Add patch to wait more time when eDP power on.

---
 drivers/gpu/drm/amd/display/dc/dc_types.h                | 1 +
 .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c  | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
index 59bf0d5f58e8..58a6ef80a60e 100644
@@ -192,6 +192,7 @@ union display_content_support {
 
 struct dc_panel_patch {
 	unsigned int dppowerup_delay;
+	unsigned int extra_t12_ms;
 };
 
 struct dc_edid_caps {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 -3
index 8fa090c2abc2..e25f3d00f861 100644
@@ -871,10 +871,13 @@ void hwss_edp_power_control(
 			unsigned long long wait_time_ms = 0;
 
 			/* max 500ms from LCDVDD off to on */
+			unsigned long long edp_poweroff_time_ms =
+					500 + link->local_sink->edid_caps.panel_patch.extra_t12_ms;
+
 			if (link->link_trace.time_stamp.edp_poweroff == 0)
-				wait_time_ms = 500;
-			else if (duration_in_ms < 500)
-				wait_time_ms = 500 - duration_in_ms;
+				wait_time_ms = edp_poweroff_time_ms;
+			else if (duration_in_ms < edp_poweroff_time_ms)
+				wait_time_ms = edp_poweroff_time_ms - duration_in_ms;
 
 			if (wait_time_ms) {
 				msleep(wait_time_ms);
Signature · 6 lines
2.17.1

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

PATCH 29/54 drm/amd/display: Linux set/read lane settings through debugfs

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

function: get current DP PHY settings: voltage swing, pre-emphasis, post-cursor2 (defined by VESA DP specification)

valid values: voltage swing: 0,1,2,3 pre-emphasis : 0,1,2,3 post cursor2 : 0,1,2,3

debugfs file phy_setings is located at /sys/kernel/debug/dri/0/DP-x

there will be directories, like DP-1, DP-2,DP-3, etc. for DP display

--- to figure out which DP-x is the display for DP to be check, cd DP-x
ls -ll
There should be debugfs file, like link_settings, phy_settings. cat link_settings
from lane_count, link_rate to figure which DP-x is for display to be worked on

--- to get current DP PHY settings,
cat phy_settings

--- to change DP PHY settings,
echo <voltage_swing> <pre-emphasis> <post_cursor2> > phy_settings

for examle, to change voltage swing to 2, pre-emphasis to 3, post_cursor2 to 0,
echo 2 3 0 > phy_settings

--- to check if change be applied, get current phy settings by cat phy_settings

--- in case invalid values are set by user, like echo 1 4 0 > phy_settings

HW will NOT be programmed by these settings.

cat phy_settings will show the previous valid settings.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 266 ++++++++++++++----
 1 file changed, 207 insertions(+), 59 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +207 -59
index 8ddbf219dd23..f20ba9d1c9e2 100644
@@ -26,7 +26,6 @@
 #include <linux/debugfs.h>
 
 #include "dc.h"
-
 #include "amdgpu.h"
 #include "amdgpu_dm.h"
 #include "amdgpu_dm_debugfs.h"
@@ -46,7 +45,7 @@
  *
  * --- to get dp configuration
  *
- * xxd -l 300 phy_settings
+ * cat link_settings
  *
  * It will list current, verified, reported, preferred dp configuration.
  * current -- for current video mode
@@ -56,7 +55,7 @@
  *
  * --- set (or force) dp configuration
  *
- * echo <lane_count>  <link_rate>
+ * echo <lane_count>  <link_rate> > link_settings
  *
  * for example, to force to  2 lane, 2.7GHz,
  * echo 4 0xa > link_settings
@@ -67,7 +66,7 @@
  * done. please check link settings after force operation to see if HW get
  * programming.
  *
- * xxd -l 300 link_settings
+ * cat link_settings
  *
  * check current and preferred settings.
  *
@@ -79,13 +78,13 @@ static ssize_t dp_link_settings_read(struct file *f, char __user *buf,
 	struct dc_link *link = connector->dc_link;
 	char *rd_buf = NULL;
 	char *rd_buf_ptr = NULL;
-	uint32_t rd_buf_size = 320;
-	int bytes_to_user;
+	const uint32_t rd_buf_size = 100;
+	uint32_t result = 0;
 	uint8_t str_len = 0;
 	int r;
 
-	if (size == 0)
-		return 0;
+	if (*pos & 3 || size & 3)
+		return -EINVAL;
 
 	rd_buf = kcalloc(rd_buf_size, sizeof(char), GFP_KERNEL);
 	if (!rd_buf)
@@ -98,39 +97,44 @@ static ssize_t dp_link_settings_read(struct file *f, char __user *buf,
 			link->cur_link_settings.lane_count,
 			link->cur_link_settings.link_rate,
 			link->cur_link_settings.link_spread);
-	rd_buf_ptr = rd_buf_ptr + str_len;
+	rd_buf_ptr += str_len;
 
 	str_len = strlen("Verified:  %d  %d  %d  ");
 	snprintf(rd_buf_ptr, str_len, "Verified:  %d  %d  %d  ",
 			link->verified_link_cap.lane_count,
 			link->verified_link_cap.link_rate,
 			link->verified_link_cap.link_spread);
-	rd_buf_ptr = rd_buf_ptr + str_len;
+	rd_buf_ptr += str_len;
 
 	str_len = strlen("Reported:  %d  %d  %d  ");
 	snprintf(rd_buf_ptr, str_len, "Reported:  %d  %d  %d  ",
 			link->reported_link_cap.lane_count,
 			link->reported_link_cap.link_rate,
 			link->reported_link_cap.link_spread);
-	rd_buf_ptr = rd_buf_ptr + str_len;
+	rd_buf_ptr += str_len;
 
 	str_len = strlen("Preferred:  %d  %d  %d  ");
-	snprintf(rd_buf_ptr, str_len, "Preferred:  %d  %d  %d  ",
+	snprintf(rd_buf_ptr, str_len, "Preferred:  %d  %d  %d\n",
 			link->preferred_link_setting.lane_count,
 			link->preferred_link_setting.link_rate,
 			link->preferred_link_setting.link_spread);
 
-	r = copy_to_user(buf, rd_buf, rd_buf_size);
+	while (size) {
+		if (*pos >= rd_buf_size)
+			break;
 
-	bytes_to_user = rd_buf_size - r;
+		r = put_user(*(rd_buf + result), buf);
+		if (r)
+			return r; /* r = -EFAULT */
 
-	if (r > rd_buf_size) {
-		bytes_to_user = 0;
-		DRM_DEBUG_DRIVER("data not copy to user");
+		buf += 1;
+		size -= 1;
+		*pos += 1;
+		result += 1;
 	}
 
 	kfree(rd_buf);
-	return bytes_to_user;
+	return result;
 }
 
 static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
@@ -142,7 +146,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 	struct dc_link_settings prefer_link_settings;
 	char *wr_buf = NULL;
 	char *wr_buf_ptr = NULL;
-	uint32_t wr_buf_size = 40;
+	const uint32_t wr_buf_size = 40;
 	int r;
 	int bytes_from_user;
 	char *sub_str;
@@ -153,11 +157,11 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 	bool valid_input = false;
 
 	if (size == 0)
-		return 0;
+		return -EINVAL;
 
 	wr_buf = kcalloc(wr_buf_size, sizeof(char), GFP_KERNEL);
 	if (!wr_buf)
-		return 0;
+		return -EINVAL;
 	wr_buf_ptr = wr_buf;
 
 	r = copy_from_user(wr_buf_ptr, buf, wr_buf_size);
@@ -166,7 +170,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 	if (r >= wr_buf_size) {
 		kfree(wr_buf);
 		DRM_DEBUG_DRIVER("user data not read\n");
-		return 0;
+		return -EINVAL;
 	}
 
 	bytes_from_user = wr_buf_size - r;
@@ -181,16 +185,13 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 		r = kstrtol(sub_str, 16, &param[param_index]);
 
 		if (r)
-			DRM_DEBUG_DRIVER(" -EINVAL convert error happens!\n");
+			DRM_DEBUG_DRIVER("string to int convert error code: %d\n", r);
 
 		param_index++;
 		while (isspace(*wr_buf_ptr))
 			wr_buf_ptr++;
 	}
 
-	DRM_DEBUG_DRIVER("Lane_count:  %lx\n", param[0]);
-	DRM_DEBUG_DRIVER("link_rate:  %lx\n", param[1]);
-
 	switch (param[0]) {
 	case LANE_COUNT_ONE:
 	case LANE_COUNT_TWO:
@@ -213,9 +214,10 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 		break;
 	}
 
-	if (!valid_input) {
+	if (!valid_input || (param[0] > link->reported_link_cap.lane_count) ||
+			(param[1] > link->reported_link_cap.link_rate)) {
 		kfree(wr_buf);
-		DRM_DEBUG_DRIVER("Invalid Input value  exceed  No HW will be programmed\n");
+		DRM_DEBUG_DRIVER("Invalid Input value No HW will be programmed\n");
 		return bytes_from_user;
 	}
 
@@ -229,36 +231,190 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 	dc_link_set_preferred_link_settings(dc, &prefer_link_settings, link);
 
 	kfree(wr_buf);
-
 	return bytes_from_user;
 }
 
-static ssize_t dp_voltage_swing_debugfs_read(struct file *f, char __user *buf,
+/* function: get current DP PHY settings: voltage swing, pre-emphasis,
+ * post-cursor2 (defined by VESA DP specification)
+ *
+ * valid values
+ * voltage swing: 0,1,2,3
+ * pre-emphasis : 0,1,2,3
+ * post cursor2 : 0,1,2,3
+ *
+ *
+ * how to use this debugfs
+ *
+ * debugfs is located at /sys/kernel/debug/dri/0/DP-x
+ *
+ * there will be directories, like DP-1, DP-2,DP-3, etc. for DP display
+ *
+ * To figure out which DP-x is the display for DP to be check,
+ * cd DP-x
+ * ls -ll
+ * There should be debugfs file, like link_settings, phy_settings.
+ * cat link_settings
+ * from lane_count, link_rate to figure which DP-x is for display to be worked
+ * on
+ *
+ * To get current DP PHY settings,
+ * cat phy_settings
+ *
+ * To change DP PHY settings,
+ * echo <voltage_swing> <pre-emphasis> <post_cursor2> > phy_settings
+ * for examle, to change voltage swing to 2, pre-emphasis to 3, post_cursor2 to
+ * 0,
+ * echo 2 3 0 > phy_settings
+ *
+ * To check if change be applied, get current phy settings by
+ * cat phy_settings
+ *
+ * In case invalid values are set by user, like
+ * echo 1 4 0 > phy_settings
+ *
+ * HW will NOT be programmed by these settings.
+ * cat phy_settings will show the previous valid settings.
+ */
+static ssize_t dp_phy_settings_read(struct file *f, char __user *buf,
 				 size_t size, loff_t *pos)
 {
-	/* TODO: create method to read voltage swing */
-	return 1;
-}
+	struct amdgpu_dm_connector *connector = file_inode(f)->i_private;
+	struct dc_link *link = connector->dc_link;
+	char *rd_buf = NULL;
+	const uint32_t rd_buf_size = 20;
+	uint32_t result = 0;
+	int r;
 
-static ssize_t dp_voltage_swing_debugfs_write(struct file *f, const char __user *buf,
-				 size_t size, loff_t *pos)
-{
-	/* TODO: create method to write voltage swing */
-	return 1;
-}
+	if (*pos & 3 || size & 3)
+		return -EINVAL;
 
-static ssize_t dp_pre_emphasis_debugfs_read(struct file *f, char __user *buf,
-				 size_t size, loff_t *pos)
-{
-	/* TODO: create method to read pre-emphasis */
-	return 1;
+	rd_buf = kcalloc(rd_buf_size, sizeof(char), GFP_KERNEL);
+	if (!rd_buf)
+		return -EINVAL;
+
+	snprintf(rd_buf, rd_buf_size, "  %d  %d  %d  ",
+			link->cur_lane_setting.VOLTAGE_SWING,
+			link->cur_lane_setting.PRE_EMPHASIS,
+			link->cur_lane_setting.POST_CURSOR2);
+
+	while (size) {
+		if (*pos >= rd_buf_size)
+			break;
+
+		r = put_user((*(rd_buf + result)), buf);
+		if (r)
+			return r; /* r = -EFAULT */
+
+		buf += 1;
+		size -= 1;
+		*pos += 1;
+		result += 1;
+	}
+
+	kfree(rd_buf);
+	return result;
 }
 
-static ssize_t dp_pre_emphasis_debugfs_write(struct file *f, const char __user *buf,
+static ssize_t dp_phy_settings_write(struct file *f, const char __user *buf,
 				 size_t size, loff_t *pos)
 {
-	/* TODO: create method to write pre-emphasis */
-	return 1;
+	struct amdgpu_dm_connector *connector = file_inode(f)->i_private;
+	struct dc_link *link = connector->dc_link;
+	struct dc *dc = (struct dc *)link->dc;
+	char *wr_buf = NULL;
+	char *wr_buf_ptr = NULL;
+	uint32_t wr_buf_size = 40;
+	int r;
+	int bytes_from_user;
+	char *sub_str;
+	uint8_t param_index = 0;
+	long param[3];
+	const char delimiter[3] = {' ', '\n', '\0'};
+	bool use_prefer_link_setting;
+	struct link_training_settings link_lane_settings;
+
+	if (size == 0)
+		return 0;
+
+	wr_buf = kcalloc(wr_buf_size, sizeof(char), GFP_KERNEL);
+	if (!wr_buf)
+		return 0;
+	wr_buf_ptr = wr_buf;
+
+	r = copy_from_user(wr_buf_ptr, buf, wr_buf_size);
+
+	/* r is bytes not be copied */
+	if (r >= wr_buf_size) {
+		kfree(wr_buf);
+		DRM_DEBUG_DRIVER("user data not be read\n");
+		return 0;
+	}
+
+	bytes_from_user = wr_buf_size - r;
+
+	while (isspace(*wr_buf_ptr))
+		wr_buf_ptr++;
+
+	while ((*wr_buf_ptr != '\0') && (param_index < 3)) {
+
+		sub_str = strsep(&wr_buf_ptr, delimiter);
+
+		r = kstrtol(sub_str, 16, &param[param_index]);
+
+		if (r)
+			DRM_DEBUG_DRIVER("string to int convert error code: %d\n", r);
+
+		param_index++;
+		while (isspace(*wr_buf_ptr))
+			wr_buf_ptr++;
+	}
+
+	if ((param[0] > VOLTAGE_SWING_MAX_LEVEL) ||
+			(param[1] > PRE_EMPHASIS_MAX_LEVEL) ||
+			(param[2] > POST_CURSOR2_MAX_LEVEL)) {
+		kfree(wr_buf);
+		DRM_DEBUG_DRIVER("Invalid Input No HW will be programmed\n");
+		return bytes_from_user;
+	}
+
+	/* get link settings: lane count, link rate */
+	use_prefer_link_setting =
+		((link->preferred_link_setting.link_rate != LINK_RATE_UNKNOWN) &&
+		(link->test_pattern_enabled));
+
+	memset(&link_lane_settings, 0, sizeof(link_lane_settings));
+
+	if (use_prefer_link_setting) {
+		link_lane_settings.link_settings.lane_count =
+				link->preferred_link_setting.lane_count;
+		link_lane_settings.link_settings.link_rate =
+				link->preferred_link_setting.link_rate;
+		link_lane_settings.link_settings.link_spread =
+				link->preferred_link_setting.link_spread;
+	} else {
+		link_lane_settings.link_settings.lane_count =
+				link->cur_link_settings.lane_count;
+		link_lane_settings.link_settings.link_rate =
+				link->cur_link_settings.link_rate;
+		link_lane_settings.link_settings.link_spread =
+				link->cur_link_settings.link_spread;
+	}
+
+	/* apply phy settings from user */
+	for (r = 0; r < link_lane_settings.link_settings.lane_count; r++) {
+		link_lane_settings.lane_settings[r].VOLTAGE_SWING =
+				(enum dc_voltage_swing) (param[0]);
+		link_lane_settings.lane_settings[r].PRE_EMPHASIS =
+				(enum dc_pre_emphasis) (param[1]);
+		link_lane_settings.lane_settings[r].POST_CURSOR2 =
+				(enum dc_post_cursor2) (param[2]);
+	}
+
+	/* program ASIC registers and DPCD registers */
+	dc_link_set_drive_settings(dc, &link_lane_settings, link);
+
+	kfree(wr_buf);
+	return bytes_from_user;
 }
 
 /* function description
@@ -483,17 +639,10 @@ static const struct file_operations dp_link_settings_debugfs_fops = {
 	.llseek = default_llseek
 };
 
-static const struct file_operations dp_voltage_swing_fops = {
-	.owner = THIS_MODULE,
-	.read = dp_voltage_swing_debugfs_read,
-	.write = dp_voltage_swing_debugfs_write,
-	.llseek = default_llseek
-};
-
-static const struct file_operations dp_pre_emphasis_fops = {
+static const struct file_operations dp_phy_settings_debugfs_fop = {
 	.owner = THIS_MODULE,
-	.read = dp_pre_emphasis_debugfs_read,
-	.write = dp_pre_emphasis_debugfs_write,
+	.read = dp_phy_settings_read,
+	.write = dp_phy_settings_write,
 	.llseek = default_llseek
 };
 
@@ -508,8 +657,7 @@ static const struct {
 	const struct file_operations *fops;
 } dp_debugfs_entries[] = {
 		{"link_settings", &dp_link_settings_debugfs_fops},
-		{"voltage_swing", &dp_voltage_swing_fops},
-		{"pre_emphasis", &dp_pre_emphasis_fops},
+		{"phy_settings", &dp_phy_settings_debugfs_fop},
 		{"test_pattern", &dp_phy_test_pattern_fops}
 };
 
Signature · 6 lines
2.17.1

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

PATCH 30/54 drm/amd/display: Fix compile error on older GCC versions

In reply to a message not in the archive

From: "Leo (Sunpeng) Li" <[email protected]>

GCC 4.9 reports a 'missing braces around initializer' error. This is a bug, documented here:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

Fix it by adding another brace.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +2 -2
index 7b51b8fde3fe..59b113d11f66 100644
@@ -514,8 +514,8 @@ enum dc_edid_status dm_helpers_read_local_edid(
 				edid_status,
 				aconnector->base.name);
 	if (link->aux_mode) {
-		union test_request test_request = {0};
-		union test_response test_response = {0};
+		union test_request test_request = { {0} };
+		union test_response test_response = { {0} };
 
 		dm_helpers_dp_read_dpcd(ctx,
 					link,
Signature · 6 lines
2.17.1

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

PATCH 31/54 drm/amd/display: add missing mask for dcn

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +2 -1
index df3203a1d278..64dc75378541 100644
@@ -364,7 +364,8 @@ struct dce_hwseq_registers {
 	HWSEQ_PIXEL_RATE_MASK_SH_LIST(mask_sh, OTG0_),\
 	HWS_SF1(OTG0_, PHYPLL_PIXEL_RATE_CNTL, PHYPLL_PIXEL_RATE_SOURCE, mask_sh), \
 	HWS_SF(, DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_ENABLE, mask_sh), \
-	HWS_SF(, DCFCLK_CNTL, DCFCLK_GATE_DIS, mask_sh)
+	HWS_SF(, DCFCLK_CNTL, DCFCLK_GATE_DIS, mask_sh), \
+	HWS_SF(, DC_MEM_GLOBAL_PWR_REQ_CNTL, DC_MEM_GLOBAL_PWR_REQ_DIS, mask_sh)
 
 #define HWSEQ_DCN1_MASK_SH_LIST(mask_sh)\
 	HWSEQ_DCN_MASK_SH_LIST(mask_sh), \
Signature · 6 lines
2.17.1

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

PATCH 32/54 drm/amd/display: set default GPIO_ID_HPD

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +1 -0
index ab5483c0c502..f20161c5706d 100644
@@ -375,6 +375,7 @@ struct gpio *dal_gpio_create_irq(
 	case GPIO_ID_GPIO_PAD:
 	break;
 	default:
+		id = GPIO_ID_HPD;
 		ASSERT_CRITICAL(false);
 		return NULL;
 	}
Signature · 6 lines
2.17.1

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

PATCH 33/54 drm/amd/display: add dcn cursor hotsport rotation and mirror support

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h  |  1 +
 .../display/dc/dce110/dce110_hw_sequencer.c   |  3 ++-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 20 ++++++++++++++++---
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c |  3 ++-
 4 files changed, 22 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -0
index afda2d442156..e1c0af76e62a 100644
@@ -408,6 +408,7 @@ struct dc_cursor_mi_param {
 	struct fixed31_32 h_scale_ratio;
 	struct fixed31_32 v_scale_ratio;
 	enum dc_rotation_angle rotation;
+	bool mirror;
 };
 
 /* IPP related types */
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -1
index e25f3d00f861..0966d67df0c1 100644
@@ -2789,7 +2789,8 @@ void dce110_set_cursor_position(struct pipe_ctx *pipe_ctx)
 		.viewport = pipe_ctx->plane_res.scl_data.viewport,
 		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
 		.v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
-		.rotation = pipe_ctx->plane_state->rotation
+		.rotation = pipe_ctx->plane_state->rotation,
+		.mirror = pipe_ctx->plane_state->horizontal_mirror
 	};
 
 	if (pipe_ctx->plane_state->address.type
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +17 -3
index 5b5ece0e84ce..2421f176cd33 100644
@@ -1098,8 +1098,10 @@ void hubp1_cursor_set_position(
 {
 	struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
 	int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x;
+	int x_hotspot = pos->x_hotspot;
+	int y_hotspot = pos->y_hotspot;
+	uint32_t dst_x_offset;
 	uint32_t cur_en = pos->enable ? 1 : 0;
-	uint32_t dst_x_offset = (src_x_offset >= 0) ? src_x_offset : 0;
 
 	/*
 	 * Guard aganst cursor_set_position() from being called with invalid
@@ -1111,6 +1113,18 @@ void hubp1_cursor_set_position(
 	if (hubp->curs_attr.address.quad_part == 0)
 		return;
 
+	if (param->rotation == ROTATION_ANGLE_90 || param->rotation == ROTATION_ANGLE_270) {
+		src_x_offset = pos->y - pos->y_hotspot - param->viewport.x;
+		y_hotspot = pos->x_hotspot;
+		x_hotspot = pos->y_hotspot;
+	}
+
+	if (param->mirror) {
+		x_hotspot = param->viewport.width - x_hotspot;
+		src_x_offset = param->viewport.x + param->viewport.width - src_x_offset;
+	}
+
+	dst_x_offset = (src_x_offset >= 0) ? src_x_offset : 0;
 	dst_x_offset *= param->ref_clk_khz;
 	dst_x_offset /= param->pixel_clk_khz;
 
@@ -1138,8 +1152,8 @@ void hubp1_cursor_set_position(
 			CURSOR_Y_POSITION, pos->y);
 
 	REG_SET_2(CURSOR_HOT_SPOT, 0,
-			CURSOR_HOT_SPOT_X, pos->x_hotspot,
-			CURSOR_HOT_SPOT_Y, pos->y_hotspot);
+			CURSOR_HOT_SPOT_X, x_hotspot,
+			CURSOR_HOT_SPOT_Y, y_hotspot);
 
 	REG_SET(CURSOR_DST_OFFSET, 0,
 			CURSOR_DST_X_OFFSET, dst_x_offset);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -1
index 80cb7fd1a97f..28dba6a324c1 100644
@@ -2546,7 +2546,8 @@ static void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
 		.viewport = pipe_ctx->plane_res.scl_data.viewport,
 		.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz,
 		.v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert,
-		.rotation = pipe_ctx->plane_state->rotation
+		.rotation = pipe_ctx->plane_state->rotation,
+		.mirror = pipe_ctx->plane_state->horizontal_mirror
 	};
 
 	if (pipe_ctx->plane_state->address.type
Signature · 6 lines
2.17.1

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

PATCH 34/54 drm/amd/display: expose dcn10_aux_initialize in header

In reply to a message not in the archive

From: Yongqiang Sun <[email protected]>

---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c  | 10 ++--------
 .../gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h  |  2 ++
 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +2 -8
index 18a7cac4f6e3..be78ccb439e9 100644
@@ -65,11 +65,6 @@ enum {
 	DP_MST_UPDATE_MAX_RETRY = 50
 };
 
-
-
-static void aux_initialize(struct dcn10_link_encoder *enc10);
-
-
 static const struct link_encoder_funcs dcn10_lnk_enc_funcs = {
 	.validate_output_with_stream =
 		dcn10_link_encoder_validate_output_with_stream,
@@ -811,7 +806,7 @@ void dcn10_link_encoder_hw_init(
 		ASSERT(result == BP_RESULT_OK);
 
 	}
-	aux_initialize(enc10);
+	dcn10_aux_initialize(enc10);
 
 	/* reinitialize HPD.
 	 * hpd_initialize() will pass DIG_FE id to HW context.
@@ -1348,8 +1343,7 @@ void dcn10_link_encoder_disable_hpd(struct link_encoder *enc)
 				FN(reg, f1), v1,\
 				FN(reg, f2), v2)
 
-static void aux_initialize(
-	struct dcn10_link_encoder *enc10)
+void dcn10_aux_initialize(struct dcn10_link_encoder *enc10)
 {
 	enum hpd_source_id hpd_source = enc10->base.hpd_source;
 
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h +2 -0
index cd3bb5d40579..49ead12b2532 100644
@@ -336,4 +336,6 @@ void dcn10_psr_program_secondary_packet(struct link_encoder *enc,
 
 bool dcn10_is_dig_enabled(struct link_encoder *enc);
 
+void dcn10_aux_initialize(struct dcn10_link_encoder *enc10);
+
 #endif /* __DC_LINK_ENCODER__DCN10_H__ */
Signature · 6 lines
2.17.1

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

PATCH 35/54 drm/amd/display: Linux hook test pattern through debufs

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

bug fix: phy test PLTAT is special 80bit test pattern. The 80bit data should be hard coded within driver so that user does not need input the deata. previous driver does not have hard coded 80 bits pattern data for PLTPAT. Other than this PLTPAT, user has to input 80 bits pattern data. In case user input less than 10 bytes data, un-input data byte will be filled by 0x00.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 70 +++++++++++++++----
 1 file changed, 55 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +55 -15
index f20ba9d1c9e2..0276e09d0b82 100644
@@ -483,16 +483,22 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
 	char *wr_buf = NULL;
 	char *wr_buf_ptr = NULL;
 	uint32_t wr_buf_size = 100;
+	uint32_t wr_buf_count = 0;
 	int r;
 	int bytes_from_user;
-	char *sub_str;
+	char *sub_str = NULL;
 	uint8_t param_index = 0;
-	long param[11];
+	uint8_t param_nums = 0;
+	long param[11] = {0x0};
 	const char delimiter[3] = {' ', '\n', '\0'};
 	enum dp_test_pattern test_pattern = DP_TEST_PATTERN_UNSUPPORTED;
 	bool disable_hpd = false;
 	bool valid_test_pattern = false;
-	uint8_t custom_pattern[10] = {0};
+	/* init with defalut 80bit custom pattern */
+	uint8_t custom_pattern[10] = {
+			0x1f, 0x7c, 0xf0, 0xc1, 0x07,
+			0x1f, 0x7c, 0xf0, 0xc1, 0x07
+			};
 	struct dc_link_settings prefer_link_settings = {LANE_COUNT_UNKNOWN,
 			LINK_RATE_UNKNOWN, LINK_SPREAD_DISABLED};
 	struct dc_link_settings cur_link_settings = {LANE_COUNT_UNKNOWN,
@@ -519,25 +525,51 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
 
 	bytes_from_user = wr_buf_size - r;
 
-	while (isspace(*wr_buf_ptr))
+	/* check number of parameters. isspace could not differ space and \n */
+	while ((*wr_buf_ptr != 0xa) && (wr_buf_count < wr_buf_size)) {
+		/* skip space*/
+		while (isspace(*wr_buf_ptr) && (wr_buf_count < wr_buf_size)) {
+			wr_buf_ptr++;
+			wr_buf_count++;
+			}
+
+		if (wr_buf_count == wr_buf_size)
+			break;
+
+		/* skip non-space*/
+		while ((!isspace(*wr_buf_ptr)) && (wr_buf_count < wr_buf_size)) {
+			wr_buf_ptr++;
+			wr_buf_count++;
+			}
+
+		param_nums++;
+
+		if (wr_buf_count == wr_buf_size)
+			break;
+	}
+
+	/* max 11 parameters */
+	if (param_nums > 11)
+		param_nums = 11;
+
+	wr_buf_ptr = wr_buf; /* reset buf pinter */
+	wr_buf_count = 0; /* number of char already checked */
+
+	while (isspace(*wr_buf_ptr) && (wr_buf_count < wr_buf_size)) {
 		wr_buf_ptr++;
+		wr_buf_count++;
+	}
 
-	while ((*wr_buf_ptr != '\0') && (param_index < 1)) {
+	while (param_index < param_nums) {
+		/* after strsep, wr_buf_ptr will be moved to after space */
 		sub_str = strsep(&wr_buf_ptr, delimiter);
+
 		r = kstrtol(sub_str, 16, &param[param_index]);
 
 		if (r)
 			DRM_DEBUG_DRIVER("string to int convert error code: %d\n", r);
 
 		param_index++;
-		while (isspace(*wr_buf_ptr))
-			wr_buf_ptr++;
-
-		/* DP_TEST_PATTERN_80BIT_CUSTOM need extra 80 bits
-		 * whci are 10 bytes separte by space
-		 */
-		if (param[0] != 0x4)
-			break;
 	}
 
 	test_pattern = param[0];
@@ -575,8 +607,16 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
 	}
 
 	if (test_pattern == DP_TEST_PATTERN_80BIT_CUSTOM) {
-		for (i = 0; i < 10; i++)
-			custom_pattern[i] = (uint8_t) param[i + 1];
+		for (i = 0; i < 10; i++) {
+			if ((uint8_t) param[i + 1] != 0x0)
+				break;
+		}
+
+		if (i < 10) {
+			/* not use default value */
+			for (i = 0; i < 10; i++)
+				custom_pattern[i] = (uint8_t) param[i + 1];
+		}
 	}
 
 	/* Usage: set DP physical test pattern using debugfs with normal DP
Signature · 6 lines
2.17.1

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

PATCH 36/54 drm/amd/display: dal 3.1.54

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 1b36e763f3b0..6074680ecee1 100644
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-#define DC_VER "3.1.53"
+#define DC_VER "3.1.54"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
Signature · 6 lines
2.17.1

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

PATCH 37/54 drm/amd/display: Add YCbCr420 only support for HDMI 4K@60

In reply to a message not in the archive

From: "Jerry (Fangzhi) Zuo" <[email protected]>

[Why]
Some monitors mark 4K@60 capable HDMI port only have 300MHz TMDS maximum, but the edid includes 4K@60 mode in cea extension block.

[How]
To enable 4K@60, need to limit BW by allowing YCbCr420 ONLY mode. Add YCbCr420 only support for monitors that do not fully support HDMI2.0, e.g., ASUS PA328. The YCbCr420 only support applies to DCN, DCE112 or higher.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
index cc69cf484325..e79e89be486a 100644
@@ -3569,7 +3569,6 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
 	aconnector->base.stereo_allowed = false;
 	aconnector->base.dpms = DRM_MODE_DPMS_OFF;
 	aconnector->hpd.hpd = AMDGPU_HPD_NONE; /* not used */
-
 	mutex_init(&aconnector->hpd_lock);
 
 	/* configure support HPD hot plug connector_>polled default value is 0
@@ -3578,9 +3577,13 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
 	switch (connector_type) {
 	case DRM_MODE_CONNECTOR_HDMIA:
 		aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
+		aconnector->base.ycbcr_420_allowed =
+			link->link_enc->features.ycbcr420_supported ? true : false;
 		break;
 	case DRM_MODE_CONNECTOR_DisplayPort:
 		aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
+		aconnector->base.ycbcr_420_allowed =
+			link->link_enc->features.ycbcr420_supported ? true : false;
 		break;
 	case DRM_MODE_CONNECTOR_DVID:
 		aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
Signature · 6 lines
2.17.1

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

PATCH 38/54 drm/amd/display: Expose bunch of functions from dcn10_hw_sequencer

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

---
 .../gpu/drm/amd/display/dc/core/dc_resource.c |  1 -
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |  1 +
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 59 +++++++++++--------
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.h |  7 +++
 .../gpu/drm/amd/display/dc/inc/hw_sequencer.h |  8 +++
 5 files changed, 50 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -1
index 41562ffa1c62..cacf59d0a1d6 100644
@@ -1473,7 +1473,6 @@ bool dc_add_all_planes_for_stream(
 	return add_all_planes_for_stream(dc, stream, &set, 1, context);
 }
 
-
 static bool is_hdr_static_meta_changed(struct dc_stream_state *cur_stream,
 	struct dc_stream_state *new_stream)
 {
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
index 532b2aff2227..65d08d594628 100644
@@ -131,6 +131,7 @@ struct dc_stream_update {
 	struct dc_info_packet *vsc_infopacket;
 
 	bool *dpms_off;
+
 };
 
 bool dc_is_stream_unchanged(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +34 -25

102 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +7 -0
index 44f734b73f9e..7139fb73e966 100644
@@ -39,4 +39,11 @@ bool is_rgb_cspace(enum dc_color_space output_color_space);
 
 void hwss1_plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx);
 
+void dcn10_verify_allow_pstate_change_high(struct dc *dc);
+
+void dcn10_program_pipe(
+		struct dc *dc,
+		struct pipe_ctx *pipe_ctx,
+		struct dc_state *context);
+
 #endif /* __DC_HWSS_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +8 -0
index 2506601120af..c2277d1e195b 100644
@@ -102,10 +102,18 @@ struct hw_sequencer_funcs {
 		const struct dc *dc,
 		struct pipe_ctx *pipe_ctx);
 
+	void (*plane_atomic_disconnect)(
+		struct dc *dc,
+		struct pipe_ctx *pipe_ctx);
+
 	void (*update_dchub)(
 		struct dce_hwseq *hws,
 		struct dchub_init_data *dh_data);
 
+	void (*update_mpcc)(
+		struct dc *dc,
+		struct pipe_ctx *pipe_ctx);
+
 	void (*update_pending_status)(
 			struct pipe_ctx *pipe_ctx);
 
Signature · 6 lines
2.17.1

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

#46 lore raw

Re: [PATCH 38/54] drm/amd/display: Expose bunch of functions from dcn10_hw_sequencer

This has some whitespace changes that don't seem to be related, please get people to be a bit more careful.

(though I do realise this could be magic ifdef stuff that got ripped out :-)

Dave.

Quoted 192 lines · Harry Wentland

From: Eric Bernstein <[email protected]>

---
 .../gpu/drm/amd/display/dc/core/dc_resource.c |  1 -
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |  1 +
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 59 +++++++++++--------
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.h |  7 +++
 .../gpu/drm/amd/display/dc/inc/hw_sequencer.h |  8 +++
 5 files changed, 50 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -1
index 41562ffa1c62..cacf59d0a1d6 100644
@@ -1473,7 +1473,6 @@ bool dc_add_all_planes_for_stream(
        return add_all_planes_for_stream(dc, stream, &set, 1, context);
 }
 
-
 static bool is_hdr_static_meta_changed(struct dc_stream_state *cur_stream,
        struct dc_stream_state *new_stream)
 {
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
index 532b2aff2227..65d08d594628 100644
@@ -131,6 +131,7 @@ struct dc_stream_update {
        struct dc_info_packet *vsc_infopacket;
 
        bool *dpms_off;
+
 };
 
 bool dc_is_stream_unchanged(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +34 -25
index 28dba6a324c1..06cf967b2431 100644
@@ -849,7 +849,7 @@ static bool dcn10_hw_wa_force_recovery(struct dc *dc)
 }
 
 
-static void dcn10_verify_allow_pstate_change_high(struct dc *dc)
+void dcn10_verify_allow_pstate_change_high(struct dc *dc)
 {
        static bool should_log_hw_state; /* prevent hw state log by default */
 
@@ -1863,8 +1863,7 @@ static void update_dpp(struct dpp *dpp, struct dc_plane_state *plane_state)
                dpp->funcs->dpp_program_bias_and_scale(dpp, &bns_params);
 }
 
-
-static void update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
+static void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
 {
        struct hubp *hubp = pipe_ctx->plane_res.hubp;
        struct mpcc_blnd_cfg blnd_cfg;
@@ -2009,7 +2008,7 @@ static void update_dchubp_dpp(
 
        if (plane_state->update_flags.bits.full_update ||
                plane_state->update_flags.bits.per_pixel_alpha_change)
-               update_mpcc(dc, pipe_ctx);
+               dc->hwss.update_mpcc(dc, pipe_ctx);
 
        if (plane_state->update_flags.bits.full_update ||
                plane_state->update_flags.bits.per_pixel_alpha_change ||
@@ -2119,6 +2118,33 @@ static void set_hdr_multiplier(struct pipe_ctx *pipe_ctx)
                        pipe_ctx->plane_res.dpp, hw_mult);
 }
 
+void dcn10_program_pipe(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx,
+               struct dc_state *context)
+{
+       if (pipe_ctx->plane_state->update_flags.bits.full_update)
+               dcn10_enable_plane(dc, pipe_ctx, context);
+
+       update_dchubp_dpp(dc, pipe_ctx, context);
+
+       set_hdr_multiplier(pipe_ctx);
+
+       if (pipe_ctx->plane_state->update_flags.bits.full_update ||
+                       pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
+                       pipe_ctx->plane_state->update_flags.bits.gamma_change)
+               dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
+
+       /* dcn10_translate_regamma_to_hw_format takes 750us to finish
+        * only do gamma programming for full update.
+        * TODO: This can be further optimized/cleaned up
+        * Always call this for now since it does memcmp inside before
+        * doing heavy calculation and programming
+        */
+       if (pipe_ctx->plane_state->update_flags.bits.full_update)
+               dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
+}
+
 static void program_all_pipe_in_tree(
                struct dc *dc,
                struct pipe_ctx *pipe_ctx,
@@ -2140,26 +2166,7 @@ static void program_all_pipe_in_tree(
        }
 
        if (pipe_ctx->plane_state != NULL) {
-               if (pipe_ctx->plane_state->update_flags.bits.full_update)
-                       dcn10_enable_plane(dc, pipe_ctx, context);
-
-               update_dchubp_dpp(dc, pipe_ctx, context);
-
-               set_hdr_multiplier(pipe_ctx);
-
-               if (pipe_ctx->plane_state->update_flags.bits.full_update ||
-                               pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
-                               pipe_ctx->plane_state->update_flags.bits.gamma_change)
-                       dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
-
-               /* dcn10_translate_regamma_to_hw_format takes 750us to finish
-                * only do gamma programming for full update.
-                * TODO: This can be further optimized/cleaned up
-                * Always call this for now since it does memcmp inside before
-                * doing heavy calculation and programming
-                */
-               if (pipe_ctx->plane_state->update_flags.bits.full_update)
-                       dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
+               dcn10_program_pipe(dc, pipe_ctx, context);
        }
 
        if (pipe_ctx->bottom_pipe != NULL && pipe_ctx->bottom_pipe != pipe_ctx) {
@@ -2284,7 +2291,7 @@ static void dcn10_apply_ctx_for_surface(
                        old_pipe_ctx->plane_state &&
                        old_pipe_ctx->stream_res.tg == tg) {
 
-                       hwss1_plane_atomic_disconnect(dc, old_pipe_ctx);
+                       dc->hwss.plane_atomic_disconnect(dc, old_pipe_ctx);
                        removed_pipe[i] = true;
 
                        DC_LOG_DC("Reset mpcc for pipe %d\n",
@@ -2578,7 +2585,9 @@ static const struct hw_sequencer_funcs dcn10_funcs = {
        .apply_ctx_to_hw = dce110_apply_ctx_to_hw,
        .apply_ctx_for_surface = dcn10_apply_ctx_for_surface,
        .update_plane_addr = dcn10_update_plane_addr,
+       .plane_atomic_disconnect = hwss1_plane_atomic_disconnect,
        .update_dchub = dcn10_update_dchub,
+       .update_mpcc = dcn10_update_mpcc,
        .update_pending_status = dcn10_update_pending_status,
        .set_input_transfer_func = dcn10_set_input_transfer_func,
        .set_output_transfer_func = dcn10_set_output_transfer_func,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +7 -0
index 44f734b73f9e..7139fb73e966 100644
@@ -39,4 +39,11 @@ bool is_rgb_cspace(enum dc_color_space output_color_space);
 
 void hwss1_plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx);
 
+void dcn10_verify_allow_pstate_change_high(struct dc *dc);
+
+void dcn10_program_pipe(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx,
+               struct dc_state *context);
+
 #endif /* __DC_HWSS_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +8 -1
index 2506601120af..c2277d1e195b 100644
@@ -102,10 +102,18 @@ struct hw_sequencer_funcs {
                const struct dc *dc,
                struct pipe_ctx *pipe_ctx);
 
+       void (*plane_atomic_disconnect)(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx);
+
        void (*update_dchub)(
                struct dce_hwseq *hws,
                struct dchub_init_data *dh_data);
 
+       void (*update_mpcc)(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx);
+
        void (*update_pending_status)(
                        struct pipe_ctx *pipe_ctx);
 
--

2.17.1

Quoted 4 lines

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): CAPM=9tzF7UF9mv4LegXmcz7+Y30MbehakwwQVptjTu-vkJ8TQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#48 lore raw

Re: [PATCH 38/54] drm/amd/display: Expose bunch of functions from dcn10_hw_sequencer

Quoted 5 lines · Dave Airlie

This has some whitespace changes that don't seem to be related, please get people to be a bit more careful.

(though I do realise this could be magic ifdef stuff that got ripped out :-)

It's the latter. I'm running "unifdef -B" which should compress blank lines around deleted sections, but it doesn't do a great job.

Could clean it up manually but that's a bit painful.

Harry

Quoted 193 lines

Dave.

Quoted 189 lines · Harry Wentland

From: Eric Bernstein <[email protected]>

---
 .../gpu/drm/amd/display/dc/core/dc_resource.c |  1 -
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |  1 +
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 59 +++++++++++--------
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.h |  7 +++
 .../gpu/drm/amd/display/dc/inc/hw_sequencer.h |  8 +++
 5 files changed, 50 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -1
index 41562ffa1c62..cacf59d0a1d6 100644
@@ -1473,7 +1473,6 @@ bool dc_add_all_planes_for_stream(
        return add_all_planes_for_stream(dc, stream, &set, 1, context);
 }
 
-
 static bool is_hdr_static_meta_changed(struct dc_stream_state *cur_stream,
        struct dc_stream_state *new_stream)
 {
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
index 532b2aff2227..65d08d594628 100644
@@ -131,6 +131,7 @@ struct dc_stream_update {
        struct dc_info_packet *vsc_infopacket;
 
        bool *dpms_off;
+
 };
 
 bool dc_is_stream_unchanged(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +34 -25
index 28dba6a324c1..06cf967b2431 100644
@@ -849,7 +849,7 @@ static bool dcn10_hw_wa_force_recovery(struct dc *dc)
 }
 
 
-static void dcn10_verify_allow_pstate_change_high(struct dc *dc)
+void dcn10_verify_allow_pstate_change_high(struct dc *dc)
 {
        static bool should_log_hw_state; /* prevent hw state log by default */
 
@@ -1863,8 +1863,7 @@ static void update_dpp(struct dpp *dpp, struct dc_plane_state *plane_state)
                dpp->funcs->dpp_program_bias_and_scale(dpp, &bns_params);
 }
 
-
-static void update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
+static void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
 {
        struct hubp *hubp = pipe_ctx->plane_res.hubp;
        struct mpcc_blnd_cfg blnd_cfg;
@@ -2009,7 +2008,7 @@ static void update_dchubp_dpp(
 
        if (plane_state->update_flags.bits.full_update ||
                plane_state->update_flags.bits.per_pixel_alpha_change)
-               update_mpcc(dc, pipe_ctx);
+               dc->hwss.update_mpcc(dc, pipe_ctx);
 
        if (plane_state->update_flags.bits.full_update ||
                plane_state->update_flags.bits.per_pixel_alpha_change ||
@@ -2119,6 +2118,33 @@ static void set_hdr_multiplier(struct pipe_ctx *pipe_ctx)
                        pipe_ctx->plane_res.dpp, hw_mult);
 }
 
+void dcn10_program_pipe(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx,
+               struct dc_state *context)
+{
+       if (pipe_ctx->plane_state->update_flags.bits.full_update)
+               dcn10_enable_plane(dc, pipe_ctx, context);
+
+       update_dchubp_dpp(dc, pipe_ctx, context);
+
+       set_hdr_multiplier(pipe_ctx);
+
+       if (pipe_ctx->plane_state->update_flags.bits.full_update ||
+                       pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
+                       pipe_ctx->plane_state->update_flags.bits.gamma_change)
+               dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
+
+       /* dcn10_translate_regamma_to_hw_format takes 750us to finish
+        * only do gamma programming for full update.
+        * TODO: This can be further optimized/cleaned up
+        * Always call this for now since it does memcmp inside before
+        * doing heavy calculation and programming
+        */
+       if (pipe_ctx->plane_state->update_flags.bits.full_update)
+               dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
+}
+
 static void program_all_pipe_in_tree(
                struct dc *dc,
                struct pipe_ctx *pipe_ctx,
@@ -2140,26 +2166,7 @@ static void program_all_pipe_in_tree(
        }
 
        if (pipe_ctx->plane_state != NULL) {
-               if (pipe_ctx->plane_state->update_flags.bits.full_update)
-                       dcn10_enable_plane(dc, pipe_ctx, context);
-
-               update_dchubp_dpp(dc, pipe_ctx, context);
-
-               set_hdr_multiplier(pipe_ctx);
-
-               if (pipe_ctx->plane_state->update_flags.bits.full_update ||
-                               pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
-                               pipe_ctx->plane_state->update_flags.bits.gamma_change)
-                       dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
-
-               /* dcn10_translate_regamma_to_hw_format takes 750us to finish
-                * only do gamma programming for full update.
-                * TODO: This can be further optimized/cleaned up
-                * Always call this for now since it does memcmp inside before
-                * doing heavy calculation and programming
-                */
-               if (pipe_ctx->plane_state->update_flags.bits.full_update)
-                       dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
+               dcn10_program_pipe(dc, pipe_ctx, context);
        }
 
        if (pipe_ctx->bottom_pipe != NULL && pipe_ctx->bottom_pipe != pipe_ctx) {
@@ -2284,7 +2291,7 @@ static void dcn10_apply_ctx_for_surface(
                        old_pipe_ctx->plane_state &&
                        old_pipe_ctx->stream_res.tg == tg) {
 
-                       hwss1_plane_atomic_disconnect(dc, old_pipe_ctx);
+                       dc->hwss.plane_atomic_disconnect(dc, old_pipe_ctx);
                        removed_pipe[i] = true;
 
                        DC_LOG_DC("Reset mpcc for pipe %d\n",
@@ -2578,7 +2585,9 @@ static const struct hw_sequencer_funcs dcn10_funcs = {
        .apply_ctx_to_hw = dce110_apply_ctx_to_hw,
        .apply_ctx_for_surface = dcn10_apply_ctx_for_surface,
        .update_plane_addr = dcn10_update_plane_addr,
+       .plane_atomic_disconnect = hwss1_plane_atomic_disconnect,
        .update_dchub = dcn10_update_dchub,
+       .update_mpcc = dcn10_update_mpcc,
        .update_pending_status = dcn10_update_pending_status,
        .set_input_transfer_func = dcn10_set_input_transfer_func,
        .set_output_transfer_func = dcn10_set_output_transfer_func,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +7 -0
index 44f734b73f9e..7139fb73e966 100644
@@ -39,4 +39,11 @@ bool is_rgb_cspace(enum dc_color_space output_color_space);
 
 void hwss1_plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx);
 
+void dcn10_verify_allow_pstate_change_high(struct dc *dc);
+
+void dcn10_program_pipe(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx,
+               struct dc_state *context);
+
 #endif /* __DC_HWSS_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +8 -0
index 2506601120af..c2277d1e195b 100644
@@ -102,10 +102,18 @@ struct hw_sequencer_funcs {
                const struct dc *dc,
                struct pipe_ctx *pipe_ctx);
 
+       void (*plane_atomic_disconnect)(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx);
+
        void (*update_dchub)(
                struct dce_hwseq *hws,
                struct dchub_init_data *dh_data);
 
+       void (*update_mpcc)(
+               struct dc *dc,
+               struct pipe_ctx *pipe_ctx);
+
        void (*update_pending_status)(
                        struct pipe_ctx *pipe_ctx);
 
Quoted 7 lines
Quoted 7 lines

--
2.17.1

_______________________________________________
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

#49 lore raw

PATCH v2 1/1 drm/amd/display: Expose bunch of functions from dcn10_hw_sequencer

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

v2: Remove spurious newline changes

---
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 59 +++++++++++--------
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.h |  7 +++
 .../gpu/drm/amd/display/dc/inc/hw_sequencer.h |  8 +++
 3 files changed, 49 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +34 -25
index 28dba6a324c1..06cf967b2431 100644
@@ -849,7 +849,7 @@ static bool dcn10_hw_wa_force_recovery(struct dc *dc)
 }
 
 
-static void dcn10_verify_allow_pstate_change_high(struct dc *dc)
+void dcn10_verify_allow_pstate_change_high(struct dc *dc)
 {
 	static bool should_log_hw_state; /* prevent hw state log by default */
 
@@ -1863,8 +1863,7 @@ static void update_dpp(struct dpp *dpp, struct dc_plane_state *plane_state)
 		dpp->funcs->dpp_program_bias_and_scale(dpp, &bns_params);
 }
 
-
-static void update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
+static void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
 {
 	struct hubp *hubp = pipe_ctx->plane_res.hubp;
 	struct mpcc_blnd_cfg blnd_cfg;
@@ -2009,7 +2008,7 @@ static void update_dchubp_dpp(
 
 	if (plane_state->update_flags.bits.full_update ||
 		plane_state->update_flags.bits.per_pixel_alpha_change)
-		update_mpcc(dc, pipe_ctx);
+		dc->hwss.update_mpcc(dc, pipe_ctx);
 
 	if (plane_state->update_flags.bits.full_update ||
 		plane_state->update_flags.bits.per_pixel_alpha_change ||
@@ -2119,6 +2118,33 @@ static void set_hdr_multiplier(struct pipe_ctx *pipe_ctx)
 			pipe_ctx->plane_res.dpp, hw_mult);
 }
 
+void dcn10_program_pipe(
+		struct dc *dc,
+		struct pipe_ctx *pipe_ctx,
+		struct dc_state *context)
+{
+	if (pipe_ctx->plane_state->update_flags.bits.full_update)
+		dcn10_enable_plane(dc, pipe_ctx, context);
+
+	update_dchubp_dpp(dc, pipe_ctx, context);
+
+	set_hdr_multiplier(pipe_ctx);
+
+	if (pipe_ctx->plane_state->update_flags.bits.full_update ||
+			pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
+			pipe_ctx->plane_state->update_flags.bits.gamma_change)
+		dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
+
+	/* dcn10_translate_regamma_to_hw_format takes 750us to finish
+	 * only do gamma programming for full update.
+	 * TODO: This can be further optimized/cleaned up
+	 * Always call this for now since it does memcmp inside before
+	 * doing heavy calculation and programming
+	 */
+	if (pipe_ctx->plane_state->update_flags.bits.full_update)
+		dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
+}
+
 static void program_all_pipe_in_tree(
 		struct dc *dc,
 		struct pipe_ctx *pipe_ctx,
@@ -2140,26 +2166,7 @@ static void program_all_pipe_in_tree(
 	}
 
 	if (pipe_ctx->plane_state != NULL) {
-		if (pipe_ctx->plane_state->update_flags.bits.full_update)
-			dcn10_enable_plane(dc, pipe_ctx, context);
-
-		update_dchubp_dpp(dc, pipe_ctx, context);
-
-		set_hdr_multiplier(pipe_ctx);
-
-		if (pipe_ctx->plane_state->update_flags.bits.full_update ||
-				pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
-				pipe_ctx->plane_state->update_flags.bits.gamma_change)
-			dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
-
-		/* dcn10_translate_regamma_to_hw_format takes 750us to finish
-		 * only do gamma programming for full update.
-		 * TODO: This can be further optimized/cleaned up
-		 * Always call this for now since it does memcmp inside before
-		 * doing heavy calculation and programming
-		 */
-		if (pipe_ctx->plane_state->update_flags.bits.full_update)
-			dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
+		dcn10_program_pipe(dc, pipe_ctx, context);
 	}
 
 	if (pipe_ctx->bottom_pipe != NULL && pipe_ctx->bottom_pipe != pipe_ctx) {
@@ -2284,7 +2291,7 @@ static void dcn10_apply_ctx_for_surface(
 			old_pipe_ctx->plane_state &&
 			old_pipe_ctx->stream_res.tg == tg) {
 
-			hwss1_plane_atomic_disconnect(dc, old_pipe_ctx);
+			dc->hwss.plane_atomic_disconnect(dc, old_pipe_ctx);
 			removed_pipe[i] = true;
 
 			DC_LOG_DC("Reset mpcc for pipe %d\n",
@@ -2578,7 +2585,9 @@ static const struct hw_sequencer_funcs dcn10_funcs = {
 	.apply_ctx_to_hw = dce110_apply_ctx_to_hw,
 	.apply_ctx_for_surface = dcn10_apply_ctx_for_surface,
 	.update_plane_addr = dcn10_update_plane_addr,
+	.plane_atomic_disconnect = hwss1_plane_atomic_disconnect,
 	.update_dchub = dcn10_update_dchub,
+	.update_mpcc = dcn10_update_mpcc,
 	.update_pending_status = dcn10_update_pending_status,
 	.set_input_transfer_func = dcn10_set_input_transfer_func,
 	.set_output_transfer_func = dcn10_set_output_transfer_func,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +7 -0
index 44f734b73f9e..7139fb73e966 100644
@@ -39,4 +39,11 @@ bool is_rgb_cspace(enum dc_color_space output_color_space);
 
 void hwss1_plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx);
 
+void dcn10_verify_allow_pstate_change_high(struct dc *dc);
+
+void dcn10_program_pipe(
+		struct dc *dc,
+		struct pipe_ctx *pipe_ctx,
+		struct dc_state *context);
+
 #endif /* __DC_HWSS_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +8 -0
index 2506601120af..c2277d1e195b 100644
@@ -102,10 +102,18 @@ struct hw_sequencer_funcs {
 		const struct dc *dc,
 		struct pipe_ctx *pipe_ctx);
 
+	void (*plane_atomic_disconnect)(
+		struct dc *dc,
+		struct pipe_ctx *pipe_ctx);
+
 	void (*update_dchub)(
 		struct dce_hwseq *hws,
 		struct dchub_init_data *dh_data);
 
+	void (*update_mpcc)(
+		struct dc *dc,
+		struct pipe_ctx *pipe_ctx);
+
 	void (*update_pending_status)(
 			struct pipe_ctx *pipe_ctx);
 
Signature · 6 lines
2.17.1

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

PATCH 39/54 drm/amd/display: Right shift AUX reply value sooner than later

In reply to a message not in the archive

From: "Leo (Sunpeng) Li" <[email protected]>

[Why]
There is no point in keeping the AUX reply value in the raw format as returned from reading the AUX_SW_DATA register.

[How]
Shift it within read_channel_reply(), where the register is read, before returning it.

---
 .../gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c +2 -2
index 1f3940644a5b..ae5caa97caca 100644
@@ -300,9 +300,10 @@ static int read_channel_reply(struct aux_engine *engine, uint32_t size,
 			  AUX_SW_DATA_RW, 1);
 
 	REG_GET(AUX_SW_DATA, AUX_SW_DATA, &reply_result_32);
+	reply_result_32 = reply_result_32 >> 4;
 	*reply_result = (uint8_t)reply_result_32;
 
-	if (reply_result_32 >> 4 == 0) { /* ACK */
+	if (reply_result_32 == 0) { /* ACK */
 		uint32_t i = 0;
 
 		/* First byte was already used to get the command status */
@@ -356,7 +357,6 @@ static void process_channel_reply(
 			return;
 		}
 	} else {
-		reply_result = reply_result >> 4;
 
 		switch (reply_result) {
 		case 0: /* ACK */
Signature · 6 lines
2.17.1

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

PATCH 40/54 drm/amd/display: Read AUX channel even if only status byte is returned

In reply to a message not in the archive

From: "Leo (Sunpeng) Li" <[email protected]>

[Why]
get_channel_status() can return 0 in returned_bytes, and report a successful operation result. This is because it prunes the first status byte out. This was preventing read_channel_reply() from being called (due to the faulty condition), and consequently preventing the AUX reply status from being set.

[How]
Fix the conditional so that it accounts for when get_channel_status() returns 0 bytes read.

[Fixes]
Fixes possible edid read failures during S3 resume, where we are now relying on DRM's DP AUX handling. This was an regression introduced by:

Author: Harry Wentland <[email protected]>
drm/amd/display: Return aux replies directly to DRM

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +1 -1
index d108ccfc5cf9..08c9d73b9ab7 100644
@@ -671,7 +671,7 @@ int dc_link_aux_transfer(struct ddc_service *ddc,
 	case AUX_CHANNEL_OPERATION_SUCCEEDED:
 		res = returned_bytes;
 
-		if (res <= size && res > 0)
+		if (res <= size && res >= 0)
 			res = engine->funcs->read_channel_reply(engine, size,
 								buffer, reply,
 								&status);
Signature · 6 lines
2.17.1

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

PATCH 41/54 drm/amd/display: introduce concept of send_reset_length for i2c engines

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h           |  1 +
 .../dc/i2caux/dce110/i2c_hw_engine_dce110.c   | 26 +++++++++++--------
 .../dc/i2caux/dce110/i2c_hw_engine_dce110.h   |  8 ++++++
 .../display/dc/i2caux/dce110/i2caux_dce110.c  | 18 ++++++++++++-
 .../drm/amd/display/dc/i2caux/i2c_engine.h    |  2 ++
 5 files changed, 43 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index 6074680ecee1..ede3489b4f37 100644
@@ -250,6 +250,7 @@ struct dc_debug {
 	bool p010_mpo_support;
 	bool recovery_enabled;
 	bool avoid_vbios_exec_table;
+	bool scl_reset_length10;
 
 };
 struct dc_state;
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.c +15 -11
index b7256f595052..9cbe1a7a6bcb 100644
@@ -62,12 +62,7 @@ enum dc_i2c_arbitration {
 	DC_I2C_ARBITRATION__DC_I2C_SW_PRIORITY_HIGH
 };
 
-enum {
-	/* No timeout in HW
-	 * (timeout implemented in SW by querying status) */
-	I2C_SETUP_TIME_LIMIT = 255,
-	I2C_HW_BUFFER_SIZE = 538
-};
+
 
 /*
  * @brief
@@ -152,6 +147,11 @@ static bool setup_engine(
 	struct i2c_engine *i2c_engine)
 {
 	struct i2c_hw_engine_dce110 *hw_engine = FROM_I2C_ENGINE(i2c_engine);
+	uint32_t i2c_setup_limit = I2C_SETUP_TIME_LIMIT_DCE;
+	uint32_t  reset_length = 0;
+
+	if (hw_engine->base.base.setup_limit != 0)
+		i2c_setup_limit = hw_engine->base.base.setup_limit;
 
 	/* Program pin select */
 	REG_UPDATE_6(
@@ -164,11 +164,15 @@ static bool setup_engine(
 			DC_I2C_DDC_SELECT, hw_engine->engine_id);
 
 	/* Program time limit */
-	REG_UPDATE_N(
-			SETUP, 2,
-			FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_TIME_LIMIT), I2C_SETUP_TIME_LIMIT,
-			FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_ENABLE), 1);
-
+	if (hw_engine->base.base.send_reset_length == 0) {
+		/*pre-dcn*/
+		REG_UPDATE_N(
+				SETUP, 2,
+				FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_TIME_LIMIT), i2c_setup_limit,
+				FN(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_ENABLE), 1);
+	} else {
+		reset_length = hw_engine->base.base.send_reset_length;
+	}
 	/* Program HW priority
 	 * set to High - interrupt software I2C at any time
 	 * Enable restart of SW I2C that was interrupted by HW
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.h +8 -0
index 5bb04085f670..fea2946906ed 100644
@@ -192,6 +192,7 @@ struct i2c_hw_engine_dce110 {
 	/* number of pending transactions (before GO) */
 	uint32_t transaction_count;
 	uint32_t engine_keep_power_up_count;
+	uint32_t i2_setup_time_limit;
 };
 
 struct i2c_hw_engine_dce110_create_arg {
@@ -207,4 +208,11 @@ struct i2c_hw_engine_dce110_create_arg {
 struct i2c_engine *dal_i2c_hw_engine_dce110_create(
 	const struct i2c_hw_engine_dce110_create_arg *arg);
 
+enum {
+	I2C_SETUP_TIME_LIMIT_DCE = 255,
+	I2C_SETUP_TIME_LIMIT_DCN = 3,
+	I2C_HW_BUFFER_SIZE = 538,
+	I2C_SEND_RESET_LENGTH_9 = 9,
+	I2C_SEND_RESET_LENGTH_10 = 10,
+};
 #endif
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.c +17 -1
index e0557d353818..1d748ac1d6d6 100644
@@ -43,6 +43,9 @@
 #include "i2c_sw_engine_dce110.h"
 #include "i2c_hw_engine_dce110.h"
 #include "aux_engine_dce110.h"
+#include "../../dc.h"
+#include "dc_types.h"
+
 
 /*
  * Post-requisites: headers required by this unit
@@ -250,7 +253,20 @@ void dal_i2caux_dce110_construct(
 
 		base->i2c_hw_engines[line_id] =
 			dal_i2c_hw_engine_dce110_create(&hw_arg_dce110);
-
+		if (base->i2c_hw_engines[line_id] != NULL) {
+			switch (ctx->dce_version) {
+			case DCN_VERSION_1_0:
+				base->i2c_hw_engines[line_id]->setup_limit =
+					I2C_SETUP_TIME_LIMIT_DCN;
+				base->i2c_hw_engines[line_id]->send_reset_length  = 0;
+			break;
+			default:
+				base->i2c_hw_engines[line_id]->setup_limit =
+					I2C_SETUP_TIME_LIMIT_DCE;
+				base->i2c_hw_engines[line_id]->send_reset_length  = 0;
+				break;
+			}
+		}
 		++i;
 	} while (i < num_i2caux_inst);
 
drivers/gpu/drm/amd/display/dc/i2caux/i2c_engine.h +2 -0
index 58fc0f25eceb..ded6ea34b714 100644
@@ -86,6 +86,8 @@ struct i2c_engine {
 	struct engine base;
 	const struct i2c_engine_funcs *funcs;
 	uint32_t timeout_delay;
+	uint32_t setup_limit;
+	uint32_t send_reset_length;
 };
 
 void dal_i2c_engine_construct(
Signature · 6 lines
2.17.1

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

PATCH 42/54 drm/amd/display: add DalEnableHDMI20 key support

In reply to a message not in the archive

From: Charlene Liu <[email protected]>

[why]
"DalEnableHDMI20" set to 0, disallow HDMI YCbCr420 and pixel clock > 340Mhz Default is enabled.

---
 drivers/gpu/drm/amd/display/dc/dc.h                       | 1 +
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c     | 6 ++++++
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 6 ++++++
 3 files changed, 13 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index ede3489b4f37..721c5cdff38f 100644
@@ -251,6 +251,7 @@ struct dc_debug {
 	bool recovery_enabled;
 	bool avoid_vbios_exec_table;
 	bool scl_reset_length10;
+	bool hdmi20_disable;
 
 };
 struct dc_state;
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +6 -0
index dbe3b26b6d9e..60e3c6a73d37 100644
@@ -646,6 +646,9 @@ static bool dce110_link_encoder_validate_hdmi_output(
 	if (!enc110->base.features.flags.bits.HDMI_6GB_EN &&
 		adjusted_pix_clk_khz >= 300000)
 		return false;
+	if (enc110->base.ctx->dc->debug.hdmi20_disable &&
+		crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
+		return false;
 	return true;
 }
 
@@ -773,6 +776,9 @@ void dce110_link_encoder_construct(
 				__func__,
 				result);
 	}
+	if (enc110->base.ctx->dc->debug.hdmi20_disable) {
+		enc110->base.features.flags.bits.HDMI_6GB_EN = 0;
+	}
 }
 
 bool dce110_link_encoder_validate_output_with_stream(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +6 -0
index be78ccb439e9..6f675206a136 100644
@@ -596,6 +596,9 @@ static bool dcn10_link_encoder_validate_hdmi_output(
 	if (!enc10->base.features.flags.bits.HDMI_6GB_EN &&
 		adjusted_pix_clk_khz >= 300000)
 		return false;
+	if (enc10->base.ctx->dc->debug.hdmi20_disable &&
+		crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
+		return false;
 	return true;
 }
 
@@ -728,6 +731,9 @@ void dcn10_link_encoder_construct(
 				__func__,
 				result);
 	}
+	if (enc10->base.ctx->dc->debug.hdmi20_disable) {
+		enc10->base.features.flags.bits.HDMI_6GB_EN = 0;
+	}
 }
 
 bool dcn10_link_encoder_validate_output_with_stream(
Signature · 6 lines
2.17.1

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

PATCH 43/54 drm/amd/display: add pp to dc powerlevel enum translator

In reply to a message not in the archive

From: Mikita Lipski <[email protected]>

[why]
Add a switch statement to translate pp's powerlevel enum to dc powerlevel statement enum
[how]
Add a translator function

---
 .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  | 29 ++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +28 -1
index 50e863024f58..c69ae78d82b2 100644
@@ -192,6 +192,33 @@ static enum amd_pp_clock_type dc_to_pp_clock_type(
 	return amd_pp_clk_type;
 }
 
+static enum dm_pp_clocks_state pp_to_dc_powerlevel_state(
+			enum PP_DAL_POWERLEVEL max_clocks_state)
+{
+	switch (max_clocks_state) {
+	case PP_DAL_POWERLEVEL_0:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_0;
+	case PP_DAL_POWERLEVEL_1:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_1;
+	case PP_DAL_POWERLEVEL_2:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_2;
+	case PP_DAL_POWERLEVEL_3:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_3;
+	case PP_DAL_POWERLEVEL_4:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_4;
+	case PP_DAL_POWERLEVEL_5:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_5;
+	case PP_DAL_POWERLEVEL_6:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_6;
+	case PP_DAL_POWERLEVEL_7:
+		return DM_PP_CLOCKS_DPM_STATE_LEVEL_7;
+	default:
+		DRM_ERROR("DM_PPLIB: invalid powerlevel state: %d!\n",
+				max_clocks_state);
+		return DM_PP_CLOCKS_STATE_INVALID;
+	}
+}
+
 static void pp_to_dc_clock_levels(
 		const struct amd_pp_clocks *pp_clks,
 		struct dm_pp_clock_levels *dc_clks,
@@ -441,7 +468,7 @@ bool dm_pp_get_static_clocks(
 	if (ret)
 		return false;
 
-	static_clk_info->max_clocks_state = pp_clk_info.max_clocks_state;
+	static_clk_info->max_clocks_state = pp_to_dc_powerlevel_state(pp_clk_info.max_clocks_state);
 	static_clk_info->max_mclk_khz = pp_clk_info.max_memory_clock;
 	static_clk_info->max_sclk_khz = pp_clk_info.max_engine_clock;
 
Signature · 6 lines
2.17.1

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

PATCH 44/54 drm/amd/display: Add NULL check for local sink in edp_power_control

In reply to a message not in the archive

From: Yue Hin Lau <[email protected]>

[WHY]
PNP cause bsod regression fix

[HOW]
Add NULL check

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -2
index 0966d67df0c1..a964dd0cafa4 100644
@@ -871,9 +871,11 @@ void hwss_edp_power_control(
 			unsigned long long wait_time_ms = 0;
 
 			/* max 500ms from LCDVDD off to on */
-			unsigned long long edp_poweroff_time_ms =
-					500 + link->local_sink->edid_caps.panel_patch.extra_t12_ms;
+			unsigned long long edp_poweroff_time_ms = 500;
 
+			if (link->local_sink != NULL)
+				edp_poweroff_time_ms =
+						500 + link->local_sink->edid_caps.panel_patch.extra_t12_ms;
 			if (link->link_trace.time_stamp.edp_poweroff == 0)
 				wait_time_ms = edp_poweroff_time_ms;
 			else if (duration_in_ms < edp_poweroff_time_ms)
Signature · 6 lines
2.17.1

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

PATCH 45/54 drm/amd/display: Return out_link_loss from interrupt handler

In reply to a message not in the archive

From: Fatemeh Darbehani <[email protected]>

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c  | 8 +++++++-
 drivers/gpu/drm/amd/display/dc/dc_link.h          | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index e79e89be486a..952691c6f81e 100644
@@ -1037,7 +1037,7 @@ static void handle_hpd_rx_irq(void *param)
 	if (dc_link->type != dc_connection_mst_branch)
 		mutex_lock(&aconnector->hpd_lock);
 
-	if (dc_link_handle_hpd_rx_irq(dc_link, NULL) &&
+	if (dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL) &&
 			!is_mst_root_connector) {
 		/* Downstream Port status changed. */
 		if (dc_link_detect(dc_link, DETECT_REASON_HPDRX)) {
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +7 -1
index c8d2593ada0f..49f465eb1939 100644
@@ -1996,12 +1996,16 @@ static void handle_automated_test(struct dc_link *link)
 			sizeof(test_response));
 }
 
-bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd_irq_dpcd_data)
+bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd_irq_dpcd_data, bool *out_link_loss)
 {
 	union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
 	union device_service_irq device_service_clear = { { 0 } };
 	enum dc_status result;
+
 	bool status = false;
+
+	if (out_link_loss)
+		*out_link_loss = false;
 	/* For use cases related to down stream connection status change,
 	 * PSR and device auto test, refer to function handle_sst_hpd_irq
 	 * in DAL2.1*/
@@ -2076,6 +2080,8 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
 			true, LINK_TRAINING_ATTEMPTS);
 
 		status = false;
+		if (out_link_loss)
+			*out_link_loss = true;
 	}
 
 	if (link->type == dc_connection_active_dongle &&
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -1
index eda4a5d3ff1c..070a56926308 100644
@@ -172,7 +172,7 @@ bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);
  * false - no change in Downstream port status. No further action required
  * from DM. */
 bool dc_link_handle_hpd_rx_irq(struct dc_link *dc_link,
-		union hpd_irq_data *hpd_irq_dpcd_data);
+		union hpd_irq_data *hpd_irq_dpcd_data, bool *out_link_loss);
 
 struct dc_sink_init_data;
 
Signature · 6 lines
2.17.1

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

PATCH 46/54 drm/amd/display: Add CRC support for DCN

In reply to a message not in the archive

From: David Francis <[email protected]>

[Why]
Regamma/CTM tests require CRC support

[How]
The CRC registers that were used in DCE exist under different names in DCN. The code was copied from DCE (in dc/dce110/dce110_timing_generator.c) into DCN, and changed to use the DCN register access helper functions.

---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 68 +++++++++++++++++++
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 49 ++++++++++++-
 2 files changed, 114 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +68 -0
index e6a3ade154b9..411f89218e01 100644
@@ -1324,6 +1324,72 @@ bool optc1_is_optc_underflow_occurred(struct timing_generator *optc)
 	return (underflow_occurred == 1);
 }
 
+bool optc1_configure_crc(struct timing_generator *optc,
+			  const struct crc_params *params)
+{
+	struct optc *optc1 = DCN10TG_FROM_TG(optc);
+
+	/* Cannot configure crc on a CRTC that is disabled */
+	if (!optc1_is_tg_enabled(optc))
+		return false;
+
+	REG_WRITE(OTG_CRC_CNTL, 0);
+
+	if (!params->enable)
+		return true;
+
+	/* Program frame boundaries */
+	/* Window A x axis start and end. */
+	REG_UPDATE_2(OTG_CRC0_WINDOWA_X_CONTROL,
+			OTG_CRC0_WINDOWA_X_START, params->windowa_x_start,
+			OTG_CRC0_WINDOWA_X_END, params->windowa_x_end);
+
+	/* Window A y axis start and end. */
+	REG_UPDATE_2(OTG_CRC0_WINDOWA_Y_CONTROL,
+			OTG_CRC0_WINDOWA_Y_START, params->windowa_y_start,
+			OTG_CRC0_WINDOWA_Y_END, params->windowa_y_end);
+
+	/* Window B x axis start and end. */
+	REG_UPDATE_2(OTG_CRC0_WINDOWB_X_CONTROL,
+			OTG_CRC0_WINDOWB_X_START, params->windowb_x_start,
+			OTG_CRC0_WINDOWB_X_END, params->windowb_x_end);
+
+	/* Window B y axis start and end. */
+	REG_UPDATE_2(OTG_CRC0_WINDOWB_Y_CONTROL,
+			OTG_CRC0_WINDOWB_Y_START, params->windowb_y_start,
+			OTG_CRC0_WINDOWB_Y_END, params->windowb_y_end);
+
+	/* Set crc mode and selection, and enable. Only using CRC0*/
+	REG_UPDATE_3(OTG_CRC_CNTL,
+			OTG_CRC_CONT_EN, params->continuous_mode ? 1 : 0,
+			OTG_CRC0_SELECT, params->selection,
+			OTG_CRC_EN, 1);
+
+	return true;
+}
+
+bool optc1_get_crc(struct timing_generator *optc,
+		    uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb)
+{
+	uint32_t field = 0;
+	struct optc *optc1 = DCN10TG_FROM_TG(optc);
+
+	REG_GET(OTG_CRC_CNTL, OTG_CRC_EN, &field);
+
+	/* Early return if CRC is not enabled for this CRTC */
+	if (!field)
+		return false;
+
+	REG_GET_2(OTG_CRC0_DATA_RG,
+			CRC0_R_CR, r_cr,
+			CRC0_G_Y, g_y);
+
+	REG_GET(OTG_CRC0_DATA_B,
+			CRC0_B_CB, b_cb);
+
+	return true;
+}
+
 static const struct timing_generator_funcs dcn10_tg_funcs = {
 		.validate_timing = optc1_validate_timing,
 		.program_timing = optc1_program_timing,
@@ -1360,6 +1426,8 @@ static const struct timing_generator_funcs dcn10_tg_funcs = {
 		.is_tg_enabled = optc1_is_tg_enabled,
 		.is_optc_underflow_occurred = optc1_is_optc_underflow_occurred,
 		.clear_optc_underflow = optc1_clear_optc_underflow,
+		.get_crc = optc1_get_crc,
+		.configure_crc = optc1_configure_crc,
 };
 
 void dcn10_timing_generator_init(struct optc *optc1)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +46 -3

73 lines not on this page · raw message

Signature · 6 lines
2.17.1

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

PATCH 47/54 drm/amd/display: Expose couple OPTC functions through header

In reply to a message not in the archive

From: David Francis <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +11 -0
index 1df510f57377..c1b114209fe8 100644
@@ -554,4 +554,15 @@ bool optc1_get_otg_active_size(struct timing_generator *optc,
 		uint32_t *otg_active_width,
 		uint32_t *otg_active_height);
 
+void optc1_enable_crtc_reset(
+		struct timing_generator *optc,
+		int source_tg_inst,
+		struct crtc_trigger_info *crtc_tp);
+
+bool optc1_configure_crc(struct timing_generator *optc,
+			  const struct crc_params *params);
+
+bool optc1_get_crc(struct timing_generator *optc,
+		    uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb);
+
 #endif /* __DC_TIMING_GENERATOR_DCN10_H__ */
Signature · 6 lines
2.17.1

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

PATCH 48/54 drm/amd/display: dp dbeugfs allow link rate lane count greater than dp rx reported caps

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

[Why]
when hw team does phy parameters tuning, there is need to force dp link rate or lane count grater than the values from dp receiver to check dp tx. current debufs limit link rate, lane count no more than rx caps.

[How] remove force settings less than rx caps check

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1 -2
index 0276e09d0b82..0d9e410ca01e 100644
@@ -214,8 +214,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 		break;
 	}
 
-	if (!valid_input || (param[0] > link->reported_link_cap.lane_count) ||
-			(param[1] > link->reported_link_cap.link_rate)) {
+	if (!valid_input) {
 		kfree(wr_buf);
 		DRM_DEBUG_DRIVER("Invalid Input value No HW will be programmed\n");
 		return bytes_from_user;
Signature · 6 lines
2.17.1

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

#61 lore raw

Re: [PATCH 48/54] drm/amd/display: dp dbeugfs allow link rate lane count greater than dp rx reported caps

typo in subject.

Quoted 34 lines · Harry Wentland

From: Hersen Wu <[email protected]>

[Why]
when hw team does phy parameters tuning, there is need to force dp link rate or lane count grater than the values from dp receiver to check dp tx. current debufs limit link rate, lane count no more than rx caps.

[How] remove force settings less than rx caps check

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1 -3
index 0276e09d0b82..0d9e410ca01e 100644
@@ -214,8 +214,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
                break;
        }
 
-       if (!valid_input || (param[0] > link->reported_link_cap.lane_count) ||
-                       (param[1] > link->reported_link_cap.link_rate)) {
+       if (!valid_input) {
                kfree(wr_buf);
                DRM_DEBUG_DRIVER("Invalid Input value No HW will be programmed\n");
                return bytes_from_user;
--

2.17.1

Quoted 4 lines

_______________________________________________
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

#62 lore raw

PATCH v2 1/1 drm/amd/display: dp debugfs allow link rate lane count greater than dp rx reported caps

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

[Why]
when hw team does phy parameters tuning, there is need to force dp link rate or lane count grater than the values from dp receiver to check dp tx. current debufs limit link rate, lane count no more than rx caps.

[How] remove force settings less than rx caps check

v2: Fix typo in title

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1 -2
index 0276e09d0b82..0d9e410ca01e 100644
@@ -214,8 +214,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
 		break;
 	}
 
-	if (!valid_input || (param[0] > link->reported_link_cap.lane_count) ||
-			(param[1] > link->reported_link_cap.link_rate)) {
+	if (!valid_input) {
 		kfree(wr_buf);
 		DRM_DEBUG_DRIVER("Invalid Input value No HW will be programmed\n");
 		return bytes_from_user;
Signature · 6 lines
2.17.1

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

PATCH 49/54 drm/amd/display: Fix new stream count check in dc_add_stream_to_ctx

In reply to a message not in the archive

From: Ken Chalmers <[email protected]>

[Why]
The previous code could allow through attempts to enable more streams than there are timing generators, in designs where the number of pipes is greater than the number of timing generators.

[How]
Compare the new stream count to the resource pool's timing generator count, instead of its pipe count. Also correct a typo in the error message.

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -2
index cacf59d0a1d6..89478e85d6d1 100644
@@ -1724,8 +1724,8 @@ enum dc_status dc_add_stream_to_ctx(
 	struct dc_context *dc_ctx = dc->ctx;
 	enum dc_status res;
 
-	if (new_ctx->stream_count >= dc->res_pool->pipe_count) {
-		DC_ERROR("Max streams reached, can add stream %p !\n", stream);
+	if (new_ctx->stream_count >= dc->res_pool->timing_generator_count) {
+		DC_ERROR("Max streams reached, can't add stream %p !\n", stream);
 		return DC_ERROR_UNEXPECTED;
 	}
 
Signature · 6 lines
2.17.1

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

PATCH 50/54 drm/amd/display: add max scl ratio to soc bounding box

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +2 -0
index 6943801c5fd3..c43d68bc9d5c 100644
@@ -111,6 +111,8 @@ struct _vcs_dpi_soc_bounding_box_st {
 	double xfc_bus_transport_time_us;
 	double xfc_xbuf_latency_tolerance_us;
 	int use_urgent_burst_bw;
+	double max_hscl_ratio;
+	double max_vscl_ratio;
 	struct _vcs_dpi_voltage_scaling_st clock_limits[7];
 };
 
Signature · 6 lines
2.17.1

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

PATCH 51/54 drm/amd/display: update dml to match DV dml

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

DV updated their dml with an option to use max vstartup, this updates dc dml with the same option

---
 drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +1 -0
index c43d68bc9d5c..cbafce649e33 100644
@@ -305,6 +305,7 @@ struct _vcs_dpi_display_pipe_dest_params_st {
 	unsigned char otg_inst;
 	unsigned char odm_split_cnt;
 	unsigned char odm_combine;
+	unsigned char use_maximum_vstartup;
 };
 
 struct _vcs_dpi_display_pipe_params_st {
Signature · 6 lines
2.17.1

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

PATCH 52/54 drm/amd/display: dal 3.1.55

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 721c5cdff38f..208578301d59 100644
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-#define DC_VER "3.1.54"
+#define DC_VER "3.1.55"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
Signature · 6 lines
2.17.1

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

PATCH 53/54 drm/amd/display: Initialize data structure for DalMpVisualConfirm.

In reply to a message not in the archive

From: Hugo Hu <[email protected]>

[Why] Prevent unexpected color shows if DalMpVisualConfirm enable. [How] Zero out color configuration data for DalMpVisualConfirm when initiating.

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
index 06cf967b2431..5b99a83a74f1 100644
@@ -1866,7 +1866,7 @@ static void update_dpp(struct dpp *dpp, struct dc_plane_state *plane_state)
 static void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
 {
 	struct hubp *hubp = pipe_ctx->plane_res.hubp;
-	struct mpcc_blnd_cfg blnd_cfg;
+	struct mpcc_blnd_cfg blnd_cfg = {0};
 	bool per_pixel_alpha = pipe_ctx->plane_state->per_pixel_alpha && pipe_ctx->bottom_pipe;
 	int mpcc_id;
 	struct mpcc *new_mpcc;
Signature · 6 lines
2.17.1

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

PATCH 54/54 drm/amd/display: properly turn autocal off

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

[why]
Currently we do not turn off autocal when scaling is in bypass. In case vbios enalbes auto scale and our first mode set is a non-scaled mode we have autocal on causing screen corruption.

[how]
moves turning autocal off to be first thing done during scaler setup

---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +6 -6
index f862fd148cca..f0cc97518c49 100644
@@ -655,6 +655,12 @@ void dpp1_dscl_set_scaler_manual_scale(
 
 	dpp->scl_data = *scl_data;
 
+	/* Autocal off */
+	REG_SET_3(DSCL_AUTOCAL, 0,
+		AUTOCAL_MODE, AUTOCAL_MODE_OFF,
+		AUTOCAL_NUM_PIPE, 0,
+		AUTOCAL_PIPE_ID, 0);
+
 	/* Recout */
 	dpp1_dscl_set_recout(dpp, &scl_data->recout);
 
@@ -678,12 +684,6 @@ void dpp1_dscl_set_scaler_manual_scale(
 	if (dscl_mode == DSCL_MODE_SCALING_444_BYPASS)
 		return;
 
-	/* Autocal off */
-	REG_SET_3(DSCL_AUTOCAL, 0,
-		AUTOCAL_MODE, AUTOCAL_MODE_OFF,
-		AUTOCAL_NUM_PIPE, 0,
-		AUTOCAL_PIPE_ID, 0);
-
 	/* Black offsets */
 	if (ycbcr)
 		REG_SET_2(SCL_BLACK_OFFSET, 0,
Signature · 6 lines
2.17.1

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