Skip to contentSkip to conversation

DC Patches May 31, 2018

PATCH New Harry Wentland 3 participants 20 messages May 31, 2018 2 messages not in the archive

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

cover DC Patches May 31, 2018

* Fix underscan validation in atomic_check (David)
* Fix BUG_ON during CRTC atomic check update (Leo)
* Apply color properties after DPMS changes (Leo)
* Bunch of DP CTS fixes (Mikita)

Alex, can you pull the following into 4.17 fixes?
drm/amd/display: Make atomic-check validate underscan changes drm/amd/display: Fix BUG_ON during CRTC atomic check update drm/amd/display: Update color props when modeset is required

Alvin lee (1):
drm/amd/display: create sink_id in dc_sink structure to idenitify all
sinks

Anthony Koo (1):
drm/amd/display: Disable stats by default

David Francis (1):
drm/amd/display: Make atomic-check validate underscan changes

Eric Bernstein (3):
drm/amd/display: Stream encoder update drm/amd/display: Allow DP register double buffer drm/amd/display: Add num_opp to resource_caps

Harry Wentland (1):
drm/amd/display: Move i2c and aux structs into dc_ddc_types.h

Krunoslav Kovac (4):
drm/amd/display: Add use_dynamic_meta flag to stream_state drm/amd/display: Drop duplicate dc_stream_set_static_screen_events
definition
drm/amd/display: Make it more clear when info frames affect DP or HDMI drm/amd/display: Convert quotes to Ascii quotes

Leo (Sunpeng) Li (2):
drm/amd/display: Fix BUG_ON during CRTC atomic check update drm/amd/display: Update color props when modeset is required

Mikita Lipski (3):
drm/amd/display: Drop to fail-safe mode if edid is bad drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests drm/amd/display: Do not skip FBC init in failsafe mode

SivapiriyanKumarasamy (1):
drm/amd/display: Program vline interrupt on FAST update

Vitaly Prosyak (1):
drm/amd/display: Add new transfer type HWPWL

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 55 +++++++++-----
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 28 +++++++
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 14 ++--
 .../gpu/drm/amd/display/dc/core/dc_resource.c |  3 +-
 drivers/gpu/drm/amd/display/dc/core/dc_sink.c |  4 +
 drivers/gpu/drm/amd/display/dc/dc.h           | 12 ++-
 drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 59 ++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc_dp_types.h  |  5 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |  6 +-
 drivers/gpu/drm/amd/display/dc/dc_types.h     |  1 +
 .../amd/display/dc/dce/dce_stream_encoder.c   |  5 --
 .../display/dc/dce110/dce110_hw_sequencer.c   | 13 +++-
 .../drm/amd/display/dc/dcn10/dcn10_resource.c |  1 +
 .../display/dc/dcn10/dcn10_stream_encoder.c   | 76 +++++--------------
 .../drm/amd/display/dc/i2caux/aux_engine.h    | 44 +----------
 .../gpu/drm/amd/display/dc/i2caux/engine.h    | 15 +---
 drivers/gpu/drm/amd/display/dc/inc/resource.h |  1 +
 .../gpu/drm/amd/display/modules/stats/stats.c |  2 +-
 18 files changed, 191 insertions(+), 153 deletions(-)
Signature · 6 lines
2.17.0

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

PATCH 1/18 drm/amd/display: Drop to fail-safe mode if edid is bad

In reply to a message not in the archive

From: Mikita Lipski <[email protected]>

Provide the connector with a single fail-safe mode of 640x480 for CTS tests instead of providing a list of possible base modes.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
index 21f3ad1d66cb..07f4793a945f 100644
@@ -3496,6 +3496,10 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
 	struct edid *edid = amdgpu_dm_connector->edid;
 
 	encoder = helper->best_encoder(connector);
+
+	if (!edid || !drm_edid_is_valid(edid))
+		return drm_add_modes_noedid(connector, 640, 480);
+
 	amdgpu_dm_connector_ddc_get_modes(connector, edid);
 	amdgpu_dm_connector_add_common_modes(encoder, connector);
 
Signature · 6 lines
2.17.0

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

PATCH 2/18 drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests

In reply to a message not in the archive

From: Mikita Lipski <[email protected]>

Extract edid's checksum and send it back for verification if EDID_TEST is requested.

Also added a flag for EDID checksum write in TEST_RESPONSE structure, and simple spelling fix.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 28 +++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc_dp_types.h  |  5 ++--
 2 files changed, 31 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +28 -0
index bd449351803f..dea49dc9b518 100644
@@ -497,6 +497,34 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		DRM_ERROR("EDID err: %d, on connector: %s",
 				edid_status,
 				aconnector->base.name);
