From: Imre Deak <imre.deak@intel.com>
To: Lyude Paul <lyude@redhat.com>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [Intel-gfx] [PATCH] drm: Allow modeset on unregisted connectors unconditionally
Date: Tue, 21 May 2019 03:01:26 +0300 [thread overview]
Message-ID: <20190521000126.GA15609@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20190520174109.12732-1-imre.deak@intel.com>
On Mon, May 20, 2019 at 08:41:09PM +0300, Imre Deak wrote:
> We allowed modesetting an unregistered connector only in the case the
> mode is getting disabled on the connector.
>
> The reason for this check was the lack of proper refcounting for the
> backing memory objects. That problem has been solved meanwhile so there
> is no reason any more to reject the modesetting in general. The check
> for that also makes driver internal modesets more cumbersome where we
> need to add exemptions for the cases where we do need to allow the
> modeset even for unregistered connectors. One such case is the
> restoration of the mode during resume.
>
> Simplify things by removing the unneeded check. I can't see how
> modesetting an unregistered connector can cause any problem and the race
> (described in the code comment) can anyway result in such a modeset (if
> the connector is unregistered right after the check).
>
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Lyude, could you test this change against the DDX fail scenario that the
check was added for originally (based on our IRC discussion)?
Thanks,
Imre
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 29 ++---------------------------
> 1 file changed, 2 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 2e0cb4246cbd..e94e69483498 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -319,33 +319,6 @@ update_connector_routing(struct drm_atomic_state *state,
> return 0;
> }
>
> - crtc_state = drm_atomic_get_new_crtc_state(state,
> - new_connector_state->crtc);
> - /*
> - * For compatibility with legacy users, we want to make sure that
> - * we allow DPMS On->Off modesets on unregistered connectors. Modesets
> - * which would result in anything else must be considered invalid, to
> - * avoid turning on new displays on dead connectors.
> - *
> - * Since the connector can be unregistered at any point during an
> - * atomic check or commit, this is racy. But that's OK: all we care
> - * about is ensuring that userspace can't do anything but shut off the
> - * display on a connector that was destroyed after it's been notified,
> - * not before.
> - *
> - * Additionally, we also want to ignore connector registration when
> - * we're trying to restore an atomic state during system resume since
> - * 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.
> - */
> - if (!state->duplicated && drm_connector_is_unregistered(connector) &&
> - crtc_state->active) {
> - DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] is not registered\n",
> - connector->base.id, connector->name);
> - return -EINVAL;
> - }
> -
> funcs = connector->helper_private;
>
> if (funcs->atomic_best_encoder)
> @@ -390,6 +363,8 @@ update_connector_routing(struct drm_atomic_state *state,
>
> set_best_encoder(state, new_connector_state, new_encoder);
>
> + crtc_state = drm_atomic_get_new_crtc_state(state,
> + new_connector_state->crtc);
> crtc_state->connectors_changed = true;
>
> DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n",
> --
> 2.17.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2019-05-21 0:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 17:41 [PATCH] drm: Allow modeset on unregisted connectors unconditionally Imre Deak
2019-05-20 18:37 ` Daniel Vetter
2019-05-20 19:09 ` Imre Deak
2019-05-20 19:23 ` Daniel Vetter
2019-05-20 20:06 ` Imre Deak
2019-05-20 20:15 ` Daniel Vetter
2019-05-20 20:50 ` Imre Deak
2019-05-20 20:59 ` Daniel Vetter
2019-05-20 21:16 ` Imre Deak
2019-05-21 0:01 ` Imre Deak [this message]
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=20190521000126.GA15609@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lyude@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox