dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maarten Lankhorst <m.b.lankhorst@gmail.com>,
	Nouveau Dev <nouveau@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Ben Skeggs <bskeggs@redhat.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/nouveau: Drop mutex_lock_nested for atomic
Date: Thu, 17 Sep 2020 15:15:31 +0200	[thread overview]
Message-ID: <CAKMK7uHbdcLMJONxR5OZXBLtm0WVxT117mBD72RDW5MRQ=ky4g@mail.gmail.com> (raw)
In-Reply-To: <579702ca-4b4e-0b05-1b93-25b99554d464@linux.intel.com>

Ben, did you have a chance to look at this?
-Daniel

On Mon, Aug 3, 2020 at 1:22 PM Maarten Lankhorst
<maarten.lankhorst@linux.intel.com> wrote:
>
> Op 02-08-2020 om 20:18 schreef Daniel Vetter:
> > Purely conjecture, but I think the original locking inversion with the
> > legacy page flip code between flipping and ttm's bo move function
> > shoudn't exist anymore with atomic: With atomic the bo pinning and
> > actual modeset commit is completely separated in the code patsh.
> >
> > This annotation was originally added in
> >
> > commit 060810d7abaabcab282e062c595871d661561400
> > Author: Ben Skeggs <bskeggs@redhat.com>
> > Date:   Mon Jul 8 14:15:51 2013 +1000
> >
> >     drm/nouveau: fix locking issues in page flipping paths
> >
> > due to
> >
> > commit b580c9e2b7ba5030a795aa2fb73b796523d65a78
> > Author: Maarten Lankhorst <m.b.lankhorst@gmail.com>
> > Date:   Thu Jun 27 13:48:18 2013 +0200
> >
> >     drm/nouveau: make flipping lockdep safe
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Maarten Lankhorst <m.b.lankhorst@gmail.com>
> > Cc: Ben Skeggs <bskeggs@redhat.com>
> > Cc: Dave Airlie <airlied@gmail.com>
> > Cc: nouveau@lists.freedesktop.org
> > ---
> > I might be totally wrong, so this definitely needs testing :-)
> >
> > Cheers, Daniel
> > ---
> >  drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> > index 7806278dce57..a7b2a9bb0ffe 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
> >                       return ret;
> >       }
> >
> > -     mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > +     if (drm_drv_uses_atomic_modeset(drm->dev))
> > +             mutex_lock(&cli->mutex);
> > +     else
> > +             mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
> > +
> >       ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, intr);
> >       if (ret == 0) {
> >               ret = drm->ttm.move(chan, bo, &bo->mem, new_reg);
>
> Well if you're certain it works now. :)
>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>


-- 
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:[~2020-09-17 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 18:18 [PATCH] drm/nouveau: Drop mutex_lock_nested for atomic Daniel Vetter
2020-08-03 11:22 ` Maarten Lankhorst
2020-09-17 13:15   ` Daniel Vetter [this message]
2020-09-29 14:52     ` Daniel Vetter
2020-09-30  0:45       ` [Nouveau] " Ben Skeggs
2020-09-30  9:37         ` Daniel Vetter
2020-09-30 22:46           ` Ben Skeggs
2020-10-23 12:38             ` 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='CAKMK7uHbdcLMJONxR5OZXBLtm0WVxT117mBD72RDW5MRQ=ky4g@mail.gmail.com' \
    --to=daniel.vetter@ffwll.ch \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=m.b.lankhorst@gmail.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=nouveau@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).