dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "open list:DRM DRIVERS FOR RENESAS"
	<linux-renesas-soc@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm: rcar-du: Replace drm_driver GEM ops with GEM object functions
Date: Tue, 18 Jun 2019 16:26:51 +0300	[thread overview]
Message-ID: <20190618132651.GC21105@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAKMK7uEDmTfyEft4v0vpZsmYTC-jA2pCMMTt=T9r5Dis7gKEmQ@mail.gmail.com>

Hi Daniel,

On Tue, Jun 18, 2019 at 03:21:55PM +0200, Daniel Vetter wrote:
> On Tue, Jun 18, 2019 at 3:13 PM Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> wrote:
> >
> > The recommended way to specify GEM object functions is to provide a
> > drm_gem_object_funcs structure instance and set the GEM object to point
> > to it. The drm_cma_gem_create_object_default_funcs() function provided
> > by the GEM CMA helper does so when creating the GEM object, simplifying
> > the driver implementation. Switch to it, and remove the then unneeded
> > GEM-related opertions from rcar_du_driver.
> >
> > Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> >  drivers/gpu/drm/rcar-du/rcar_du_drv.c | 8 +-------
> >  1 file changed, 1 insertion(+), 7 deletions(-)
> >
> > Daniel, is this what you had in mind ?
> 
> Yup, I think that's it. Noralf commented that we might want to have
> DRM_GEM_CMA_DRIVER_OPS macro for the remaining few drm_driver hooks, like
> DRM_GEM_CMA_VMAP_DRIVER_OPS but without the forced vmap on import. But
> that's ok to do in some follow-up cleanup too. On this:

Note that the rcar-du driver requires a custom .dumb_create() operation,
which is another reason why I can't use DRM_GEM_CMA_VMAP_DRIVER_OPS.

> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > index 3e5e835ea2b6..4cbb82009931 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > @@ -445,16 +445,10 @@ DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);
> >  static struct drm_driver rcar_du_driver = {
> >         .driver_features        = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME
> >                                 | DRIVER_ATOMIC,
> > -       .gem_free_object_unlocked = drm_gem_cma_free_object,
> > -       .gem_vm_ops             = &drm_gem_cma_vm_ops,
> > +       .gem_create_object      = drm_cma_gem_create_object_default_funcs,
> >         .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
> >         .prime_fd_to_handle     = drm_gem_prime_fd_to_handle,
> > -       .gem_prime_import       = drm_gem_prime_import,
> > -       .gem_prime_export       = drm_gem_prime_export,
> > -       .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
> >         .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
> > -       .gem_prime_vmap         = drm_gem_cma_prime_vmap,
> > -       .gem_prime_vunmap       = drm_gem_cma_prime_vunmap,
> >         .gem_prime_mmap         = drm_gem_cma_prime_mmap,
> >         .dumb_create            = rcar_du_dumb_create,
> >         .fops                   = &rcar_du_fops,

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-06-18 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18 13:13 [PATCH] drm: rcar-du: Replace drm_driver GEM ops with GEM object functions Laurent Pinchart
2019-06-18 13:21 ` Daniel Vetter
2019-06-18 13:26   ` Laurent Pinchart [this message]
2019-06-18 13:57     ` Daniel Vetter
2019-06-18 13:56 ` Noralf Trønnes
2019-06-18 16:35   ` Laurent Pinchart
2019-06-18 17:23     ` Noralf Trønnes
2019-06-19  7:00       ` Noralf Trønnes
2019-06-19  7:42         ` 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=20190618132651.GC21105@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.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;
as well as URLs for NNTP newsgroup(s).