Skip to content

Commit d8bb786

Browse files
emersiongregkh
authored andcommitted
drm/atomic-helper: relax unregistered connector check
commit 2b7947b upstream. The driver might pull connectors which weren't submitted by user-space into the atomic state. For instance, intel_dp_mst_atomic_master_trans_check() pulls in connectors sharing the same DP-MST stream. However, if the connector is unregistered, this later fails with: [ 559.425658] i915 0000:00:02.0: [drm:drm_atomic_helper_check_modeset] [CONNECTOR:378:DP-7] is not registered Skip the unregistered connector check to allow user-space to turn off connectors one-by-one. See this wlroots issue: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3407 Previous discussion: https://lore.kernel.org/intel-gfx/[email protected]/ Signed-off-by: Simon Ser <[email protected]> Cc: [email protected] Reviewed-by: Ville Syrjälä <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7e34cec commit d8bb786

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

drivers/gpu/drm/drm_atomic_helper.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ static int
290290
update_connector_routing(struct drm_atomic_state *state,
291291
struct drm_connector *connector,
292292
struct drm_connector_state *old_connector_state,
293-
struct drm_connector_state *new_connector_state)
293+
struct drm_connector_state *new_connector_state,
294+
bool added_by_user)
294295
{
295296
const struct drm_connector_helper_funcs *funcs;
296297
struct drm_encoder *new_encoder;
@@ -339,9 +340,13 @@ update_connector_routing(struct drm_atomic_state *state,
339340
* there's a chance the connector may have been destroyed during the
340341
* process, but it's better to ignore that then cause
341342
* drm_atomic_helper_resume() to fail.
343+
*
344+
* Last, we want to ignore connector registration when the connector
345+
* was not pulled in the atomic state by user-space (ie, was pulled
346+
* in by the driver, e.g. when updating a DP-MST stream).
342347
*/
343348
if (!state->duplicated && drm_connector_is_unregistered(connector) &&
344-
crtc_state->active) {
349+
added_by_user && crtc_state->active) {
345350
drm_dbg_atomic(connector->dev,
346351
"[CONNECTOR:%d:%s] is not registered\n",
347352
connector->base.id, connector->name);
@@ -620,7 +625,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
620625
struct drm_connector *connector;
621626
struct drm_connector_state *old_connector_state, *new_connector_state;
622627
int i, ret;
623-
unsigned int connectors_mask = 0;
628+
unsigned int connectors_mask = 0, user_connectors_mask = 0;
629+
630+
for_each_oldnew_connector_in_state(state, connector, old_connector_state, new_connector_state, i)
631+
user_connectors_mask |= BIT(i);
624632

625633
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
626634
bool has_connectors =
@@ -685,7 +693,8 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
685693
*/
686694
ret = update_connector_routing(state, connector,
687695
old_connector_state,
688-
new_connector_state);
696+
new_connector_state,
697+
BIT(i) & user_connectors_mask);
689698
if (ret)
690699
return ret;
691700
if (old_connector_state->crtc) {

0 commit comments

Comments
 (0)