Skip to contentSkip to conversation

drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs

PATCH In review Imre Deak 5 participants 11 messages Feb 6, 2023 – Feb 14, 2023

Subsystems (8)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/4 drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs

Add the MST topology for a CRTC to the atomic state if the driver needs to force a modeset on the CRTC after the encoder compute config functions are called.

Later the MST encoder's disable hook also adds the state, but that isn't guaranteed to work (since in that hook getting the state may fail, which can't be handled there). This should fix that, while a later patch fixes the use of the MST state in the disable hook.

v2: Add missing forward struct declartions, caught by hdrtest.
v3: Factor out intel_dp_mst_add_topology_state_for_connector() used
later in the patchset.

---
 drivers/gpu/drm/i915/display/intel_display.c |  4 ++
 drivers/gpu/drm/i915/display/intel_dp_mst.c  | 61 ++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dp_mst.h  |  4 ++
 3 files changed, 69 insertions(+)
drivers/gpu/drm/i915/display/intel_display.c +4 -0
index 166662ade593c..38106cf63b3b9 100644
@@ -5936,6 +5936,10 @@ int intel_modeset_all_pipes(struct intel_atomic_state *state,
 		if (ret)
 			return ret;
 
+		ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc);
+		if (ret)
+			return ret;
+
 		ret = intel_atomic_add_affected_planes(state, crtc);
 		if (ret)
 			return ret;
drivers/gpu/drm/i915/display/intel_dp_mst.c +61 -0

64 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_dp_mst.h +4 -0
index f7301de6cdfb3..f1815bb722672 100644
@@ -8,6 +8,8 @@
 
 #include <linux/types.h>
 
+struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 struct intel_digital_port;
 struct intel_dp;
@@ -18,5 +20,7 @@ int intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port);
 bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_source_support(struct intel_dp *intel_dp);
+int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state,
+					     struct intel_crtc *crtc);
 
 #endif /* __INTEL_DP_MST_H__ */
Signature · 1 line
2.37.1
author
#1 lore raw

PATCH 2/4 drm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload()

Atm, drm_dp_remove_payload() uses the same payload state to both get the vc_start_slot required for the payload removal DPCD message and to deduct time_slots from vc_start_slot of all payloads after the one being removed.

The above isn't always correct, as vc_start_slot must be the up-to-date version contained in the new payload state, but time_slots must be the one used when the payload was previously added, contained in the old payload state. The new payload's time_slots can change vs. the old one if the current atomic commit changes the corresponding mode.

This patch let's drivers pass the old and new payload states to drm_dp_remove_payload(), but keeps these the same for now in all drivers not to change the behavior. A follow-up i915 patch will pass in that driver the correct old and new states to the function.

Cc Lyude Paul <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Karol Herbst <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Wayne Lin <[email protected]>
---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
 drivers/gpu/drm/display/drm_dp_mst_topology.c | 26 ++++++++++---------
 drivers/gpu/drm/i915/display/intel_dp_mst.c   |  4 ++-
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |  2 +-
 include/drm/display/drm_dp_mst_helper.h       |  3 ++-
 5 files changed, 21 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +1 -1
index a50319fc42b11..180d3893b68da 100644
@@ -208,7 +208,7 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
 	if (enable)
 		drm_dp_add_payload_part1(mst_mgr, mst_state, payload);
 	else
-		drm_dp_remove_payload(mst_mgr, mst_state, payload);
+		drm_dp_remove_payload(mst_mgr, mst_state, payload, payload);
 
 	/* mst_mgr->->payloads are VC payload notify MST branch using DPCD or
 	 * AUX message. The sequence is slot 1-63 allocated sequence for each
drivers/gpu/drm/display/drm_dp_mst_topology.c +14 -12
index 847c10aa2098c..1990ff5dc7ddd 100644
@@ -3342,7 +3342,8 @@ EXPORT_SYMBOL(drm_dp_add_payload_part1);
  * drm_dp_remove_payload() - Remove an MST payload
  * @mgr: Manager to use.
  * @mst_state: The MST atomic state
- * @payload: The payload to write
+ * @old_payload: The payload with its old state
+ * @new_payload: The payload to write
  *
  * Removes a payload from an MST topology if it was successfully assigned a start slot. Also updates
  * the starting time slots of all other payloads which would have been shifted towards the start of
@@ -3350,36 +3351,37 @@ EXPORT_SYMBOL(drm_dp_add_payload_part1);
  */
 void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr,
 			   struct drm_dp_mst_topology_state *mst_state,
-			   struct drm_dp_mst_atomic_payload *payload)
+			   const struct drm_dp_mst_atomic_payload *old_payload,
+			   struct drm_dp_mst_atomic_payload *new_payload)
 {
 	struct drm_dp_mst_atomic_payload *pos;
 	bool send_remove = false;
 
 	/* We failed to make the payload, so nothing to do */
-	if (payload->vc_start_slot == -1)
+	if (new_payload->vc_start_slot == -1)
 		return;
 
 	mutex_lock(&mgr->lock);
-	send_remove = drm_dp_mst_port_downstream_of_branch(payload->port, mgr->mst_primary);
+	send_remove = drm_dp_mst_port_downstream_of_branch(new_payload->port, mgr->mst_primary);
 	mutex_unlock(&mgr->lock);
 
 	if (send_remove)
-		drm_dp_destroy_payload_step1(mgr, mst_state, payload);
+		drm_dp_destroy_payload_step1(mgr, mst_state, new_payload);
 	else
 		drm_dbg_kms(mgr->dev, "Payload for VCPI %d not in topology, not sending remove\n",
-			    payload->vcpi);
+			    new_payload->vcpi);
 
 	list_for_each_entry(pos, &mst_state->payloads, next) {
-		if (pos != payload && pos->vc_start_slot > payload->vc_start_slot)
-			pos->vc_start_slot -= payload->time_slots;
+		if (pos != new_payload && pos->vc_start_slot > new_payload->vc_start_slot)
+			pos->vc_start_slot -= old_payload->time_slots;
 	}
-	payload->vc_start_slot = -1;
+	new_payload->vc_start_slot = -1;
 
 	mgr->payload_count--;
-	mgr->next_start_slot -= payload->time_slots;
+	mgr->next_start_slot -= old_payload->time_slots;
 
-	if (payload->delete)
-		drm_dp_mst_put_port_malloc(payload->port);
+	if (new_payload->delete)
+		drm_dp_mst_put_port_malloc(new_payload->port);
 }
 EXPORT_SYMBOL(drm_dp_remove_payload);
 
