From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>,
dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/6] drm/omap: gem: Merge __omap_gem_get_pages() and omap_gem_attach_pages()
Date: Tue, 24 Apr 2018 14:42:19 +0300 [thread overview]
Message-ID: <13260627.pyUjKArtmO@avalon> (raw)
In-Reply-To: <CAKMK7uF9tRP5wKubCftxHMvkCToGEgUpS-84Whve=cc4FioKjA@mail.gmail.com>
Hello,
On Wednesday, 4 April 2018 19:18:42 EEST Daniel Vetter wrote:
> On Wed, Apr 4, 2018 at 3:37 PM, Lucas Stach <l.stach@pengutronix.de> wrote:
> > Am Montag, den 02.04.2018, 21:50 +0300 schrieb Laurent Pinchart:
> >> The __omap_gem_get_pages() function is a wrapper around
> >> omap_gem_attach_pages() that returns the omap_obj->pages pointer through
> >> a function argument. Some callers don't need the pages pointer, and all
> >> of them can access omap_obj->pages directly. To simplify the code merge
> >> the __omap_gem_get_pages() wrapper with omap_gem_attach_pages() and
> >> update the callers accordingly.
> >>
> >> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >>
> >> ---
> >>
> >> drivers/gpu/drm/omapdrm/omap_gem.c | 62 ++++++++++++--------------------
> >> 1 file changed, 23 insertions(+), 39 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c
> >> b/drivers/gpu/drm/omapdrm/omap_gem.c index 6cfcf60cffe3..13fea207343e
> >> 100644
> >> --- a/drivers/gpu/drm/omapdrm/omap_gem.c
> >> +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
> >> @@ -222,7 +222,10 @@ static void omap_gem_evict(struct drm_gem_object
> >> *obj)
> >> * Page Management
> >> */
> >>
> >> -/** ensure backing pages are allocated */
> >> +/*
> >> + * Ensure backing pages are allocated. Must be called with the
> >> omap_obj.lock
> >> + * held.
> >> + */
> >
> > Drive-by comment: I always find it hard to validate those comment-only
> > lock prerequisites, especially if callstacks get deeper.
> >
> > What we do in etnaviv is to make those lock comments executable by
> > using lockdep_assert_held() to validate the locking assumptions. This
> > makes sure that if you ever manage to violate the locking in a code
> > rework, a lockdep enabled debug build will explode right at the spot.
>
> +1 on this. I've gone as far as removing all the locking related
> comments in core drm code because most of it was misleading or
> outright wrong. The runtime checks have a much higher chance of
> actually being correct :-)
I agree, I'll fix that in the next version. I plan to keep the comment though,
as I find it easier to read when glancing at the function, but I'll add a
corresponding lockdep_assert_held().
[snip]
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-04-24 11:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 18:50 [PATCH 0/6] omapdrm: struct_mutex removal Laurent Pinchart
2018-04-02 18:50 ` [PATCH 1/6] drm/omap: gem: Rename GEM function with omap_gem_* prefix Laurent Pinchart
2018-04-02 18:50 ` [PATCH 2/6] drm/omap: gem: Merge __omap_gem_get_pages() and omap_gem_attach_pages() Laurent Pinchart
2018-04-04 13:37 ` Lucas Stach
2018-04-04 16:18 ` Daniel Vetter
2018-04-24 11:42 ` Laurent Pinchart [this message]
2018-04-02 18:50 ` [PATCH 3/6] drm/omap: gem: Don't take struct_mutex to get GEM object mmap offset Laurent Pinchart
2018-04-03 8:55 ` Daniel Vetter
2018-04-02 18:50 ` [PATCH 4/6] drm/omap: gem: Replace struct_mutex usage with omap_obj private lock Laurent Pinchart
2018-04-02 18:50 ` [PATCH 5/6] drm/omap: gem: Fix mm_list locking Laurent Pinchart
2018-04-02 18:50 ` [PATCH 6/6] drm/omap: gem: Switch to gem_free_object_unlocked() Laurent Pinchart
2018-05-23 9:42 ` [PATCH 0/6] omapdrm: struct_mutex removal Tomi Valkeinen
2018-05-25 11:15 ` Laurent Pinchart
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=13260627.pyUjKArtmO@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).