All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Manasi Navare <manasi.d.navare@intel.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 1/5] drm: Add atomic helper to redo a modeset on current mode
Date: Tue, 25 Oct 2016 08:40:05 +0200	[thread overview]
Message-ID: <20161025064005.kiymdqtitislhyia@phenom.ffwll.local> (raw)
In-Reply-To: <20161024220847.GA4039@intel.com>

On Mon, Oct 24, 2016 at 03:08:48PM -0700, Manasi Navare wrote:
> On Mon, Oct 24, 2016 at 09:12:35AM +0200, Daniel Vetter wrote:
> > On Mon, Oct 24, 2016 at 9:00 AM, Manasi Navare
> > <manasi.d.navare@intel.com> wrote:
> > >> I guess we just need to do some additional work on top to make sure the
> > >> vblank ioctl can't see invalid state. Which would then again make upfront
> > >> link trainig possible ...
> 
> Thanks for the explanation. So the atomic_commit code in the driver
> calls drm_crtc_send_vblank_event(crtc, crtc->state->event);, is this
> what needs to be filtered to be seen by Vblank IOCTL?
> 
> 
> > >
> > > Could you share some more details on what work would need to be done
> > > for vblank? Then I can investigate it a little bit more tomor during the day.
> > 
> > So the trouble is that drm_irq.c is still from the old pre-kms days.
> > Which means it deals in int pipe instead of struct drm_crtc *, among
> > other things. But we can't simply switch over because some old drivers
> > (pre-kms ones) still depend upon that old code. Hence we need:
> > 
> > 1. Duplicate most of the code in drm_irq.c into a new
> > drm_crtc_vblank.c, which is only used for kms drivers. And in the
> > ioctl code have a DRIVER_MODESET check and either call the new kms
> > version (in drm_crtc_vblank.c) or the old one (still in drm_irq.c).
> 
> What functions need to be duplicated?
 
Figuring out the exact list is way this is painful. Since we don't need
everything, but just enough to make the new drm_crtc_vblank.c work. And
then as a second step we probably should move all the functions starting
with drm_crtc_vblank_ which are exported to drivers over to that file too.

> Which IOCTL are we talking about here?  Do you mean in the atomic_commit_tail
> where we check for driver modeset, is where we should then call the new kms version
> of drm_crtc_send_vblank_event()?
> > 
> > 2. Convert the int pipe into a drm_crtc pointer in the new kms code.
> > For prettiness we could (try) to do that as much as possible.
> > 
> > 3. Grab the drm_crtc->mutex in the ioctl code to block these races.
> 
> Again which IOCTL needs to grab the drm_crtc->mutex?

The vblank ioctl in drm_irq.c, implemented by drm_wait_vblank.

> What is the end goal of thsi task, what race conditions are we trying to avoid
> in case of these modesets during link training failures?

Modeset code calls drm_crtc_vblank_on/off when doing a full modeset. That
changes the vblank status, which can be observed through the vblank ioctl
by userspace: In between the calls to _off/_on it will return -EINVAL,
instead of the last vblank timestamp (for a query) or doing the vblank
wait (otherwise), which is what it should do.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-10-25  6:40 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 23:45 [PATCH 0/5] Handle link training failure for DDI platforms Manasi Navare
2016-10-21 23:45 ` [PATCH 1/5] drm: Add atomic helper to redo a modeset on current mode Manasi Navare
2016-10-22  8:47   ` Daniel Vetter
2016-10-22 14:01     ` [Intel-gfx] " Daniel Vetter
2016-10-22 14:46       ` Ville Syrjälä
2016-10-24  6:00         ` Daniel Vetter
2016-10-24  6:12           ` Manasi Navare
2016-10-24  6:33             ` Daniel Vetter
2016-10-24  7:00               ` Manasi Navare
2016-10-24  7:12                 ` Daniel Vetter
2016-10-24 18:38                   ` [Intel-gfx] " Sean Paul
2016-10-25  6:35                     ` Daniel Vetter
2016-10-24 22:08                   ` Manasi Navare
2016-10-25  6:40                     ` Daniel Vetter [this message]
2016-10-25 12:09   ` Jani Nikula
2016-10-25 22:28     ` Manasi Navare
2016-10-25 22:38     ` Rodrigo Vivi
2016-10-21 23:45 ` [PATCH 2/5] drm: Define a work struct for scheduling a uevent for modeset retry Manasi Navare
2016-10-22  8:48   ` Daniel Vetter
2016-10-25  6:28     ` Manasi Navare
2016-10-25  6:30       ` Pandiyan, Dhinakaran
2016-10-25  6:45         ` [Intel-gfx] " Daniel Vetter
2016-10-21 23:45 ` [PATCH 3/5] drm/i915: Change the placement of some static functions in intel_dp.c Manasi Navare
2016-10-21 23:45 ` [PATCH 4/5] drm/i915; Add a function to return index of link rate Manasi Navare
2016-10-25  6:33   ` Pandiyan, Dhinakaran
2016-10-21 23:45 ` [PATCH 5/5] drm/i915: Link Rate fallback on Link training failure Manasi Navare
2016-10-24 17:53   ` Jim Bride
2016-10-25  6:23   ` Pandiyan, Dhinakaran
2016-10-25 18:32     ` Manasi Navare
2016-10-25 12:17   ` Jani Nikula
2016-10-25 18:00     ` Jim Bride
2016-10-25 18:37     ` Manasi Navare
2016-10-22  0:16 ` ✗ Fi.CI.BAT: warning for Handle link training failure for DDI platforms Patchwork

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=20161025064005.kiymdqtitislhyia@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=manasi.d.navare@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.