drivers/gpu/drm/i915/display/intel_dp_mst.c +3 -1
index f3cb12dcfe0a7..dc4e5ff1dbb31 100644
@@ -526,6 +526,8 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
 		to_intel_connector(old_conn_state->connector);
 	struct drm_dp_mst_topology_state *mst_state =
 		drm_atomic_get_mst_topology_state(&state->base, &intel_dp->mst_mgr);
+	struct drm_dp_mst_atomic_payload *payload =
+		drm_atomic_get_mst_payload_state(mst_state, connector->port);
 	struct drm_i915_private *i915 = to_i915(connector->base.dev);
 
 	drm_dbg_kms(&i915->drm, "active links %d\n",
@@ -534,7 +536,7 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
 	intel_hdcp_disable(intel_mst->connector);
 
 	drm_dp_remove_payload(&intel_dp->mst_mgr, mst_state,
-			      drm_atomic_get_mst_payload_state(mst_state, connector->port));
+			      payload, payload);
 
 	intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state);
 }
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -1
index edcb2529b4025..ed9d374147b8d 100644
@@ -885,7 +885,7 @@ nv50_msto_prepare(struct drm_atomic_state *state,
 
 	// TODO: Figure out if we want to do a better job of handling VCPI allocation failures here?
 	if (msto->disabled) {
-		drm_dp_remove_payload(mgr, mst_state, payload);
+		drm_dp_remove_payload(mgr, mst_state, payload, payload);
 
 		nvif_outp_dp_mst_vcpi(&mstm->outp->outp, msto->head->base.index, 0, 0, 0, 0);
 	} else {
include/drm/display/drm_dp_mst_helper.h +2 -1
index 41fd8352ab656..f5eb9aa152b14 100644
@@ -841,7 +841,8 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr,
 			     struct drm_dp_mst_atomic_payload *payload);
 void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr,
 			   struct drm_dp_mst_topology_state *mst_state,
-			   struct drm_dp_mst_atomic_payload *payload);
+			   const struct drm_dp_mst_atomic_payload *old_payload,
+			   struct drm_dp_mst_atomic_payload *new_payload);
 
 int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr);
 
Signature · 1 line
2.37.1
author
#2 lore raw

PATCH 3/4 drm/display/dp_mst: Add drm_atomic_get_old_mst_topology_state()

In reply to Imre Deak

Add a function to get the old MST topology state, required by a follow-up i915 patch.

While at it clarify the code comment of drm_atomic_get_new_mst_topology_state() and add _new prefix to the new state pointer to remind about its difference from the old state.

v2: Use old_/new_ prefixes for the state pointers. (Ville)

---
 drivers/gpu/drm/display/drm_dp_mst_topology.c | 33 ++++++++++++++++---
 include/drm/display/drm_dp_mst_helper.h       |  3 ++
 2 files changed, 32 insertions(+), 4 deletions(-)
drivers/gpu/drm/display/drm_dp_mst_topology.c +29 -4
index 1990ff5dc7ddd..38dab76ae69ea 100644
@@ -5364,28 +5364,53 @@ struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_a
 }
 EXPORT_SYMBOL(drm_atomic_get_mst_topology_state);
 
+/**
+ * drm_atomic_get_old_mst_topology_state: get old MST topology state in atomic state, if any
+ * @state: global atomic state
+ * @mgr: MST topology manager, also the private object in this case
+ *
+ * This function wraps drm_atomic_get_old_private_obj_state() passing in the MST atomic
+ * state vtable so that the private object state returned is that of a MST
+ * topology object.
+ *
+ * Returns:
+ *
+ * The old MST topology state, or NULL if there's no topology state for this MST mgr
+ * in the global atomic state
+ */
+struct drm_dp_mst_topology_state *
+drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state,
+				      struct drm_dp_mst_topology_mgr *mgr)
+{
+	struct drm_private_state *old_priv_state =
+		drm_atomic_get_old_private_obj_state(state, &mgr->base);
+
+	return old_priv_state ? to_dp_mst_topology_state(old_priv_state) : NULL;
+}
+EXPORT_SYMBOL(drm_atomic_get_old_mst_topology_state);
+
 /**
  * drm_atomic_get_new_mst_topology_state: get new MST topology state in atomic state, if any
  * @state: global atomic state
  * @mgr: MST topology manager, also the private object in this case
  *
- * This function wraps drm_atomic_get_priv_obj_state() passing in the MST atomic
+ * This function wraps drm_atomic_get_new_private_obj_state() passing in the MST atomic
  * state vtable so that the private object state returned is that of a MST
  * topology object.
  *
  * Returns:
  *
- * The MST topology state, or NULL if there's no topology state for this MST mgr
+ * The new MST topology state, or NULL if there's no topology state for this MST mgr
  * in the global atomic state
  */
 struct drm_dp_mst_topology_state *
 drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state,
 				      struct drm_dp_mst_topology_mgr *mgr)
 {
-	struct drm_private_state *priv_state =
+	struct drm_private_state *new_priv_state =
 		drm_atomic_get_new_private_obj_state(state, &mgr->base);
 
-	return priv_state ? to_dp_mst_topology_state(priv_state) : NULL;
+	return new_priv_state ? to_dp_mst_topology_state(new_priv_state) : NULL;
 }
 EXPORT_SYMBOL(drm_atomic_get_new_mst_topology_state);
 
include/drm/display/drm_dp_mst_helper.h +3 -0
index f5eb9aa152b14..32c764fb9cb56 100644
@@ -868,6 +868,9 @@ struct drm_dp_mst_topology_state *
 drm_atomic_get_mst_topology_state(struct drm_atomic_state *state,
 				  struct drm_dp_mst_topology_mgr *mgr);
 struct drm_dp_mst_topology_state *
+drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state,
+				      struct drm_dp_mst_topology_mgr *mgr);
+struct drm_dp_mst_topology_state *
 drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state,
 				      struct drm_dp_mst_topology_mgr *mgr);
 struct drm_dp_mst_atomic_payload *
Signature · 1 line
2.37.1
author
#3 lore raw

PATCH 4/4 drm/i915/dp_mst: Fix payload removal during output disabling

In reply to Imre Deak