+	if (link->aux_mode) {
+		union test_request test_request = {0};
+		union test_response test_response = {0};
+
+		dm_helpers_dp_read_dpcd(ctx,
+					link,
+					DP_TEST_REQUEST,
+					&test_request.raw,
+					sizeof(union test_request));
+
+		if (!test_request.bits.EDID_READ)
+			return edid_status;
+
+		test_response.bits.EDID_CHECKSUM_WRITE = 1;
+
+		dm_helpers_dp_write_dpcd(ctx,
+					link,
+					DP_TEST_EDID_CHECKSUM,
+					&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
+					1);
+
+		dm_helpers_dp_write_dpcd(ctx,
+					link,
+					DP_TEST_RESPONSE,
+					&test_response.raw,
+					sizeof(test_response));
+
+	}
 
 	return edid_status;
 }
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +3 -2
index 90bccd5ccaa2..da93ab43f2d8 100644
@@ -430,7 +430,7 @@ union test_request {
 	struct {
 	uint8_t LINK_TRAINING         :1;
 	uint8_t LINK_TEST_PATTRN      :1;
-	uint8_t EDID_REAT             :1;
+	uint8_t EDID_READ             :1;
 	uint8_t PHY_TEST_PATTERN      :1;
 	uint8_t AUDIO_TEST_PATTERN    :1;
 	uint8_t RESERVED              :1;
@@ -443,7 +443,8 @@ union test_response {
 	struct {
 		uint8_t ACK         :1;
 		uint8_t NO_ACK      :1;
-		uint8_t RESERVED    :6;
+		uint8_t EDID_CHECKSUM_WRITE:1;
+		uint8_t RESERVED    :5;
 	} bits;
 	uint8_t raw;
 };
Signature · 6 lines
2.17.0

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

PATCH 3/18 drm/amd/display: Make atomic-check validate underscan changes

In reply to a message not in the archive

From: David Francis <[email protected]>

When the underscan state was changed, atomic-check was triggering a validation but passing the old underscan values. This change adds a somewhat hacky check in dm_update_crtcs_state that will update the stream if old and newunderscan values are different.
This was causing 4k on Fiji to allow underscan when it wasn't permitted.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +++++++++++++------
 1 file changed, 18 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +18 -8
index 07f4793a945f..e7ecddf359da 100644
@@ -4679,8 +4679,8 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
 		struct amdgpu_crtc *acrtc = NULL;
 		struct amdgpu_dm_connector *aconnector = NULL;
-		struct drm_connector_state *new_con_state = NULL;
-		struct dm_connector_state *dm_conn_state = NULL;
+		struct drm_connector_state *drm_new_conn_state = NULL, *drm_old_conn_state = NULL;
+		struct dm_connector_state *dm_new_conn_state = NULL, *dm_old_conn_state = NULL;
 		struct drm_plane_state *new_plane_state = NULL;
 
 		new_stream = NULL;
@@ -4701,19 +4701,24 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 		/* TODO This hack should go away */
 		if (aconnector && enable) {
 			// Make sure fake sink is created in plug-in scenario
-			new_con_state = drm_atomic_get_connector_state(state,
+			drm_new_conn_state = drm_atomic_get_new_connector_state(state,
 								    &aconnector->base);
+			drm_old_conn_state = drm_atomic_get_old_connector_state(state,
+								    &aconnector->base);
+
 
-			if (IS_ERR(new_con_state)) {
-				ret = PTR_ERR_OR_ZERO(new_con_state);
+
+			if (IS_ERR(drm_new_conn_state)) {
+				ret = PTR_ERR_OR_ZERO(drm_new_conn_state);
 				break;
 			}
 
-			dm_conn_state = to_dm_connector_state(new_con_state);
+			dm_new_conn_state = to_dm_connector_state(drm_new_conn_state);
+			dm_old_conn_state = to_dm_connector_state(drm_old_conn_state);
 
 			new_stream = create_stream_for_sink(aconnector,
 							     &new_crtc_state->mode,
-							    dm_conn_state);
+							    dm_new_conn_state);
 
 			/*
 			 * we can have no stream on ACTION_SET if a display
@@ -4729,7 +4734,7 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 			}
 
 			set_freesync_on_stream(dm, dm_new_crtc_state,
-					       dm_conn_state, new_stream);
+					dm_new_conn_state, new_stream);
 
 			if (dc_is_stream_unchanged(new_stream, dm_old_crtc_state->stream) &&
 			    dc_is_stream_scaling_unchanged(new_stream, dm_old_crtc_state->stream)) {
@@ -4837,6 +4842,11 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 		 */
 		BUG_ON(dm_new_crtc_state->stream == NULL);
 
+		/* Scaling or underscan settings */
+		if (is_scaling_state_different(dm_old_conn_state, dm_new_conn_state))
+			update_stream_scaling_settings(
+				&new_crtc_state->mode, dm_new_conn_state, dm_new_crtc_state->stream);
+
 		/* Color managment settings */
 		if (dm_new_crtc_state->base.color_mgmt_changed) {
 			ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state);
Signature · 6 lines
2.17.0

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

PATCH 4/18 drm/amd/display: Program vline interrupt on FAST update

In reply to a message not in the archive

From: SivapiriyanKumarasamy <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -6
index c88f6612bfb6..d7307b38c0a8 100644
@@ -1290,6 +1290,13 @@ static void commit_planes_do_stream_update(struct dc *dc,
 					stream_update->adjust->v_total_min,
 					stream_update->adjust->v_total_max);
 
+			if (stream_update->periodic_fn_vsync_delta &&
+					pipe_ctx->stream_res.tg &&
+					pipe_ctx->stream_res.tg->funcs->program_vline_interrupt)
+				pipe_ctx->stream_res.tg->funcs->program_vline_interrupt(
+					pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing,
+					pipe_ctx->stream->periodic_fn_vsync_delta);
+
 			/* Full fe update*/
 			if (update_type == UPDATE_TYPE_FAST)
 				continue;
@@ -1317,12 +1324,6 @@ static void commit_planes_do_stream_update(struct dc *dc,
 						pipe_ctx->stream_res.abm, stream->abm_level);
 			}
 
-			if (stream_update->periodic_fn_vsync_delta &&
-				pipe_ctx->stream_res.tg->funcs->program_vline_interrupt)
-					pipe_ctx->stream_res.tg->funcs->program_vline_interrupt(
-						pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing,
-						pipe_ctx->stream->periodic_fn_vsync_delta);
-
 			if (stream_update->hdr_static_metadata ||
 				stream_update->vrr_infopacket) {
 				resource_build_info_frame(pipe_ctx);
Signature · 6 lines
2.17.0

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

PATCH 5/18 drm/amd/display: Fix BUG_ON during CRTC atomic check update

In reply to a message not in the archive

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

For cases where the CRTC is inactive (DPMS off), where a modeset is not required, yet the CRTC is still in the atomic state, we should not attempt to update anything on it.

Previously, we were relying on the modereset_required() helper to check the above condition. However, the function returns false immediatly if a modeset is not required, ignoring the CRTC's enable/active state flags. The correct way to filter is by looking at these flags instead.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -6
index e7ecddf359da..b6020a83cdb0 100644
@@ -4830,15 +4830,16 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 		 * We want to do dc stream updates that do not require a
 		 * full modeset below.
 		 */
-		if (!enable || !aconnector || modereset_required(new_crtc_state))
+		if (!(enable && aconnector && new_crtc_state->enable &&
+		      new_crtc_state->active))
 			continue;
 		/*
 		 * Given above conditions, the dc state cannot be NULL because:
-		 * 1. We're attempting to enable a CRTC. Which has a...
-		 * 2. Valid connector attached, and
-		 * 3. User does not want to reset it (disable or mark inactive,
-		 *    which can happen on a CRTC that's already disabled).
-		 * => It currently exists.
+		 * 1. We're in the process of enabling CRTCs (just been added
+		 *    to the dc context, or already is on the context)
+		 * 2. Has a valid connector attached, and
+		 * 3. Is currently active and enabled.
+		 * => The dc stream state currently exists.
 		 */
 		BUG_ON(dm_new_crtc_state->stream == NULL);
 
Signature · 6 lines
2.17.0

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

PATCH 6/18 drm/amd/display: Stream encoder update

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

Update stream encoder based on feedback from HW team.

---
 .../display/dc/dcn10/dcn10_stream_encoder.c   | 30 +------------------
 1 file changed, 1 insertion(+), 29 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +1 -29
index 147f61416fa5..32a4997714c1 100644
@@ -1097,27 +1097,6 @@ static union audio_cea_channels speakers_to_channels(
 	return cea_channels;
 }
 
-static uint32_t calc_max_audio_packets_per_line(
-	const struct audio_crtc_info *crtc_info)
-{
-	uint32_t max_packets_per_line;
-
-	max_packets_per_line =
-		crtc_info->h_total - crtc_info->h_active;
-
-	if (crtc_info->pixel_repetition)
-		max_packets_per_line *= crtc_info->pixel_repetition;
-
-	/* for other hdmi features */
-	max_packets_per_line -= 58;
-	/* for Control Period */
-	max_packets_per_line -= 16;
-	/* Number of Audio Packets per Line */
-	max_packets_per_line /= 32;
-
-	return max_packets_per_line;
-}
-
 static void get_audio_clock_info(
 	enum dc_color_depth color_depth,
 	uint32_t crtc_pixel_clock_in_khz,
@@ -1211,16 +1190,9 @@ static void enc1_se_setup_hdmi_audio(
 	struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
 
 	struct audio_clock_info audio_clock_info = {0};
-	uint32_t max_packets_per_line;
-
-	/* For now still do calculation, although this field is ignored when
-	 * above HDMI_PACKET_GEN_VERSION set to 1
-	 */
-	max_packets_per_line = calc_max_audio_packets_per_line(crtc_info);
 
 	/* HDMI_AUDIO_PACKET_CONTROL */
-	REG_UPDATE_2(HDMI_AUDIO_PACKET_CONTROL,
-			HDMI_AUDIO_PACKETS_PER_LINE, max_packets_per_line,
+	REG_UPDATE(HDMI_AUDIO_PACKET_CONTROL,
 			HDMI_AUDIO_DELAY_EN, 1);
 
 	/* AFMT_AUDIO_PACKET_CONTROL */
Signature · 6 lines
2.17.0

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

PATCH 7/18 drm/amd/display: Move i2c and aux structs into dc_ddc_types.h

In reply to a message not in the archive

We'd like to use some of them in dc_link_ddc and amdgpu_dm and should have them available in dc_ddc_types.h.

---
 drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 59 +++++++++++++++++++
 .../drm/amd/display/dc/i2caux/aux_engine.h    | 44 +-------------
 .../gpu/drm/amd/display/dc/i2caux/engine.h    | 15 +----
 3 files changed, 62 insertions(+), 56 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_ddc_types.h +59 -0
index ee04812b4492..05c8c31d8b31 100644
@@ -25,6 +25,65 @@
 #ifndef DC_DDC_TYPES_H_
 #define DC_DDC_TYPES_H_
 
+enum aux_transaction_type {
+	AUX_TRANSACTION_TYPE_DP,
+	AUX_TRANSACTION_TYPE_I2C
+};
+
+
+enum i2caux_transaction_action {
+	I2CAUX_TRANSACTION_ACTION_I2C_WRITE = 0x00,
+	I2CAUX_TRANSACTION_ACTION_I2C_READ = 0x10,
+	I2CAUX_TRANSACTION_ACTION_I2C_STATUS_REQUEST = 0x20,
+
+	I2CAUX_TRANSACTION_ACTION_I2C_WRITE_MOT = 0x40,
+	I2CAUX_TRANSACTION_ACTION_I2C_READ_MOT = 0x50,
+	I2CAUX_TRANSACTION_ACTION_I2C_STATUS_REQUEST_MOT = 0x60,
+
+	I2CAUX_TRANSACTION_ACTION_DP_WRITE = 0x80,
+	I2CAUX_TRANSACTION_ACTION_DP_READ = 0x90
+};
+
+enum aux_channel_operation_result {
+	AUX_CHANNEL_OPERATION_SUCCEEDED,
+	AUX_CHANNEL_OPERATION_FAILED_REASON_UNKNOWN,
+	AUX_CHANNEL_OPERATION_FAILED_INVALID_REPLY,
+	AUX_CHANNEL_OPERATION_FAILED_TIMEOUT,
+	AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON
+};
+
+
+struct aux_request_transaction_data {
+	enum aux_transaction_type type;
+	enum i2caux_transaction_action action;
+	/* 20-bit AUX channel transaction address */
+	uint32_t address;
+	/* delay, in 100-microsecond units */
+	uint8_t delay;
+	uint32_t length;
+	uint8_t *data;
+};
+
+enum aux_transaction_reply {
+	AUX_TRANSACTION_REPLY_AUX_ACK = 0x00,
+	AUX_TRANSACTION_REPLY_AUX_NACK = 0x01,
+	AUX_TRANSACTION_REPLY_AUX_DEFER = 0x02,
+
+	AUX_TRANSACTION_REPLY_I2C_ACK = 0x00,
+	AUX_TRANSACTION_REPLY_I2C_NACK = 0x10,
+	AUX_TRANSACTION_REPLY_I2C_DEFER = 0x20,
+
+	AUX_TRANSACTION_REPLY_HPD_DISCON = 0x40,
+
+	AUX_TRANSACTION_REPLY_INVALID = 0xFF
+};
+
+struct aux_reply_transaction_data {
+	enum aux_transaction_reply status;
+	uint32_t length;
+	uint8_t *data;
+};
+
 struct i2c_payload {
 	bool write;
 	uint8_t address;
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h +1 -43

50 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/i2caux/engine.h +2 -13
index c1109706a880..1e8a1585e401 100644
@@ -26,6 +26,8 @@
 #ifndef __DAL_ENGINE_H__
 #define __DAL_ENGINE_H__
 
+#include "dc_ddc_types.h"
+
 enum i2caux_transaction_operation {
 	I2CAUX_TRANSACTION_READ,
 	I2CAUX_TRANSACTION_WRITE
@@ -76,19 +78,6 @@ enum i2c_default_speed {
 	I2CAUX_DEFAULT_I2C_SW_SPEED = 50
 };
 
-enum i2caux_transaction_action {
-	I2CAUX_TRANSACTION_ACTION_I2C_WRITE = 0x00,
-	I2CAUX_TRANSACTION_ACTION_I2C_READ = 0x10,
-	I2CAUX_TRANSACTION_ACTION_I2C_STATUS_REQUEST = 0x20,
-
-	I2CAUX_TRANSACTION_ACTION_I2C_WRITE_MOT = 0x40,
-	I2CAUX_TRANSACTION_ACTION_I2C_READ_MOT = 0x50,
-	I2CAUX_TRANSACTION_ACTION_I2C_STATUS_REQUEST_MOT = 0x60,
-
-	I2CAUX_TRANSACTION_ACTION_DP_WRITE = 0x80,
-	I2CAUX_TRANSACTION_ACTION_DP_READ = 0x90
-};
-
 struct engine;
 
 struct engine_funcs {
Signature · 6 lines
2.17.0

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

PATCH 8/18 drm/amd/display: Update color props when modeset is required

In reply to Harry Wentland

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

This fixes issues where color management properties don't persist over DPMS on/off, or when the CRTC is moved across connectors.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -2
index b6020a83cdb0..29176d2c5d6e 100644
@@ -4848,8 +4848,12 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 			update_stream_scaling_settings(
 				&new_crtc_state->mode, dm_new_conn_state, dm_new_crtc_state->stream);
 
-		/* Color managment settings */
-		if (dm_new_crtc_state->base.color_mgmt_changed) {
+		/*
+		 * Color management settings. We also update color properties
+		 * when a modeset is needed, to ensure it gets reprogrammed.
+		 */
+		if (dm_new_crtc_state->base.color_mgmt_changed ||
+		    drm_atomic_crtc_needs_modeset(new_crtc_state)) {
 			ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state);
 			if (ret)
 				goto fail;
Signature · 1 line
2.17.0
#11 lore raw

PATCH 9/18 drm/amd/display: Add use_dynamic_meta flag to stream_state

In reply to a message not in the archive

From: Krunoslav Kovac <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dc_stream.h        | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -1
index 05b7ee82c285..45f9ecbb3d47 100644
@@ -2403,7 +2403,8 @@ static void set_hdr_static_info_packet(
 {
 	/* HDR Static Metadata info packet for HDR10 */
 
-	if (!stream->hdr_static_metadata.valid)
+	if (!stream->hdr_static_metadata.valid ||
+			stream->use_dynamic_meta)
 		return;
 
 	*info_packet = stream->hdr_static_metadata;
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
index aea4d0b59793..fe4dadd67804 100644
@@ -66,6 +66,7 @@ struct dc_stream_state {
 
 	struct dc_info_packet hdr_static_metadata;
 	PHYSICAL_ADDRESS_LOC dmdata_address;
+	bool   use_dynamic_meta;
 
 	struct dc_transfer_func *out_transfer_func;
 	struct colorspace_transform gamut_remap_matrix;
Signature · 6 lines
2.17.0

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

PATCH 10/18 drm/amd/display: Drop duplicate dc_stream_set_static_screen_events definition

In reply to a message not in the archive

From: Krunoslav Kovac <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc_stream.h | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_stream.h +0 -5
index fe4dadd67804..584c56b94937 100644
@@ -303,9 +303,4 @@ bool dc_stream_get_crtc_position(struct dc *dc,
 				 unsigned int *v_pos,
 				 unsigned int *nom_v_pos);
 
-void dc_stream_set_static_screen_events(struct dc *dc,
-					struct dc_stream_state **stream,
-					int num_streams,
-					const struct dc_static_screen_events *events);
-
 #endif /* DC_STREAM_H_ */
Signature · 6 lines
2.17.0

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

PATCH 11/18 drm/amd/display: Make it more clear when info frames affect DP or HDMI

In reply to a message not in the archive

From: Krunoslav Kovac <[email protected]>

---
 .../drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +11 -2
index 59e2bbf4d676..9f3b969b5a0e 100644
@@ -667,16 +667,25 @@ static enum dc_status bios_parser_crtc_source_select(
 
 void dce110_update_info_frame(struct pipe_ctx *pipe_ctx)
 {
+	bool is_hdmi;
+	bool is_dp;
+
 	ASSERT(pipe_ctx->stream);
 
 	if (pipe_ctx->stream_res.stream_enc == NULL)
 		return;  /* this is not root pipe */
 
-	if (dc_is_hdmi_signal(pipe_ctx->stream->signal))
+	is_hdmi = dc_is_hdmi_signal(pipe_ctx->stream->signal);
+	is_dp = dc_is_dp_signal(pipe_ctx->stream->signal);
+
+	if (!is_hdmi && !is_dp)
+		return;
+
+	if (is_hdmi)
 		pipe_ctx->stream_res.stream_enc->funcs->update_hdmi_info_packets(
 			pipe_ctx->stream_res.stream_enc,
 			&pipe_ctx->stream_res.encoder_info_frame);
-	else if (dc_is_dp_signal(pipe_ctx->stream->signal))
+	else
 		pipe_ctx->stream_res.stream_enc->funcs->update_dp_info_packets(
 			pipe_ctx->stream_res.stream_enc,
 			&pipe_ctx->stream_res.encoder_info_frame);
Signature · 6 lines
2.17.0

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

PATCH 12/18 drm/amd/display: Convert quotes to Ascii quotes

In reply to a message not in the archive

From: Krunoslav Kovac <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +1 -1
index 32a4997714c1..c6a13d0486bb 100644
@@ -301,7 +301,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(
 	/* For YCbCr420 and BT2020 Colorimetry Formats, VSC SDP shall be used.
 	 * When MISC1, bit 6, is Set to 1, a Source device uses a VSC SDP to indicate the
 	 * Pixel Encoding/Colorimetry Format and that a Sink device shall ignore MISC1, bit 7,
-	 * and MISC0, bits 7:1 (MISC1, bit 7, and MISC0, bits 7:1, become “don’t care”).
+	 * and MISC0, bits 7:1 (MISC1, bit 7, and MISC0, bits 7:1, become "don't care").
 	 */
 	if ((crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) ||
 			(output_color_space == COLOR_SPACE_2020_YCBCR) ||
Signature · 6 lines
2.17.0

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

PATCH 13/18 drm/amd/display: Disable stats by default

In reply to a message not in the archive

From: Anthony Koo <[email protected]>

---
 drivers/gpu/drm/amd/display/modules/stats/stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/stats/stats.c +1 -1
index fa0665d09075..480eb2cdd55d 100644
@@ -29,7 +29,7 @@
 #include "core_types.h"
 
 #define DAL_STATS_ENABLE_REGKEY			"DalStatsEnable"
-#define DAL_STATS_ENABLE_REGKEY_DEFAULT		0x00000001
+#define DAL_STATS_ENABLE_REGKEY_DEFAULT		0x00000000
 #define DAL_STATS_ENABLE_REGKEY_ENABLED		0x00000001
 
 #define DAL_STATS_ENTRIES_REGKEY		"DalStatsEntries"
Signature · 6 lines
2.17.0

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

PATCH 14/18 drm/amd/display: Add new transfer type HWPWL

In reply to a message not in the archive

From: Vitaly Prosyak <[email protected]>

It is used when curve register settings are generated by 'matlab', i.e. bypass color module calculation.

---
 drivers/gpu/drm/amd/display/dc/dc.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +5 -1
index be0dee18e09f..94ac1248cfd7 100644
@@ -359,6 +359,7 @@ enum dc_transfer_func_type {
 	TF_TYPE_PREDEFINED,
 	TF_TYPE_DISTRIBUTED_POINTS,
 	TF_TYPE_BYPASS,
+	TF_TYPE_HWPWL
 };
 
 struct dc_transfer_func_distributed_points {
@@ -384,12 +385,15 @@ enum dc_transfer_func_predefined {
 
 struct dc_transfer_func {
 	struct kref refcount;
-	struct dc_transfer_func_distributed_points tf_pts;
 	enum dc_transfer_func_type type;
 	enum dc_transfer_func_predefined tf;
 	/* FP16 1.0 reference level in nits, default is 80 nits, only for PQ*/
 	uint32_t sdr_ref_white_level;
 	struct dc_context *ctx;
+	union {
+		struct pwl_params pwl;
+		struct dc_transfer_func_distributed_points tf_pts;
+	};
 };
 
 /*
Signature · 6 lines
2.17.0

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

PATCH 15/18 drm/amd/display: create sink_id in dc_sink structure to idenitify all sinks

In reply to a message not in the archive

From: Alvin lee <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 1 +
 drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 4 ++++
 drivers/gpu/drm/amd/display/dc/dc.h           | 6 +++++-
 drivers/gpu/drm/amd/display/dc/dc_types.h     | 1 +
 4 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
index d7307b38c0a8..858249ee0a43 100644
@@ -479,6 +479,7 @@ static bool construct(struct dc *dc,
 	dc_ctx->driver_context = init_params->driver;
 	dc_ctx->dc = dc;
 	dc_ctx->asic_id = init_params->asic_id;
+	dc_ctx->dc_sink_id_count = 0;
 	dc->ctx = dc_ctx;
 
 	dc->current_state = dc_create_state();
drivers/gpu/drm/amd/display/dc/core/dc_sink.c +4 -0
index 25fae38409ab..9971b515c3eb 100644
@@ -53,6 +53,10 @@ static bool construct(struct dc_sink *sink, const struct dc_sink_init_data *init
 	sink->dongle_max_pix_clk = init_params->dongle_max_pix_clk;
 	sink->converter_disable_audio = init_params->converter_disable_audio;
 	sink->dc_container_id = NULL;
+	sink->sink_id = init_params->link->ctx->dc_sink_id_count;
+	// increment dc_sink_id_count because we don't want two sinks with same ID
+	// unless they are actually the same
+	init_params->link->ctx->dc_sink_id_count++;
 
 	return true;
 }
drivers/gpu/drm/amd/display/dc/dc.h +5 -1
index 94ac1248cfd7..2c4784843d4f 100644
@@ -668,9 +668,13 @@ struct dc_sink {
 	struct dc_link *link;
 	struct dc_context *ctx;
 
+	uint32_t sink_id;
+
 	/* private to dc_sink.c */
+	// refcount must be the last member in dc_sink, since we want the
+	// sink structure to be logically cloneable up to (but not including)
+	// refcount
 	struct kref refcount;
-
 };
 
 void dc_sink_retain(struct dc_sink *sink);
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
index f463d3a8ef62..227cb72481b0 100644
@@ -92,6 +92,7 @@ struct dc_context {
 	bool created_bios;
 	struct gpio_service *gpio_service;
 	struct i2caux *i2caux;
+	uint32_t dc_sink_id_count;
 #if defined(CONFIG_DRM_AMD_DC_FBC)
 	uint64_t fbc_gpu_addr;
 #endif
Signature · 6 lines
2.17.0

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

PATCH 16/18 drm/amd/display: Allow DP register double buffer

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

Remove setting DP_DB_DISABLE to avoid issues when changing bit depth after vbios take over.
Refactor code to perform single register update for both pixel encoding and component depth fields.

---
 .../amd/display/dc/dce/dce_stream_encoder.c   |  5 ---
 .../display/dc/dcn10/dcn10_stream_encoder.c   | 44 ++++++++-----------
 2 files changed, 19 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +0 -5
index c0e813c7ddd4..91642e684858 100644
@@ -289,11 +289,6 @@ static void dce110_stream_encoder_dp_set_stream_attribute(
 
 	struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc);
 
-#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
-	if (REG(DP_DB_CNTL))
-		REG_UPDATE(DP_DB_CNTL, DP_DB_DISABLE, 1);
-#endif
-
 	/* set pixel encoding */
 	switch (crtc_timing->pixel_encoding) {
 	case PIXEL_ENCODING_YCBCR422:
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +19 -25

92 lines not on this page · raw message

Signature · 6 lines
2.17.0

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

PATCH 17/18 drm/amd/display: Add num_opp to resource_caps

In reply to a message not in the archive

From: Eric Bernstein <[email protected]>

Number of OPPs to be instantiated is based on number of timing generators, not number of pipes.

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/inc/resource.h         | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
index 99c223bcad71..2da325ce781b 100644
@@ -417,6 +417,7 @@ static const struct dce110_clk_src_mask cs_mask = {
 
 static const struct resource_caps res_cap = {
 		.num_timing_generator = 4,
+		.num_opp = 4,
 		.num_video_plane = 4,
 		.num_audio = 4,
 		.num_stream_encoder = 4,
drivers/gpu/drm/amd/display/dc/inc/resource.h +1 -0
index 640a647f4611..e92facbd038f 100644
@@ -38,6 +38,7 @@ enum dce_version resource_parse_asic_id(
 
 struct resource_caps {
 	int num_timing_generator;
+	int num_opp;
 	int num_video_plane;
 	int num_audio;
 	int num_stream_encoder;
Signature · 6 lines
2.17.0

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

PATCH 18/18 drm/amd/display: Do not skip FBC init in failsafe mode

In reply to a message not in the archive

From: Mikita Lipski <[email protected]>

Initially FBC would be initialized if display's edid was correct and all the modes acquired from it, but n case when edid is corrupted or non-existant we must still initialize FBC.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -6
index 29176d2c5d6e..a35d2b224a9b 100644
@@ -3497,12 +3497,12 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
 
 	encoder = helper->best_encoder(connector);
 
-	if (!edid || !drm_edid_is_valid(edid))
-		return drm_add_modes_noedid(connector, 640, 480);
-
-	amdgpu_dm_connector_ddc_get_modes(connector, edid);
-	amdgpu_dm_connector_add_common_modes(encoder, connector);
-
+	if (!edid || !drm_edid_is_valid(edid)) {
+		drm_add_modes_noedid(connector, 640, 480);
+	} else {
+		amdgpu_dm_connector_ddc_get_modes(connector, edid);
+		amdgpu_dm_connector_add_common_modes(encoder, connector);
+	}
 #if defined(CONFIG_DRM_AMD_DC_FBC)
 	amdgpu_dm_fbc_init(connector);
 #endif
Signature · 6 lines
2.17.0

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

PATCH v2 1/1 drm/amd/display: Make atomic-check validate underscan changes

In reply to a message not in the archive

From: David Francis <[email protected]>

When the underscan state was changed, atomic-check was triggering a validation but passing the old underscan values. This change adds a somewhat hacky check in dm_update_crtcs_state that will update the stream if old and newunderscan values are different.
This was causing 4k on Fiji to allow underscan when it wasn't permitted.

---

v2: Make it apply cleanly on drm-fixes-4.17.

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +16 -7
index ad1ad33..1a7e96e 100644
@@ -4555,8 +4555,8 @@ static int dm_update_crtcs_state(struct dc *dc,
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
 		struct amdgpu_crtc *acrtc = NULL;
 		struct amdgpu_dm_connector *aconnector = NULL;
-		struct drm_connector_state *new_con_state = NULL;
-		struct dm_connector_state *dm_conn_state = NULL;
+		struct drm_connector_state *drm_new_conn_state = NULL, *drm_old_conn_state = NULL;
+		struct dm_connector_state *dm_new_conn_state = NULL, *dm_old_conn_state = NULL;
 		struct drm_plane_state *new_plane_state = NULL;
 
 		new_stream = NULL;
@@ -4577,19 +4577,23 @@ static int dm_update_crtcs_state(struct dc *dc,
 		/* TODO This hack should go away */
 		if (aconnector && enable) {
 			// Make sure fake sink is created in plug-in scenario
-			new_con_state = drm_atomic_get_connector_state(state,
+			drm_new_conn_state = drm_atomic_get_new_connector_state(state,
  								    &aconnector->base);
+			drm_old_conn_state = drm_atomic_get_old_connector_state(state,
+								    &aconnector->base);
 
-			if (IS_ERR(new_con_state)) {
-				ret = PTR_ERR_OR_ZERO(new_con_state);
+
+			if (IS_ERR(drm_new_conn_state)) {
+				ret = PTR_ERR_OR_ZERO(drm_new_conn_state);
 				break;
 			}
 
-			dm_conn_state = to_dm_connector_state(new_con_state);
+			dm_new_conn_state = to_dm_connector_state(drm_new_conn_state);
+			dm_old_conn_state = to_dm_connector_state(drm_old_conn_state);
 
 			new_stream = create_stream_for_sink(aconnector,
 							     &new_crtc_state->mode,
-							    dm_conn_state);
+							    dm_new_conn_state);
 
 			/*
 			 * we can have no stream on ACTION_SET if a display
@@ -4708,6 +4712,11 @@ static int dm_update_crtcs_state(struct dc *dc,
 		 */
 		BUG_ON(dm_new_crtc_state->stream == NULL);
 
+		/* Scaling or underscan settings */
+		if (is_scaling_state_different(dm_old_conn_state, dm_new_conn_state))
+			update_stream_scaling_settings(
+				&new_crtc_state->mode, dm_new_conn_state, dm_new_crtc_state->stream);
+
 		/* Color managment settings */
 		if (dm_new_crtc_state->base.color_mgmt_changed) {
 			ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state);
Signature · 6 lines
2.7.4

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