Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>,
	ML dri-devel <dri-devel@lists.freedesktop.org>,
	Sean Paul <sean@poorly.run>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 10/36] drm/gem: add _locked suffix to drm_object_put
Date: Fri, 8 May 2020 13:25:19 +0200	[thread overview]
Message-ID: <20200508112519.GI1383626@phenom.ffwll.local> (raw)
In-Reply-To: <CACvgo53fa1R3gD8hCg+Ch2Tj0ZnDVScNXiZO5FbGfK_VbAP_nQ@mail.gmail.com>

On Fri, May 08, 2020 at 12:00:40PM +0100, Emil Velikov wrote:
> On Fri, 8 May 2020 at 07:40, Daniel Vetter <daniel@ffwll.ch> wrote:
> >
> > On Thu, May 07, 2020 at 04:07:56PM +0100, Emil Velikov wrote:
> > > From: Emil Velikov <emil.velikov@collabora.com>
> > >
> > > Vast majority of DRM (core and drivers) are struct_mutex free.
> > >
> > > As such we have only a handful of cases where the locked helper should
> > > be used. Make that stand out a little bit better.
> > >
> > > Done via the following script:
> > >
> > > __from=drm_gem_object_put
> > > __to=drm_gem_object_put_locked
> > >
> > > for __file in $(git grep --name-only --word-regexp $__from); do
> > >   sed -i  "s/\<$__from\>/$__to/g" $__file;
> > > done
> > >
> > > Cc: Rob Clark <robdclark@gmail.com>
> > > Cc: Sean Paul <sean@poorly.run>
> > > Cc: linux-arm-msm@vger.kernel.org
> > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> >
> > Since
> >
> > commit 48e7f18392c66f9b69ebac11c54f1a2e033ced54
> > Author: Kristian H. Kristensen <hoegsberg@gmail.com>
> > Date:   Wed Mar 20 10:09:08 2019 -0700
> >
> >     drm/msm: Implement .gem_free_object_unlocked
> >
> > msm doesn't need the struct_mutex in the bo_put anymore, the only reason
> > we had to use the _locked version here is historical accidents I think.
> >
> > I think you could convert these all to the _unlocked variant and then
> > entirely drop the _locked version.
> >
> Did not check the msm driver closely, but it makes sense. Let's keep
> that as follow-up series?
> We're already at 36 patches, plus mixing mostly mechanical and locking
> changes doesn't sound wise.

My idea was to simply throw this patch out, and replace it by an msm patch
to switch over to the unlocked variant.

Well maybe then needs 2nd patch to throw the locked version out.

So feels a bit a detour to touch msm twice, which is why I suggested to do
the more direct route. But if you feel strongly I guess we can go this way
and then follow up with converting msm to unlocked and throwing the
_locked variant out for good too.
-Daniel


> > Once we have that we could move struct_mutex into each driver (at least
> > for msm and i915) since it's purely internal, and then wrap it in an
> > #ifdef CONFIG_DRM_LEGACY to gloriously sunset it all :-)
> >
> Indeed, we're nearly there.
> 
> -Emil

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

      reply	other threads:[~2020-05-08 11:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200507150822.114464-1-emil.l.velikov@gmail.com>
2020-05-07 15:07 ` [PATCH 10/36] drm/gem: add _locked suffix to drm_object_put Emil Velikov
2020-05-08  6:40   ` Daniel Vetter
2020-05-08 11:00     ` Emil Velikov
2020-05-08 11:25       ` Daniel Vetter [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=20200508112519.GI1383626@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=sean@poorly.run \
    /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