dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 03/17] drm: convert crtc and mode_config to ww_mutex
Date: Mon, 26 May 2014 10:23:33 +0200	[thread overview]
Message-ID: <20140526082333.GW14357@phenom.ffwll.local> (raw)
In-Reply-To: <CAF6AEGu9KTCSHqbQPVjdeDouvfpMPWCWf_akXaYUJ=4zz_VoAg@mail.gmail.com>

On Sun, May 25, 2014 at 07:16:43PM -0400, Rob Clark wrote:
> On Sun, May 25, 2014 at 6:10 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Sat, May 24, 2014 at 8:30 PM, Rob Clark <robdclark@gmail.com> wrote:
> >> @@ -8002,7 +8002,7 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
> >>         if (encoder->crtc) {
> >>                 crtc = encoder->crtc;
> >>
> >> -               mutex_lock(&crtc->mutex);
> >> +               drm_modeset_lock(&crtc->mutex, NULL);
> >
> >
> > This is pretty much the reason why I think switching the
> > mode_config.mutex to a ww_mutex is a bad idea: This call here nests
> > within the mode_config.mutex and so must be acquired. Wiring the
> > acquire context through everything is going to be fairly horrible,
> > especially since you must be able to bail out when trying to lock with
> > an axquire context.
> 
> which is the call-path to here from mode_config.mutex?  Is it possible
> to just move the locking to a higher level for a
> drm_modeset_lock_all()?

Connector probing. And the entire point of crtc locks was to _not_ block
all screen updates while we poke for a new edid or do load balancing. If
you want to test this you need a gen3/4 with tv-out (native, not through
sdvo) or a gen2 or i915g/gm with vga.

> > My original design behind the crtc->mutex and mode_config.mutex split
> > was that as long as the connector->crtc links didn't change you can
> > get away with the crtc lock. setplane made a bit a mess out of this,
> > but strictly speaking as long as you acquire all crtc locks involved
> > in a potential plane switch (which ww_mtuxes can do) it'll be fine.
> > Since noticing whether any connector properties change should be
> > doable upfront I think we should try _really_ hard to keep the
> > mode_config.mutex a plain mutex which wraps all the more fine-grained
> > locks and is a catch-all for everything else but crtcs/planes.
> 
> That is basically how it was in one of the earlier iterations of
> atomic.. but didn't hold mode_config.mutex in a lot of places where it
> was previously held.. and while I do want to make locking more fine
> grained I didn't want to try and do it at the same time as landing all
> these other changes.

Hm, maybe we should land the locking stuff first? I.e. just convert
crtc->mutex into a ww_mutex, and then add more fine-grained locking to
e.g. setplane by only grabbing the locks of the involved crtcs with the
w/w logic. We might need an additional plane mutex to make it work. Iirc
Ville had some patches for just this.

I'm arguing this since locking at the current interface I have a really
hard time seeing how we're going to implement this in i915. Still reading
around though.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-05-26  8:23 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-24 18:30 [PATCH 00/17] prepare for atomic/nuclear modeset/pageflip Rob Clark
2014-05-24 18:30 ` [PATCH 01/17] drm: fix typo Rob Clark
2014-05-24 18:30 ` [PATCH 02/17] drm: add atomic fxns Rob Clark
2014-05-24 18:30 ` [PATCH 03/17] drm: convert crtc and mode_config to ww_mutex Rob Clark
2014-05-25 22:10   ` Daniel Vetter
2014-05-25 23:16     ` Rob Clark
2014-05-26  8:23       ` Daniel Vetter [this message]
2014-05-26 11:56         ` Rob Clark
2014-05-26 14:35           ` Daniel Vetter
2014-05-26 14:36             ` Daniel Vetter
2014-05-26 15:04             ` Rob Clark
2014-05-26 15:07               ` Daniel Vetter
2014-05-26 15:20                 ` Rob Clark
2014-05-26 15:35                   ` Daniel Vetter
2014-05-26 15:49                     ` Rob Clark
2014-05-26 16:09                       ` Daniel Vetter
2014-05-24 18:30 ` [PATCH 04/17] drm: add object property type Rob Clark
2014-05-26  8:29   ` Daniel Vetter
2014-05-26  8:33     ` Daniel Vetter
2014-05-26 11:06     ` Rob Clark
2014-05-24 18:30 ` [PATCH 05/17] drm: add signed-range " Rob Clark
2014-05-24 18:30 ` [PATCH 06/17] drm: helpers to find mode objects Rob Clark
2014-05-26  8:37   ` Daniel Vetter
2014-05-26  8:55     ` Daniel Vetter
2014-05-26 11:12     ` Rob Clark
2014-05-24 18:30 ` [PATCH 07/17] drm: split propvals out and blob property support Rob Clark
2014-05-24 18:30 ` [PATCH 08/17] drm: Allow drm_mode_object_find() to look up an object of any type Rob Clark
2014-05-24 18:30 ` [PATCH 09/17] drm: Refactor object property check code Rob Clark
2014-05-24 18:30 ` [PATCH 10/17] drm: allow FB's in drm_mode_object_find Rob Clark
2014-05-26  8:39   ` Daniel Vetter
2014-05-24 18:30 ` [PATCH 11/17] drm: convert plane to properties/state Rob Clark
2014-05-26  9:12   ` Daniel Vetter
2014-05-26 11:32     ` Rob Clark
2014-05-26 14:52       ` Daniel Vetter
2014-05-24 18:30 ` [PATCH 12/17] drm: convert crtc " Rob Clark
2014-05-26  9:31   ` Daniel Vetter
2014-05-26 11:35     ` Rob Clark
2014-05-26 14:56       ` Daniel Vetter
2014-05-26 15:15         ` Rob Clark
2014-05-26 15:23     ` Ville Syrjälä
2014-05-26 15:37       ` Daniel Vetter
2014-05-26 15:42         ` Rob Clark
2014-05-26 15:46         ` Ville Syrjälä
2014-05-26 16:12           ` Daniel Vetter
2014-05-24 18:30 ` [PATCH 13/17] drm: push locking down into restore_fbdev_mode Rob Clark
2014-05-26  9:34   ` Daniel Vetter
2014-05-24 18:30 ` [PATCH 14/17] drm/msm: add atomic support Rob Clark
2014-05-26 17:54   ` Daniel Vetter
2014-05-27 15:58     ` Rob Clark
2014-05-27 17:50       ` Daniel Vetter
2014-05-27 18:48         ` Rob Clark
2014-05-27 19:26           ` Daniel Vetter
2014-05-27 20:06             ` Rob Clark
2014-05-27 22:09               ` Daniel Vetter
2014-05-27 23:32                 ` Rob Clark
2014-05-28 13:21                   ` Daniel Vetter
2014-05-28 14:14                     ` Ville Syrjälä
2014-05-28 14:50                       ` Daniel Vetter
2014-05-28 15:19                     ` Rob Clark
2014-05-27 23:47                 ` Rob Clark
2014-05-28 13:32                   ` Daniel Vetter
2014-05-24 18:30 ` [PATCH 15/17] drm: spiff out FB refcnting traces Rob Clark
2014-05-24 18:30 ` [PATCH 16/17] drm: more conservative locking Rob Clark
2014-05-24 18:30 ` [PATCH 17/17] drm: Fix up the atomic legacy paths so they work Rob Clark
2014-05-26 10:40 ` [PATCH 00/17] prepare for atomic/nuclear modeset/pageflip Daniel Vetter
2014-05-26 12:48   ` Rob Clark
2014-05-26 15:24     ` Daniel Vetter
2014-05-26 16:12       ` Rob Clark
2014-05-26 17:36         ` Daniel Vetter

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=20140526082333.GW14357@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robdclark@gmail.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