From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <contact@emersion.fr>
Cc: Jani Nikula <jani.nikula@intel.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/atomic-helper: relax unregistered connector check
Date: Fri, 6 Oct 2023 23:52:12 +0300 [thread overview]
Message-ID: <ZSBzfLY2X7IL7Y9j@intel.com> (raw)
In-Reply-To: <20231005131623.114379-1-contact@emersion.fr>
On Thu, Oct 05, 2023 at 01:16:32PM +0000, Simon Ser wrote:
> 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.
Yeah, this seems a bit more reasonble at least than then
current behaviour.
>
> See this wlroots issue:
> https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3407
>
> Previous discussion:
> https://lore.kernel.org/intel-gfx/Y6GX7z17WmDSKwta@ideak-desk.fi.intel.com/
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 71d399397107..c9b8343eaa20 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -290,7 +290,8 @@ static int
> update_connector_routing(struct drm_atomic_state *state,
> struct drm_connector *connector,
> struct drm_connector_state *old_connector_state,
> - struct drm_connector_state *new_connector_state)
> + struct drm_connector_state *new_connector_state,
> + bool added_by_user)
> {
> const struct drm_connector_helper_funcs *funcs;
> struct drm_encoder *new_encoder;
> @@ -339,9 +340,13 @@ update_connector_routing(struct drm_atomic_state *state,
> * there's a chance the connector may have been destroyed during the
> * process, but it's better to ignore that then cause
> * drm_atomic_helper_resume() to fail.
> + *
> + * Last, we want to ignore connector registration when the connector
> + * was not pulled in the atomic state by user-space (ie, was pulled
> + * in by the driver, e.g. when updating a DP-MST stream).
> */
> if (!state->duplicated && drm_connector_is_unregistered(connector) &&
> - crtc_state->active) {
> + added_by_user && crtc_state->active) {
> drm_dbg_atomic(connector->dev,
> "[CONNECTOR:%d:%s] is not registered\n",
> connector->base.id, connector->name);
> @@ -620,7 +625,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
> struct drm_connector *connector;
> struct drm_connector_state *old_connector_state, *new_connector_state;
> int i, ret;
> - unsigned int connectors_mask = 0;
> + unsigned int connectors_mask = 0, user_connectors_mask = 0;
> +
> + for_each_oldnew_connector_in_state(state, connector, old_connector_state, new_connector_state, i)
> + user_connectors_mask |= BIT(i);
>
> for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
> bool has_connectors =
> @@ -685,7 +693,8 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
> */
> ret = update_connector_routing(state, connector,
> old_connector_state,
> - new_connector_state);
> + new_connector_state,
> + BIT(i) & user_connectors_mask);
Alignment looks to be off.
Otherwise
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> if (ret)
> return ret;
> if (old_connector_state->crtc) {
> --
> 2.42.0
>
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-10-06 20:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 13:16 [PATCH] drm/atomic-helper: relax unregistered connector check Simon Ser
2023-10-05 19:05 ` Lyude Paul
2023-10-06 0:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2023-10-06 0:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-06 14:48 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-10-06 20:52 ` Ville Syrjälä [this message]
2023-10-10 12:59 ` [PATCH] " Simon Ser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZSBzfLY2X7IL7Y9j@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=contact@emersion.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.