From: Daniel Vetter <daniel@ffwll.ch>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>,
Ben Widawsky <ben@bwidawsk.net>,
David Lechner <david@lechnology.com>,
Neil Armstrong <narmstrong@baylibre.com>,
David Airlie <airlied@linux.ie>,
DRI Development <dri-devel@lists.freedesktop.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Daniel Vetter <daniel.vetter@intel.com>,
Shawn Guo <shawnguo@kernel.org>,
Daniel Stone <daniels@collabora.com>
Subject: Re: [PATCH 2/9] drm: Move simple_display_pipe prepare_fb helper into gem fb helpers
Date: Mon, 9 Apr 2018 10:42:14 +0200 [thread overview]
Message-ID: <20180409084214.GQ31310@phenom.ffwll.local> (raw)
In-Reply-To: <ad48f829-3da8-e1dd-2680-c17aa977b4e1@tronnes.org>
On Fri, Apr 06, 2018 at 11:42:42AM +0200, Noralf Trønnes wrote:
>
> Den 05.04.2018 17.44, skrev Daniel Vetter:
> > There's nothing tinydrm specific to this, and there's a few more
> > copies of the same in various other drivers.
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Gustavo Padovan <gustavo@padovan.org>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Sean Paul <seanpaul@chromium.org>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: David Lechner <david@lechnology.com>
> > Cc: "Noralf Trønnes" <noralf@tronnes.org>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Shawn Guo <shawnguo@kernel.org>
> > Cc: Neil Armstrong <narmstrong@baylibre.com>
> > Cc: Daniel Stone <daniels@collabora.com>
> > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> > Cc: Ben Widawsky <ben@bwidawsk.net>
> > Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/drm_gem_framebuffer_helper.c | 19 +++++++++++++++++++
> > drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 17 -----------------
> > drivers/gpu/drm/tinydrm/ili9225.c | 2 +-
> > drivers/gpu/drm/tinydrm/mi0283qt.c | 3 ++-
> > drivers/gpu/drm/tinydrm/repaper.c | 2 +-
> > drivers/gpu/drm/tinydrm/st7586.c | 2 +-
> > drivers/gpu/drm/tinydrm/st7735r.c | 2 +-
> > include/drm/drm_gem_framebuffer_helper.h | 3 +++
> > include/drm/drm_simple_kms_helper.h | 3 +++
> > include/drm/tinydrm/tinydrm.h | 2 --
> > 10 files changed, 31 insertions(+), 24 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> > index 4d682a6e8bcb..acfbc0641a06 100644
> > --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> > +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> > @@ -22,6 +22,7 @@
> > #include <drm/drm_gem.h>
> > #include <drm/drm_gem_framebuffer_helper.h>
> > #include <drm/drm_modeset_helper.h>
> > +#include <drm/drm_simple_kms_helper.h>
> > /**
> > * DOC: overview
> > @@ -265,6 +266,24 @@ int drm_gem_fb_prepare_fb(struct drm_plane *plane,
> > }
> > EXPORT_SYMBOL_GPL(drm_gem_fb_prepare_fb);
> > +/**
> > + * drm_gem_fb_simple_display_pipe_prepare_fb - prepare_fb helper for
> > + * &drm_simple_display_pipe
> > + * @pipe: Simple display pipe
> > + * @plane_state: Plane state
> > + *
> > + * This function uses drm_gem_fb_prepare_fb() to check if the plane FB has a
> > + * &dma_buf attached, extracts the exclusive fence and attaches it to plane
> > + * state for the atomic helper to wait on. Drivers can use this as their
> > + * &drm_simple_display_pipe_funcs.prepare_fb callback.
> > + */
> > +int drm_gem_fb_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
> > + struct drm_plane_state *plane_state)
> > +{
> > + return drm_gem_fb_prepare_fb(&pipe->plane, plane_state);
> > +}
> > +EXPORT_SYMBOL(drm_gem_fb_simple_display_pipe_prepare_fb);
> > +
>
> I was suprised that you didn't put this function in drm_simple_kms_helper.c.
> Anyways, thanks for slimming down tinydrm.
It was a coin toss between that and the gem helpers. I tossed for gem :-)
> Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Thanks for the review, I'll pull these all in once more acks/reviews have
shown up.
-Daniel
>
> > /**
> > * drm_gem_fbdev_fb_create - Create a GEM backed &drm_framebuffer for fbdev
> > * emulation
> > diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
> > index e68b528ae64d..7e8e24d0b7a7 100644
> > --- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
> > +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
> > @@ -138,23 +138,6 @@ void tinydrm_display_pipe_update(struct drm_simple_display_pipe *pipe,
> > }
> > EXPORT_SYMBOL(tinydrm_display_pipe_update);
> > -/**
> > - * tinydrm_display_pipe_prepare_fb - Display pipe prepare_fb helper
> > - * @pipe: Simple display pipe
> > - * @plane_state: Plane state
> > - *
> > - * This function uses drm_gem_fb_prepare_fb() to check if the plane FB has an
> > - * dma-buf attached, extracts the exclusive fence and attaches it to plane
> > - * state for the atomic helper to wait on. Drivers can use this as their
> > - * &drm_simple_display_pipe_funcs->prepare_fb callback.
> > - */
> > -int tinydrm_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
> > - struct drm_plane_state *plane_state)
> > -{
> > - return drm_gem_fb_prepare_fb(&pipe->plane, plane_state);
> > -}
> > -EXPORT_SYMBOL(tinydrm_display_pipe_prepare_fb);
> > -
> > static int tinydrm_rotate_mode(struct drm_display_mode *mode,
> > unsigned int rotation)
> > {
> > diff --git a/drivers/gpu/drm/tinydrm/ili9225.c b/drivers/gpu/drm/tinydrm/ili9225.c
> > index 0874e877b111..841c69aba059 100644
> > --- a/drivers/gpu/drm/tinydrm/ili9225.c
> > +++ b/drivers/gpu/drm/tinydrm/ili9225.c
> > @@ -354,7 +354,7 @@ static const struct drm_simple_display_pipe_funcs ili9225_pipe_funcs = {
> > .enable = ili9225_pipe_enable,
> > .disable = ili9225_pipe_disable,
> > .update = tinydrm_display_pipe_update,
> > - .prepare_fb = tinydrm_display_pipe_prepare_fb,
> > + .prepare_fb = drm_gem_fb_simple_display_pipe_prepare_fb,
> > };
> > static const struct drm_display_mode ili9225_mode = {
> > diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c
> > index 4e6d2ee94e55..d5ef65179c16 100644
> > --- a/drivers/gpu/drm/tinydrm/mi0283qt.c
> > +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
> > @@ -19,6 +19,7 @@
> > #include <drm/drm_fb_helper.h>
> > #include <drm/drm_modeset_helper.h>
> > +#include <drm/drm_gem_framebuffer_helper.h>
> > #include <drm/tinydrm/mipi-dbi.h>
> > #include <drm/tinydrm/tinydrm-helpers.h>
> > #include <video/mipi_display.h>
> > @@ -134,7 +135,7 @@ static const struct drm_simple_display_pipe_funcs mi0283qt_pipe_funcs = {
> > .enable = mi0283qt_enable,
> > .disable = mipi_dbi_pipe_disable,
> > .update = tinydrm_display_pipe_update,
> > - .prepare_fb = tinydrm_display_pipe_prepare_fb,
> > + .prepare_fb = drm_gem_fb_simple_display_pipe_prepare_fb,
> > };
> > static const struct drm_display_mode mi0283qt_mode = {
> > diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c
> > index bb6f80a81899..1ee6855212a0 100644
> > --- a/drivers/gpu/drm/tinydrm/repaper.c
> > +++ b/drivers/gpu/drm/tinydrm/repaper.c
> > @@ -841,7 +841,7 @@ static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs = {
> > .enable = repaper_pipe_enable,
> > .disable = repaper_pipe_disable,
> > .update = tinydrm_display_pipe_update,
> > - .prepare_fb = tinydrm_display_pipe_prepare_fb,
> > + .prepare_fb = drm_gem_fb_simple_display_pipe_prepare_fb,
> > };
> > static const uint32_t repaper_formats[] = {
> > diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c
> > index 22644b88199a..5c29e3803ecb 100644
> > --- a/drivers/gpu/drm/tinydrm/st7586.c
> > +++ b/drivers/gpu/drm/tinydrm/st7586.c
> > @@ -290,7 +290,7 @@ static const struct drm_simple_display_pipe_funcs st7586_pipe_funcs = {
> > .enable = st7586_pipe_enable,
> > .disable = st7586_pipe_disable,
> > .update = tinydrm_display_pipe_update,
> > - .prepare_fb = tinydrm_display_pipe_prepare_fb,
> > + .prepare_fb = drm_gem_fb_simple_display_pipe_prepare_fb,
> > };
> > static const struct drm_display_mode st7586_mode = {
> > diff --git a/drivers/gpu/drm/tinydrm/st7735r.c b/drivers/gpu/drm/tinydrm/st7735r.c
> > index 189a07894d36..6c7b15c9da4f 100644
> > --- a/drivers/gpu/drm/tinydrm/st7735r.c
> > +++ b/drivers/gpu/drm/tinydrm/st7735r.c
> > @@ -106,7 +106,7 @@ static const struct drm_simple_display_pipe_funcs jd_t18003_t01_pipe_funcs = {
> > .enable = jd_t18003_t01_pipe_enable,
> > .disable = mipi_dbi_pipe_disable,
> > .update = tinydrm_display_pipe_update,
> > - .prepare_fb = tinydrm_display_pipe_prepare_fb,
> > + .prepare_fb = drm_gem_fb_simple_display_pipe_prepare_fb,
> > };
> > static const struct drm_display_mode jd_t18003_t01_mode = {
> > diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h
> > index 5ca7cdc3f527..a38de7eb55b4 100644
> > --- a/include/drm/drm_gem_framebuffer_helper.h
> > +++ b/include/drm/drm_gem_framebuffer_helper.h
> > @@ -10,6 +10,7 @@ struct drm_gem_object;
> > struct drm_mode_fb_cmd2;
> > struct drm_plane;
> > struct drm_plane_state;
> > +struct drm_simple_display_pipe;
> > struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
> > unsigned int plane);
> > @@ -27,6 +28,8 @@ drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
> > int drm_gem_fb_prepare_fb(struct drm_plane *plane,
> > struct drm_plane_state *state);
> > +int drm_gem_fb_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
> > + struct drm_plane_state *plane_state);
> > struct drm_framebuffer *
> > drm_gem_fbdev_fb_create(struct drm_device *dev,
> > diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_helper.h
> > index b02793742317..451960438a29 100644
> > --- a/include/drm/drm_simple_kms_helper.h
> > +++ b/include/drm/drm_simple_kms_helper.h
> > @@ -116,6 +116,9 @@ struct drm_simple_display_pipe_funcs {
> > * Optional, called by &drm_plane_helper_funcs.prepare_fb. Please read
> > * the documentation for the &drm_plane_helper_funcs.prepare_fb hook for
> > * more details.
> > + *
> > + * Drivers which always have their buffers pinned should use
> > + * drm_gem_fb_simple_display_pipe_prepare_fb() for this hook.
> > */
> > int (*prepare_fb)(struct drm_simple_display_pipe *pipe,
> > struct drm_plane_state *plane_state);
> > diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h
> > index 6e2b960e25eb..56e4a916b5e8 100644
> > --- a/include/drm/tinydrm/tinydrm.h
> > +++ b/include/drm/tinydrm/tinydrm.h
> > @@ -95,8 +95,6 @@ void tinydrm_shutdown(struct tinydrm_device *tdev);
> > void tinydrm_display_pipe_update(struct drm_simple_display_pipe *pipe,
> > struct drm_plane_state *old_state);
> > -int tinydrm_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
> > - struct drm_plane_state *plane_state);
> > int
> > tinydrm_display_pipe_init(struct tinydrm_device *tdev,
> > const struct drm_simple_display_pipe_funcs *funcs,
>
--
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
next prev parent reply other threads:[~2018-04-09 8:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 15:44 [PATCH 0/9] implicit fencing clarification Daniel Vetter
2018-04-05 15:44 ` [PATCH 1/9] drm/vmwgfx: Remove no-op prepare/cleanup_fb callbacks Daniel Vetter
2018-04-05 17:06 ` Thomas Hellstrom
2018-04-05 19:59 ` Daniel Vetter
2018-04-05 15:44 ` [PATCH 2/9] drm: Move simple_display_pipe prepare_fb helper into gem fb helpers Daniel Vetter
2018-04-06 9:42 ` Noralf Trønnes
2018-04-09 8:42 ` Daniel Vetter [this message]
2018-04-09 15:23 ` David Lechner
2018-04-10 5:55 ` Oleksandr Andrushchenko
2018-04-05 15:44 ` [PATCH 3/9] drm/tve200: Use simple_display_pipe prepare_fb helper Daniel Vetter
2018-04-06 9:40 ` Linus Walleij
2018-04-05 15:44 ` [PATCH 4/9] drm/pl111: " Daniel Vetter
2018-04-05 15:44 ` [PATCH 5/9] drm/mxsfb: " Daniel Vetter
2018-04-20 21:54 ` Eric Anholt
2018-04-05 15:44 ` [PATCH 6/9] drm/atomic: better doc for implicit vs explicit fencing Daniel Vetter
2018-04-20 22:04 ` Eric Anholt
2018-04-24 12:01 ` Daniel Vetter
2018-04-05 15:44 ` [PATCH 7/9] drm/gem-fb-helper: Always do implicit sync Daniel Vetter
2018-04-20 22:11 ` Eric Anholt
2018-04-24 12:04 ` Daniel Vetter
2018-06-20 12:46 ` Daniel Vetter
2018-04-05 15:44 ` [PATCH 8/9] drm/vc4: Always obey " Daniel Vetter
2018-04-20 22:12 ` Eric Anholt
[not found] ` <20180405154449.23038-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2018-04-05 15:44 ` [PATCH 9/9] drm/msm: Always obey implicit fencing Daniel Vetter
[not found] ` <20180405154449.23038-10-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2018-06-20 9:12 ` Daniel Vetter
2018-04-06 7:38 ` [PATCH 0/9] implicit fencing clarification Oleksandr Andrushchenko
2018-04-09 8:44 ` Daniel Vetter
2018-04-09 8:51 ` [PATCH] drm/xen-front: use simple display pipe prepare_fb helper Daniel Vetter
2018-04-10 5:56 ` Oleksandr Andrushchenko
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=20180409084214.GQ31310@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=ben@bwidawsk.net \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=daniels@collabora.com \
--cc=david@lechnology.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=narmstrong@baylibre.com \
--cc=noralf@tronnes.org \
--cc=shawnguo@kernel.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