Use the correct old/new topology and payload states in intel_mst_disable_dp(). So far drm_atomic_get_mst_topology_state() it used returned either the old state, in case the state was added already earlier during the atomic check phase or otherwise the new state (but the latter could fail, which can't be handled in the enable/disable hooks). After the first patch in the patchset, the state should always get added already during the check phase, so here we can get the old/new states without a failure.

drm_dp_remove_payload() should use time_slots from the old payload state and vc_start_slot in the new one. It should update the new payload states to reflect the sink's current payload table after the payload is removed. Pass the new topology state and the old and new payload states accordingly.

This also fixes a problem where the payload allocations for multiple MST streams on the same link got inconsistent after a few commits, as during payload removal the old instead of the new payload state got updated, so the subsequent enabling sequence and commits used a stale payload state.

v2: Constify the old payload state pointer. (Ville)

---
 drivers/gpu/drm/i915/display/intel_dp_mst.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_mst.c +10 -6
index dc4e5ff1dbb31..054a009e800d7 100644
@@ -524,10 +524,14 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
 	struct intel_dp *intel_dp = &dig_port->dp;
 	struct intel_connector *connector =
 		to_intel_connector(old_conn_state->connector);
-	struct drm_dp_mst_topology_state *mst_state =
-		drm_atomic_get_mst_topology_state(&state->base, &intel_dp->mst_mgr);
-	struct drm_dp_mst_atomic_payload *payload =
-		drm_atomic_get_mst_payload_state(mst_state, connector->port);
+	struct drm_dp_mst_topology_state *old_mst_state =
+		drm_atomic_get_old_mst_topology_state(&state->base, &intel_dp->mst_mgr);
+	struct drm_dp_mst_topology_state *new_mst_state =
+		drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst_mgr);
+	const struct drm_dp_mst_atomic_payload *old_payload =
+		drm_atomic_get_mst_payload_state(old_mst_state, connector->port);
+	struct drm_dp_mst_atomic_payload *new_payload =
+		drm_atomic_get_mst_payload_state(new_mst_state, connector->port);
 	struct drm_i915_private *i915 = to_i915(connector->base.dev);
 
 	drm_dbg_kms(&i915->drm, "active links %d\n",
@@ -535,8 +539,8 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
 
 	intel_hdcp_disable(intel_mst->connector);
 
-	drm_dp_remove_payload(&intel_dp->mst_mgr, mst_state,
-			      payload, payload);
+	drm_dp_remove_payload(&intel_dp->mst_mgr, new_mst_state,
+			      old_payload, new_payload);
 
 	intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state);
 }
Signature · 1 line
2.37.1
#4 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [CI,1/4] drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs

In reply to Imre Deak
== Series Details ==

== Series Details ==

Series: series starting with [CI,1/4] drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs
URL : https://patchwork.freedesktop.org/series/113703/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12703 -> Patchwork_113703v1
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/index.html

Participating hosts (28 -> 26)
------------------------------

Missing (2): bat-atsm-1 fi-snb-2520m

Known issues
------------

Here are the changes found in Patchwork_113703v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_module_load@reload:
- fi-kbl-soraka: [PASS][1] -> [DMESG-WARN][2] ([i915#1982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/fi-kbl-soraka/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/fi-kbl-soraka/igt@[email protected]

* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [PASS][3] -> [DMESG-FAIL][4] ([i915#5334])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html

#### Possible fixes ####

* igt@i915_pm_rpm@module-reload:
- fi-kbl-soraka: [DMESG-WARN][5] ([i915#1982]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/fi-kbl-soraka/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/fi-kbl-soraka/igt@[email protected]

* igt@i915_selftest@live@requests:
- {bat-rplp-1}: [ABORT][7] ([i915#7913]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/bat-rplp-1/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/bat-rplp-1/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@i915_selftest@live@execlists:
- fi-kbl-soraka: [INCOMPLETE][9] -> [INCOMPLETE][10] ([i915#7156])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/fi-kbl-soraka/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/fi-kbl-soraka/igt@i915_selftest@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7156]: https://gitlab.freedesktop.org/drm/intel/issues/7156
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913

Build changes
-------------

* Linux: CI_DRM_12703 -> Patchwork_113703v1

CI-20190529: 20190529
CI_DRM_12703: 97082f638eab440cda538934bd208be714a32c3d @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7150: 699a971852185d5e536f9cd1735dc0e255d79946 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_113703v1: 97082f638eab440cda538934bd208be714a32c3d @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

f0d00d836cad drm/i915/dp_mst: Fix payload removal during output disabling 3556434a5c3e drm/display/dp_mst: Add drm_atomic_get_old_mst_topology_state() 37517f4499e9 drm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload() 1bfbc960ac44 drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/index.html

#5 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [CI,1/4] drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs

In reply to Imre Deak
== Series Details ==

== Series Details ==

Series: series starting with [CI,1/4] drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs
URL : https://patchwork.freedesktop.org/series/113703/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12703_full -> Patchwork_113703v1_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/index.html

Participating hosts (10 -> 10)
------------------------------

No changes in participating hosts

Known issues
------------

Here are the changes found in Patchwork_113703v1_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_fair@basic-throttle@rcs0:
- shard-glk: [PASS][1] -> [FAIL][2] ([i915#2842])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-glk5/igt@gem_exec_fair@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-glk2/igt@gem_exec_fair@[email protected]

* igt@kms_dither@fb-8bpc-vs-panel-6bpc@pipe-a-hdmi-a-1:
- shard-glk: NOTRUN -> [SKIP][3] ([fdo#109271])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-glk3/igt@kms_dither@[email protected]

#### Possible fixes ####

* igt@drm_fdinfo@idle@rcs0:
- {shard-rkl}: [FAIL][4] ([i915#7742]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-1/igt@drm_fdinfo@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-5/igt@drm_fdinfo@[email protected]

* igt@fbdev@write:
- {shard-rkl}: [SKIP][6] ([i915#2582]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-5/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@[email protected]

* igt@gem_bad_reloc@negative-reloc-lut:
- {shard-rkl}: [SKIP][8] ([i915#3281]) -> [PASS][9] +2 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-2/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-5/igt@[email protected]

* igt@gem_exec_fair@basic-deadline:
- {shard-rkl}: [FAIL][10] ([i915#2846]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-1/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-1/igt@[email protected]

* igt@gem_exec_fair@basic-none-solo@rcs0:
- {shard-rkl}: [FAIL][12] ([i915#2842]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-3/igt@gem_exec_fair@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-3/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- {shard-tglu}: [FAIL][14] ([i915#2842]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-tglu-4/igt@gem_exec_fair@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-tglu-6/igt@gem_exec_fair@[email protected]

* igt@gem_readwrite@read-bad-handle:
- {shard-rkl}: [SKIP][16] ([i915#3282]) -> [PASS][17] +2 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-2/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-5/igt@[email protected]

* igt@gen9_exec_parse@basic-rejected:
- {shard-rkl}: [SKIP][18] ([i915#2527]) -> [PASS][19] +1 similar issue
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-1/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-5/igt@[email protected]

* igt@i915_pipe_stress@stress-xrgb8888-ytiled:
- {shard-rkl}: [SKIP][20] ([i915#4098]) -> [PASS][21] +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-5/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@[email protected]

* igt@i915_pm_dc@dc5-psr:
- {shard-rkl}: [SKIP][22] ([i915#658]) -> [PASS][23] +1 similar issue
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-3/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@[email protected]

* igt@i915_pm_dc@dc9-dpms:
- {shard-rkl}: [SKIP][24] ([i915#3361]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-5/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@[email protected]

* igt@i915_pm_rpm@dpms-non-lpsp:
- {shard-dg1}: [SKIP][26] ([i915#1397]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-dg1-14/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-dg1-12/igt@[email protected]

* igt@kms_flip@2x-plain-flip-ts-check-interruptible@ab-hdmi-a1-hdmi-a2:
- shard-glk: [FAIL][28] ([i915#2122]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-glk7/igt@kms_flip@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-glk7/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-tiling-linear:
- {shard-rkl}: [SKIP][30] ([i915#1849] / [i915#4098]) -> [PASS][31] +21 similar issues
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-3/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- {shard-rkl}: [SKIP][32] ([i915#1072]) -> [PASS][33] +3 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-1/igt@kms_psr@sprite_plane_onoff.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@kms_psr@sprite_plane_onoff.html

* igt@kms_universal_plane@universal-plane-pipe-b-functional:
- {shard-rkl}: [SKIP][34] ([i915#1845] / [i915#4070] / [i915#4098]) -> [PASS][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-1/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@[email protected]

* igt@kms_vblank@pipe-b-ts-continuation-idle:
- {shard-rkl}: [SKIP][36] ([i915#1845] / [i915#4098]) -> [PASS][37] +34 similar issues
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-5/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-6/igt@[email protected]

* igt@perf_pmu@busy-double-start@vcs0:
- {shard-dg1}: [FAIL][38] ([i915#4349]) -> [PASS][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-dg1-15/igt@perf_pmu@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-dg1-14/igt@perf_pmu@[email protected]

* igt@prime_vgem@basic-fence-read:
- {shard-rkl}: [SKIP][40] ([fdo#109295] / [i915#3291] / [i915#3708]) -> [PASS][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12703/shard-rkl-1/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/shard-rkl-5/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109307]: https://bugs.freedesktop.org/show_bug.cgi?id=109307
[fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
[fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
[fdo#109314]: https://bugs.freedesktop.org/show_bug.cgi?id=109314
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1755]: https://gitlab.freedesktop.org/drm/intel/issues/1755
[i915#1769]: https://gitlab.freedesktop.org/drm/intel/issues/1769
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
[i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
[i915#3536]: https://gitlab.freedesktop.org/drm/intel/issues/3536
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3639]: https://gitlab.freedesktop.org/drm/intel/issues/3639
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
[i915#3826]: https://gitlab.freedesktop.org/drm/intel/issues/3826
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3952]: https://gitlab.freedesktop.org/drm/intel/issues/3952
[i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
[i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
[i915#4818]: https://gitlab.freedesktop.org/drm/intel/issues/4818
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#4859]: https://gitlab.freedesktop.org/drm/intel/issues/4859
[i915#4881]: https://gitlab.freedesktop.org/drm/intel/issues/4881
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5234]: https://gitlab.freedesktop.org/drm/intel/issues/5234
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
[i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6230]: https://gitlab.freedesktop.org/drm/intel/issues/6230
[i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
[i915#6247]: https://gitlab.freedesktop.org/drm/intel/issues/6247
[i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
[i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
[i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
[i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
[i915#6355]: https://gitlab.freedesktop.org/drm/intel/issues/6355
[i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
[i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
[i915#7037]: https://gitlab.freedesktop.org/drm/intel/issues/7037
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7128]: https://gitlab.freedesktop.org/drm/intel/issues/7128
[i915#7276]: https://gitlab.freedesktop.org/drm/intel/issues/7276
[i915#7294]: https://gitlab.freedesktop.org/drm/intel/issues/7294
[i915#7443]: https://gitlab.freedesktop.org/drm/intel/issues/7443
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7701]: https://gitlab.freedesktop.org/drm/intel/issues/7701
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7949]: https://gitlab.freedesktop.org/drm/intel/issues/7949
[i915#7957]: https://gitlab.freedesktop.org/drm/intel/issues/7957

Build changes
-------------

* Linux: CI_DRM_12703 -> Patchwork_113703v1

CI-20190529: 20190529
CI_DRM_12703: 97082f638eab440cda538934bd208be714a32c3d @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7150: 699a971852185d5e536f9cd1735dc0e255d79946 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_113703v1: 97082f638eab440cda538934bd208be714a32c3d @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113703v1/index.html

author
#6 lore raw
In reply to Imre Deak

Hi all,

Quoted 13 lines · Imre Deak

Add the MST topology for a CRTC to the atomic state if the driver needs to force a modeset on the CRTC after the encoder compute config functions are called.

Later the MST encoder's disable hook also adds the state, but that isn't guaranteed to work (since in that hook getting the state may fail, which can't be handled there). This should fix that, while a later patch fixes the use of the MST state in the disable hook.

v2: Add missing forward struct declartions, caught by hdrtest.
v3: Factor out intel_dp_mst_add_topology_state_for_connector() used
later in the patchset.

Quoted 6 lines

Is it ok to merge these 4 patches (also at [1]), via the i915 tree?

If so could it be also acked from the AMD and Nouveau side?

[1] https://patchwork.freedesktop.org/series/113703/

Quoted 114 lines
---
 drivers/gpu/drm/i915/display/intel_display.c |  4 ++
 drivers/gpu/drm/i915/display/intel_dp_mst.c  | 61 ++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dp_mst.h  |  4 ++
 3 files changed, 69 insertions(+)
drivers/gpu/drm/i915/display/intel_display.c +4 -0
index 166662ade593c..38106cf63b3b9 100644
@@ -5936,6 +5936,10 @@ int intel_modeset_all_pipes(struct intel_atomic_state *state,
 		if (ret)
 			return ret;
 
+		ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc);
+		if (ret)
+			return ret;
+
 		ret = intel_atomic_add_affected_planes(state, crtc);
 		if (ret)
 			return ret;
drivers/gpu/drm/i915/display/intel_dp_mst.c +61 -0
index 8b0e4defa3f10..f3cb12dcfe0a7 100644
@@ -1223,3 +1223,64 @@ bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)
 	return crtc_state->mst_master_transcoder != INVALID_TRANSCODER &&
 	       crtc_state->mst_master_transcoder != crtc_state->cpu_transcoder;
 }
+
+/**
+ * intel_dp_mst_add_topology_state_for_connector - add MST topology state for a connector
+ * @state: atomic state
+ * @connector: connector to add the state for
+ * @crtc: the CRTC @connector is attached to
+ *
+ * Add the MST topology state for @connector to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+static int
+intel_dp_mst_add_topology_state_for_connector(struct intel_atomic_state *state,
+					      struct intel_connector *connector,
+					      struct intel_crtc *crtc)
+{
+	struct drm_dp_mst_topology_state *mst_state;
+
+	if (!connector->mst_port)
+		return 0;
+
+	mst_state = drm_atomic_get_mst_topology_state(&state->base,
+						      &connector->mst_port->mst_mgr);
+	if (IS_ERR(mst_state))
+		return PTR_ERR(mst_state);
+
+	mst_state->pending_crtc_mask |= drm_crtc_mask(&crtc->base);
+
+	return 0;
+}
+
+/**
+ * intel_dp_mst_add_topology_state_for_crtc - add MST topology state for a CRTC
+ * @state: atomic state
+ * @crtc: CRTC to add the state for
+ *
+ * Add the MST topology state for @crtc to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state,
+					     struct intel_crtc *crtc)
+{
+	struct drm_connector *_connector;
+	struct drm_connector_state *conn_state;
+	int i;
+
+	for_each_new_connector_in_state(&state->base, _connector, conn_state, i) {
+		struct intel_connector *connector = to_intel_connector(_connector);
+		int ret;
+
+		if (conn_state->crtc != &crtc->base)
+			continue;
+
+		ret = intel_dp_mst_add_topology_state_for_connector(state, connector, crtc);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
drivers/gpu/drm/i915/display/intel_dp_mst.h +4 -0
index f7301de6cdfb3..f1815bb722672 100644
@@ -8,6 +8,8 @@
 
 #include <linux/types.h>
 
+struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 struct intel_digital_port;
 struct intel_dp;
@@ -18,5 +20,7 @@ int intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port);
 bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_source_support(struct intel_dp *intel_dp);
+int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state,
+					     struct intel_crtc *crtc);
 
 #endif /* __INTEL_DP_MST_H__ */
Signature · 1 line
2.37.1
maintainer
#7 lore raw
Quoted 23 lines · Imre Deak

Hi all,

Quoted 13 lines · Imre Deak

Add the MST topology for a CRTC to the atomic state if the driver needs to force a modeset on the CRTC after the encoder compute config functions are called.

Later the MST encoder's disable hook also adds the state, but that isn't guaranteed to work (since in that hook getting the state may fail, which can't be handled there). This should fix that, while a later patch fixes the use of the MST state in the disable hook.

v2: Add missing forward struct declartions, caught by hdrtest.
v3: Factor out intel_dp_mst_add_topology_state_for_connector() used
later in the patchset.

Quoted 6 lines
Quoted 3 lines

Is it ok to merge these 4 patches (also at [1]), via the i915 tree?

If so could it be also acked from the AMD and Nouveau side?

Whichever branch works best for y'all is fine by me, if it's via i915's tree I guess we might need to back-merge drm-misc at some point so I can write up equivalent fixes for nouveau as well.

(Added Thomas Zimmermann to Cc)

Quoted 118 lines

[1] https://patchwork.freedesktop.org/series/113703/

Quoted 114 lines
---
 drivers/gpu/drm/i915/display/intel_display.c |  4 ++
 drivers/gpu/drm/i915/display/intel_dp_mst.c  | 61 ++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dp_mst.h  |  4 ++
 3 files changed, 69 insertions(+)
drivers/gpu/drm/i915/display/intel_display.c +4 -0
index 166662ade593c..38106cf63b3b9 100644
@@ -5936,6 +5936,10 @@ int intel_modeset_all_pipes(struct intel_atomic_state *state,
 		if (ret)
 			return ret;
 
+		ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc);
+		if (ret)
+			return ret;
+
 		ret = intel_atomic_add_affected_planes(state, crtc);
 		if (ret)
 			return ret;
drivers/gpu/drm/i915/display/intel_dp_mst.c +61 -0
index 8b0e4defa3f10..f3cb12dcfe0a7 100644
@@ -1223,3 +1223,64 @@ bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)
 	return crtc_state->mst_master_transcoder != INVALID_TRANSCODER &&
 	       crtc_state->mst_master_transcoder != crtc_state->cpu_transcoder;
 }
+
+/**
+ * intel_dp_mst_add_topology_state_for_connector - add MST topology state for a connector
+ * @state: atomic state
+ * @connector: connector to add the state for
+ * @crtc: the CRTC @connector is attached to
+ *
+ * Add the MST topology state for @connector to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+static int
+intel_dp_mst_add_topology_state_for_connector(struct intel_atomic_state *state,
+					      struct intel_connector *connector,
+					      struct intel_crtc *crtc)
+{
+	struct drm_dp_mst_topology_state *mst_state;
+
+	if (!connector->mst_port)
+		return 0;
+
+	mst_state = drm_atomic_get_mst_topology_state(&state->base,
+						      &connector->mst_port->mst_mgr);
+	if (IS_ERR(mst_state))
+		return PTR_ERR(mst_state);
+
+	mst_state->pending_crtc_mask |= drm_crtc_mask(&crtc->base);
+
+	return 0;
+}
+
+/**
+ * intel_dp_mst_add_topology_state_for_crtc - add MST topology state for a CRTC
+ * @state: atomic state
+ * @crtc: CRTC to add the state for
+ *
+ * Add the MST topology state for @crtc to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state,
+					     struct intel_crtc *crtc)
+{
+	struct drm_connector *_connector;
+	struct drm_connector_state *conn_state;
+	int i;
+
+	for_each_new_connector_in_state(&state->base, _connector, conn_state, i) {
+		struct intel_connector *connector = to_intel_connector(_connector);
+		int ret;
+
+		if (conn_state->crtc != &crtc->base)
+			continue;
+
+		ret = intel_dp_mst_add_topology_state_for_connector(state, connector, crtc);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
drivers/gpu/drm/i915/display/intel_dp_mst.h +4 -0
index f7301de6cdfb3..f1815bb722672 100644
@@ -8,6 +8,8 @@
 
 #include <linux/types.h>
 
+struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 struct intel_digital_port;
 struct intel_dp;
@@ -18,5 +20,7 @@ int intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port);
 bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_source_support(struct intel_dp *intel_dp);
+int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state,
+					     struct intel_crtc *crtc);
 
 #endif /* __INTEL_DP_MST_H__ */
Signature · 1 line
2.37.1
Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat
#8 lore raw
Quoted 26 lines · Lyude Paul
Quoted 25 lines · Imre Deak

Hi all,

Quoted 13 lines · Imre Deak

Add the MST topology for a CRTC to the atomic state if the driver needs to force a modeset on the CRTC after the encoder compute config functions are called.

Later the MST encoder's disable hook also adds the state, but that isn't guaranteed to work (since in that hook getting the state may fail, which can't be handled there). This should fix that, while a later patch fixes the use of the MST state in the disable hook.

v2: Add missing forward struct declartions, caught by hdrtest.
v3: Factor out intel_dp_mst_add_topology_state_for_connector() used
later in the patchset.

Quoted 6 lines

Is it ok to merge these 4 patches (also at [1]), via the i915 tree?

Quoted 7 lines
Quoted 1 line

If so could it be also acked from the AMD and Nouveau side?

Whichever branch works best for y'all is fine by me, if it's via i915's tree I guess we might need to back-merge drm-misc at some point so I can write up equivalent fixes for nouveau as well.

(Added Thomas Zimmermann to Cc)

I suggest merging the series via drm-misc-next-fixes branch, to get them to Linus' tree in the upcoming merge window. They all apply cleanly there. The drivers can backmerge them from drm-next in the mean time, or wait for v6.3-rc1.

Daniel acked this (well, any -next-fixes branch) on IRC yesterday, obviously ack from me too.

I take the above as Lyude's ack for nouveau.

Harry, Wayne, do you agree with this, ack for merging the AMD part via drm-misc-next-fixes? (Alex suggested to get your input.)

BR,
Jani.

Quoted 119 lines
Quoted 119 lines

[1] https://patchwork.freedesktop.org/series/113703/

Quoted 114 lines
---
 drivers/gpu/drm/i915/display/intel_display.c |  4 ++
 drivers/gpu/drm/i915/display/intel_dp_mst.c  | 61 ++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dp_mst.h  |  4 ++
 3 files changed, 69 insertions(+)
drivers/gpu/drm/i915/display/intel_display.c +4 -0
index 166662ade593c..38106cf63b3b9 100644
@@ -5936,6 +5936,10 @@ int intel_modeset_all_pipes(struct intel_atomic_state *state,
 		if (ret)
 			return ret;
 
+		ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc);
+		if (ret)
+			return ret;
+
 		ret = intel_atomic_add_affected_planes(state, crtc);
 		if (ret)
 			return ret;
drivers/gpu/drm/i915/display/intel_dp_mst.c +61 -0
index 8b0e4defa3f10..f3cb12dcfe0a7 100644
@@ -1223,3 +1223,64 @@ bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)
 	return crtc_state->mst_master_transcoder != INVALID_TRANSCODER &&
 	       crtc_state->mst_master_transcoder != crtc_state->cpu_transcoder;
 }
+
+/**
+ * intel_dp_mst_add_topology_state_for_connector - add MST topology state for a connector
+ * @state: atomic state
+ * @connector: connector to add the state for
+ * @crtc: the CRTC @connector is attached to
+ *
+ * Add the MST topology state for @connector to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+static int
+intel_dp_mst_add_topology_state_for_connector(struct intel_atomic_state *state,
+					      struct intel_connector *connector,
+					      struct intel_crtc *crtc)
+{
+	struct drm_dp_mst_topology_state *mst_state;
+
+	if (!connector->mst_port)
+		return 0;
+
+	mst_state = drm_atomic_get_mst_topology_state(&state->base,
+						      &connector->mst_port->mst_mgr);
+	if (IS_ERR(mst_state))
+		return PTR_ERR(mst_state);
+
+	mst_state->pending_crtc_mask |= drm_crtc_mask(&crtc->base);
+
+	return 0;
+}
+
+/**
+ * intel_dp_mst_add_topology_state_for_crtc - add MST topology state for a CRTC
+ * @state: atomic state
+ * @crtc: CRTC to add the state for
+ *
+ * Add the MST topology state for @crtc to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state,
+					     struct intel_crtc *crtc)
+{
+	struct drm_connector *_connector;
+	struct drm_connector_state *conn_state;
+	int i;
+
+	for_each_new_connector_in_state(&state->base, _connector, conn_state, i) {
+		struct intel_connector *connector = to_intel_connector(_connector);
+		int ret;
+
+		if (conn_state->crtc != &crtc->base)
+			continue;
+
+		ret = intel_dp_mst_add_topology_state_for_connector(state, connector, crtc);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
drivers/gpu/drm/i915/display/intel_dp_mst.h +4 -0
index f7301de6cdfb3..f1815bb722672 100644
@@ -8,6 +8,8 @@
 
 #include <linux/types.h>
 
+struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 struct intel_digital_port;
 struct intel_dp;
@@ -18,5 +20,7 @@ int intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port);
 bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
 bool intel_dp_mst_source_support(struct intel_dp *intel_dp);
+int intel_dp_mst_add_topology_state_for_crtc(struct intel_atomic_state *state,
+					     struct intel_crtc *crtc);
 
 #endif /* __INTEL_DP_MST_H__ */
Signature · 1 line
2.37.1
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#9 lore raw

[Public]

Add Mario for awareness.

Quoted 54 lines

-----Original Message-----
From: Jani Nikula <[email protected]>
Sent: Friday, February 10, 2023 6:48 PM
To: Lyude Paul <[email protected]>; [email protected]; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Daniel Vetter <[email protected]>
Cc: [email protected]; [email protected]; dri- [email protected]; Ville Syrjälä <[email protected]>; Ben Skeggs <[email protected]>; Lin, Wayne <[email protected]>; Karol Herbst <[email protected]>; Thomas Zimmermann <[email protected]>
Subject: Re: [Cc: drm-misc folks] Re: [Intel-gfx] [CI 1/4] drm/i915/dp_mst:
Add the MST topology state for modesetted CRTCs

Quoted 26 lines · Lyude Paul
Quoted 25 lines · Imre Deak

Hi all,

Quoted 13 lines · Imre Deak

Add the MST topology for a CRTC to the atomic state if the driver needs to force a modeset on the CRTC after the encoder compute config functions are called.

Later the MST encoder's disable hook also adds the state, but that isn't guaranteed to work (since in that hook getting the state may fail, which can't be handled there). This should fix that, while a later patch fixes the use of the MST state in the disable hook.

v2: Add missing forward struct declartions, caught by hdrtest.
v3: Factor out intel_dp_mst_add_topology_state_for_connector() used
later in the patchset.

Quoted 6 lines

Is it ok to merge these 4 patches (also at [1]), via the i915 tree?

Quoted 7 lines
Quoted 1 line

If so could it be also acked from the AMD and Nouveau side?

Whichever branch works best for y'all is fine by me, if it's via i915's tree I guess we might need to back-merge drm-misc at some point so I can write up equivalent fixes for nouveau as well.

(Added Thomas Zimmermann to Cc)

I suggest merging the series via drm-misc-next-fixes branch, to get them to Linus' tree in the upcoming merge window. They all apply cleanly there. The drivers can backmerge them from drm-next in the mean time, or wait for v6.3-rc1.

Quoted 8 lines

Daniel acked this (well, any -next-fixes branch) on IRC yesterday, obviously ack from me too.

I take the above as Lyude's ack for nouveau.

Harry, Wayne, do you agree with this, ack for merging the AMD part via drm- misc-next-fixes? (Alex suggested to get your input.)

Thank you Imre, Lyude and Jani.
That looks good to me and I agree with that.

Thanks!

Regards,
Wayne

Quoted 144 lines

BR,
Jani.

Quoted 8 lines
Quoted 8 lines

[1] https://patchwork.freedesktop.org/series/113703/

Quoted 4 lines
---
 drivers/gpu/drm/i915/display/intel_display.c |  4 ++

drivers/gpu/drm/i915/display/intel_dp_mst.c | 61
++++++++++++++++++++

drivers/gpu/drm/i915/display/intel_dp_mst.h

Quoted 9 lines
Quoted 9 lines

drivers/gpu/drm/i915/display/intel_display.c int intel_modeset_all_pipes(struct

Quoted 9 lines

| 4 ++

 3 files changed, 69 insertions(+)
drivers/gpu/drm/i915/display/intel_display.c +0 -0
index 166662ade593c..38106cf63b3b9 100644
@@ -5936,6 +5936,10 @@ int intel_modeset_all_pipes(struct

intel_atomic_state *state,

Quoted 16 lines
Quoted 16 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const

Quoted 16 lines
drivers/gpu/drm/i915/display/intel_display.c +4 -0
 		if (ret)
 			return ret;
 
+		ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc);
+		if (ret)
+			return ret;
+
 		ret = intel_atomic_add_affected_planes(state, crtc);
 		if (ret)
 			return ret;
drivers/gpu/drm/i915/display/intel_dp_mst.c +0 -0
index 8b0e4defa3f10..f3cb12dcfe0a7 100644
@@ -1223,3 +1223,64 @@ bool intel_dp_mst_is_slave_trans(const

struct intel_crtc_state *crtc_state)

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const · line 1223

Quoted 1 line
drivers/gpu/drm/i915/display/intel_dp_mst.c +0 -0
 	return crtc_state->mst_master_transcoder !=

INVALID_TRANSCODER &&

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
 	       crtc_state->mst_master_transcoder !=
 crtc_state->cpu_transcoder;  }
+
+/**
+ * intel_dp_mst_add_topology_state_for_connector - add MST
+topology state for a connector
+ * @state: atomic state
+ * @connector: connector to add the state for
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +8 -0
+ * @crtc: the CRTC @connector is attached to
+ *
+ * Add the MST topology state for @connector to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+static int
+intel_dp_mst_add_topology_state_for_connector(struct

intel_atomic_state *state,

Quoted 21 lines
Quoted 9 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +9 -0
+					      struct intel_connector *connector,
+					      struct intel_crtc *crtc) {
+	struct drm_dp_mst_topology_state *mst_state;
+
+	if (!connector->mst_port)
+		return 0;
+
+	mst_state = drm_atomic_get_mst_topology_state(&state->base,
+						      &connector->mst_port-

mst_mgr);

Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +11 -0
+	if (IS_ERR(mst_state))
+		return PTR_ERR(mst_state);
+
+	mst_state->pending_crtc_mask |= drm_crtc_mask(&crtc->base);
+
+	return 0;
+}
+
+/**
+ * intel_dp_mst_add_topology_state_for_crtc - add MST topology
+state for a CRTC
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +8 -0
+ * @state: atomic state
+ * @crtc: CRTC to add the state for
+ *
+ * Add the MST topology state for @crtc to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+int intel_dp_mst_add_topology_state_for_crtc(struct

intel_atomic_state *state,

Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
+					     struct intel_crtc *crtc) {
+	struct drm_connector *_connector;
+	struct drm_connector_state *conn_state;
+	int i;
+
+	for_each_new_connector_in_state(&state->base, _connector,

conn_state, i) {

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const · line 1274

Quoted 1 line
drivers/gpu/drm/i915/display/intel_dp_mst.c +1 -0
+		struct intel_connector *connector =

to_intel_connector(_connector);

Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
+		int ret;
+
+		if (conn_state->crtc != &crtc->base)
+			continue;
+
+		ret =

intel_dp_mst_add_topology_state_for_connector(state, connector, crtc);

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
drivers/gpu/drm/i915/display/intel_dp_mst.h +0 -0
index f7301de6cdfb3..f1815bb722672 100644
@@ -8,6 +8,8 @@
 
 #include <linux/types.h>
 
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dp_mst.h +2 -0
+struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 struct intel_digital_port;
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.h +0 -0
 struct intel_dp;
@@ -18,5 +20,7 @@ int intel_dp_mst_encoder_active_links(struct

intel_digital_port *dig_port); bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state); bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state); bool intel_dp_mst_source_support(struct intel_dp *intel_dp); +int intel_dp_mst_add_topology_state_for_crtc(struct

intel_atomic_state *state,

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp_mst.h +1 -1
+					     struct intel_crtc *crtc);
 
 #endif /* __INTEL_DP_MST_H__ */
--

2.37.1

--
Jani Nikula, Intel Open Source Graphics Center

author
#10 lore raw
Quoted 61 lines · Wayne

[Public]

Add Mario for awareness.

Quoted 57 lines

-----Original Message-----
From: Jani Nikula <[email protected]>
Sent: Friday, February 10, 2023 6:48 PM
To: Lyude Paul <[email protected]>; [email protected]; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>; Daniel Vetter <[email protected]>
Cc: [email protected]; [email protected]; dri- [email protected]; Ville Syrjälä <[email protected]>; Ben Skeggs <[email protected]>; Lin, Wayne <[email protected]>; Karol Herbst <[email protected]>; Thomas Zimmermann <[email protected]>
Subject: Re: [Cc: drm-misc folks] Re: [Intel-gfx] [CI 1/4] drm/i915/dp_mst:
Add the MST topology state for modesetted CRTCs

Quoted 26 lines · Lyude Paul
Quoted 25 lines · Imre Deak

Hi all,

Quoted 13 lines · Imre Deak

Add the MST topology for a CRTC to the atomic state if the driver needs to force a modeset on the CRTC after the encoder compute config functions are called.

Later the MST encoder's disable hook also adds the state, but that isn't guaranteed to work (since in that hook getting the state may fail, which can't be handled there). This should fix that, while a later patch fixes the use of the MST state in the disable hook.

v2: Add missing forward struct declartions, caught by hdrtest.
v3: Factor out intel_dp_mst_add_topology_state_for_connector() used
later in the patchset.

Quoted 6 lines

Is it ok to merge these 4 patches (also at [1]), via the i915 tree?

Quoted 7 lines
Quoted 1 line

If so could it be also acked from the AMD and Nouveau side?

Whichever branch works best for y'all is fine by me, if it's via i915's tree I guess we might need to back-merge drm-misc at some point so I can write up equivalent fixes for nouveau as well.

(Added Thomas Zimmermann to Cc)

I suggest merging the series via drm-misc-next-fixes branch, to get them to Linus' tree in the upcoming merge window. They all apply cleanly there. The drivers can backmerge them from drm-next in the mean time, or wait for v6.3-rc1.

Daniel acked this (well, any -next-fixes branch) on IRC yesterday, obviously ack from me too.

Quoted 7 lines
Quoted 4 lines

I take the above as Lyude's ack for nouveau.

Harry, Wayne, do you agree with this, ack for merging the AMD part via drm- misc-next-fixes? (Alex suggested to get your input.)

Thank you Imre, Lyude and Jani.
That looks good to me and I agree with that.

Ok, thanks all, pushed the patchset to drm-misc-next-fixes.

Quoted 148 lines

Thanks!

Regards,
Wayne

Quoted 144 lines

BR,
Jani.

Quoted 8 lines
Quoted 8 lines

[1] https://patchwork.freedesktop.org/series/113703/

Quoted 4 lines
---
 drivers/gpu/drm/i915/display/intel_display.c |  4 ++

drivers/gpu/drm/i915/display/intel_dp_mst.c | 61
++++++++++++++++++++

drivers/gpu/drm/i915/display/intel_dp_mst.h

Quoted 9 lines
Quoted 9 lines

drivers/gpu/drm/i915/display/intel_display.c int intel_modeset_all_pipes(struct

Quoted 9 lines

| 4 ++

 3 files changed, 69 insertions(+)
drivers/gpu/drm/i915/display/intel_display.c +0 -0
index 166662ade593c..38106cf63b3b9 100644
@@ -5936,6 +5936,10 @@ int intel_modeset_all_pipes(struct

intel_atomic_state *state,

Quoted 16 lines
Quoted 16 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const

Quoted 16 lines
drivers/gpu/drm/i915/display/intel_display.c +4 -0
 		if (ret)
 			return ret;
 
+		ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc);
+		if (ret)
+			return ret;
+
 		ret = intel_atomic_add_affected_planes(state, crtc);
 		if (ret)
 			return ret;
drivers/gpu/drm/i915/display/intel_dp_mst.c +0 -0
index 8b0e4defa3f10..f3cb12dcfe0a7 100644
@@ -1223,3 +1223,64 @@ bool intel_dp_mst_is_slave_trans(const

struct intel_crtc_state *crtc_state)

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const · line 1223

Quoted 1 line
drivers/gpu/drm/i915/display/intel_dp_mst.c +0 -0
 	return crtc_state->mst_master_transcoder !=

INVALID_TRANSCODER &&

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
 	       crtc_state->mst_master_transcoder !=
 crtc_state->cpu_transcoder;  }
+
+/**
+ * intel_dp_mst_add_topology_state_for_connector - add MST
+topology state for a connector
+ * @state: atomic state
+ * @connector: connector to add the state for
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +8 -0
+ * @crtc: the CRTC @connector is attached to
+ *
+ * Add the MST topology state for @connector to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+static int
+intel_dp_mst_add_topology_state_for_connector(struct

intel_atomic_state *state,

Quoted 21 lines
Quoted 9 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +9 -0
+					      struct intel_connector *connector,
+					      struct intel_crtc *crtc) {
+	struct drm_dp_mst_topology_state *mst_state;
+
+	if (!connector->mst_port)
+		return 0;
+
+	mst_state = drm_atomic_get_mst_topology_state(&state->base,
+						      &connector->mst_port-

mst_mgr);

Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +11 -0
+	if (IS_ERR(mst_state))
+		return PTR_ERR(mst_state);
+
+	mst_state->pending_crtc_mask |= drm_crtc_mask(&crtc->base);
+
+	return 0;
+}
+
+/**
+ * intel_dp_mst_add_topology_state_for_crtc - add MST topology
+state for a CRTC
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +8 -0
+ * @state: atomic state
+ * @crtc: CRTC to add the state for
+ *
+ * Add the MST topology state for @crtc to @state.
+ *
+ * Returns 0 on success, negative error code on failure.
+ */
+int intel_dp_mst_add_topology_state_for_crtc(struct

intel_atomic_state *state,

Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
+					     struct intel_crtc *crtc) {
+	struct drm_connector *_connector;
+	struct drm_connector_state *conn_state;
+	int i;
+
+	for_each_new_connector_in_state(&state->base, _connector,

conn_state, i) {

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const · line 1274

Quoted 1 line
drivers/gpu/drm/i915/display/intel_dp_mst.c +1 -0
+		struct intel_connector *connector =

to_intel_connector(_connector);

Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/display/intel_dp_mst.c bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state)

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
+		int ret;
+
+		if (conn_state->crtc != &crtc->base)
+			continue;
+
+		ret =

intel_dp_mst_add_topology_state_for_connector(state, connector, crtc);

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +6 -0
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
drivers/gpu/drm/i915/display/intel_dp_mst.h +0 -0
index f7301de6cdfb3..f1815bb722672 100644
@@ -8,6 +8,8 @@
 
 #include <linux/types.h>
 
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dp_mst.h +2 -0
+struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 struct intel_digital_port;
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_mst.h +0 -0
 struct intel_dp;
@@ -18,5 +20,7 @@ int intel_dp_mst_encoder_active_links(struct

intel_digital_port *dig_port); bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state); bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state); bool intel_dp_mst_source_support(struct intel_dp *intel_dp); +int intel_dp_mst_add_topology_state_for_crtc(struct

intel_atomic_state *state,

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp_mst.h +1 -1
+					     struct intel_crtc *crtc);
 
 #endif /* __INTEL_DP_MST_H__ */
--

2.37.1

--
Jani Nikula, Intel Open Source Graphics Center