intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/i915: Update CRTC state if connector link status property changed
Date: Fri, 18 Nov 2016 18:21:21 +0200	[thread overview]
Message-ID: <20161118162121.GP31595@intel.com> (raw)
In-Reply-To: <20161118153525.5ui2ojrtuxzr2n6r@phenom.ffwll.local>

On Fri, Nov 18, 2016 at 04:35:25PM +0100, Daniel Vetter wrote:
> On Fri, Nov 18, 2016 at 05:28:54PM +0200, Ville Syrjälä wrote:
> > On Fri, Nov 18, 2016 at 03:18:06PM +0100, Maarten Lankhorst wrote:
> > > Op 18-11-16 om 15:11 schreef Ville Syrjälä:
> > > > On Fri, Nov 18, 2016 at 02:50:52PM +0100, Maarten Lankhorst wrote:
> > > >> Op 18-11-16 om 08:13 schreef Manasi Navare:
> > > >>> CRTC state connector_changed needs to be set to true
> > > >>> if connector link status property has changed. This will tell the
> > > >>> driver to do a complete modeset due to change in connector property.
> > > >>>
> > > >>> Acked-by: Harry Wentland <harry.wentland@amd.com>
> > > >>> Acked-by: Tony Cheng <tony.cheng@amd.com>
> > > >>> Cc: dri-devel@lists.freedesktop.org
> > > >>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > > >>> Cc: Daniel Vetter <daniel.vetter@intel.com>
> > > >>> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> > > >>> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> > > >>> ---
> > > >>>  drivers/gpu/drm/drm_atomic_helper.c | 7 +++++++
> > > >>>  1 file changed, 7 insertions(+)
> > > >>>
> > > >>> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > > >>> index 0b16587..2125fd1 100644
> > > >>> --- a/drivers/gpu/drm/drm_atomic_helper.c
> > > >>> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > > >>> @@ -519,6 +519,13 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
> > > >>>  					       connector_state);
> > > >>>  		if (ret)
> > > >>>  			return ret;
> > > >>> +
> > > >>> +		if (connector->state->crtc) {
> > > >>> +			crtc_state = drm_atomic_get_existing_crtc_state(state,
> > > >>> +									connector->state->crtc);
> > > >>> +			if (connector->link_status == DRM_MODE_LINK_STATUS_BAD)
> > > >>> +				crtc_state->connectors_changed = true;
> > > >>> +		}
> > > >>>  	}
> > > >>>  
> > > >>>  	/*
> > > >> This will cause ordinary atomic commits that happen to change connector flags to potentially fail with -EINVAL if ALLOW_MODESET is not set.
> > > >> For this reason I'm not sure this flag should be set automatically by the kernel. Could we add add a retrain link property instead, that
> > > >> always return 0 when queried, but writing a 1 causing connectors_changed to be set on bad link status?
> > > > Or just check for allow_modeset before setting connectors_changed=true here?
> > > 
> > > I don't think modesets should be done automatically like that, even if ALLOW_MODESET is set a modeset may not be expected by userspace.
> > 
> > Presumably userspace would want a picture on the screen using any means
> > if it said ALLOW_MODESET. So if it can't tolerate the modeset it should
> > probably say as much?
> 
> Yeah, agreed. Also, if the link is bad then we pretty much have to do a
> modeset to recover it, otherwise you'll be forever stuck with a bad
> screen.
> 
> What we could try is to gate this of whether userspace touches the mode
> property on the corresponding CRTC. I.e. if that's touched (even if it's
> the same mode), and a link is bad in one of the connectors in the state
> then we do a full modeset to recover.
> 
> Another option would be to make the link status writeable. Trying to
> change it from bad->good would force the modeset. That would be 100% clear
> to userspace, not special hacks needed with checking for allow_modeset,
> no magic property that auto-changes its value. And 100% backwards compat
> because existing userspace should never touch properties it doesn't
> understand (except when restoring a mode, and then it should allow a full
> modeset). And if someone does try a good->bad transition, we just silently
> keep it at good.
> 
> Definitely need to document this properly in the property docs, no matter
> what we decide.

Hmm. I think I kinda like this idea of userspace clear the state back
to good explicitly, if it happens with the same prop. So it's like
Maarten's retrain_link prop idea, but without having to add the second
prop to the mix.

It would also save me from pointing out (for the nth time) that the
link status should really be cleared to good during the commit state
swap and not at some random point during the commit ;)

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-11-18 16:21 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18  7:13 [PATCH 0/5] Link Training failure handling during modeset Manasi Navare
2016-11-18  7:13 ` [PATCH 1/5] drm: Add a new connector property for link status Manasi Navare
2016-11-19  2:50   ` [PATCH v5 " Manasi Navare
2016-11-21  9:33     ` Daniel Vetter
2016-11-18  7:13 ` [PATCH 2/5] drm: Set DRM connector link status property Manasi Navare
2016-11-19  2:50   ` [PATCH v3 " Manasi Navare
2016-11-18  7:13 ` [PATCH 3/5] drm/i915: Update CRTC state if connector link status property changed Manasi Navare
2016-11-18 13:50   ` Maarten Lankhorst
2016-11-18 14:11     ` Ville Syrjälä
2016-11-18 14:18       ` Maarten Lankhorst
2016-11-18 15:28         ` Ville Syrjälä
2016-11-18 15:35           ` [Intel-gfx] " Daniel Vetter
2016-11-18 16:21             ` Ville Syrjälä [this message]
2016-11-18 17:44               ` Manasi Navare
2016-11-21  9:38                 ` Daniel Vetter
2016-11-21  9:42                   ` Chris Wilson
2016-11-21 10:10                     ` [Intel-gfx] " Daniel Vetter
2016-11-21 15:48                       ` Daniel Vetter
2016-11-21 19:00                         ` Manasi Navare
2016-11-21 20:46                           ` Chris Wilson
2016-11-21 21:07                             ` [Intel-gfx] " Manasi Navare
2016-11-23  1:15                         ` Manasi Navare
2016-11-23  7:44                           ` Daniel Vetter
2016-11-18 18:13             ` [Intel-gfx] " Manasi Navare
2016-11-18 15:23       ` Manasi Navare
2016-11-18  7:13 ` [PATCH 4/5] drm/i915: Find fallback link rate/lane count Manasi Navare
2016-11-18  7:29   ` Manasi Navare
2016-11-18 13:22     ` Jani Nikula
2016-11-18 15:39       ` Manasi Navare
2016-11-19  2:09         ` Manasi Navare
2016-11-19  2:50   ` [PATCH v6 4/56 4/56 4/56 4/56 4/56 " Manasi Navare
2016-11-18  7:13 ` [PATCH 5/5] drm/i915: Implement Link Rate fallback on Link training failure Manasi Navare
2016-11-18  7:29   ` Manasi Navare
2016-11-18 13:31     ` Jani Nikula
2016-11-18 15:29       ` Manasi Navare
2016-11-19  2:50   ` [PATCH v8 " Manasi Navare
2016-11-18  8:31 ` ✗ Fi.CI.BAT: failure for Link Training failure handling during modeset (rev3) Patchwork
2016-11-19  4:01 ` ✗ Fi.CI.BAT: failure for Link Training failure handling during modeset (rev4) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-11-19  2:58 [PATCH 0/5] Clean series for Link training failure handling Manasi Navare
2016-11-19  2:59 ` [PATCH 3/5] drm/i915: Update CRTC state if connector link status property changed Manasi Navare
2016-11-15  3:13 [PATCH 0/5] Handle link training failure during modeset Manasi Navare
2016-11-15  3:13 ` [PATCH 3/5] drm/i915: Update CRTC state if connector link status property changed Manasi Navare
2016-11-10  4:42 [PATCH 0/5] Handle Link Training Failure during modeset Manasi Navare
2016-11-10  4:42 ` [PATCH 3/5] drm/i915: Update CRTC state if connector link status property changed Manasi Navare

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=20161118162121.GP31595@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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;
as well as URLs for NNTP newsgroup(s).