dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [RFC 0/3] drm/gem: Add drm_gem_object_funcs
Date: Sat, 22 Sep 2018 12:04:02 +0200	[thread overview]
Message-ID: <20180922100402.GO11082@phenom.ffwll.local> (raw)
In-Reply-To: <20180921164230.51838-1-noralf@tronnes.org>

On Fri, Sep 21, 2018 at 06:42:27PM +0200, Noralf Trønnes wrote:
> Hi,
> 
> I've found it odd that the GEM object has its callbacks on drm_driver
> and not a vtable of its own. But something being odd isn't enough to
> make a change (me thinks).
> 
> After working on the GEM shmem helper I saw that a few drivers have
> runtime support for 2 memory types for their buffers (shmem,vram,cma).
> I have realised that if the shmem helper was self contained wrt the
> callbacks, it would be easier for these types of drivers to use the
> helper. All they needed to do was to determine the buffer type on GEM
> object creation time and let the helper handle the rest of the
> callbacks.
> 
> No sure if this makes sense or if the approach is to simplistic. Hence
> the RFC.
> 
> I've added a patch to give an example of how this would look for the CMA
> helper and vc4 (I'm not volunteering to refactor the CMA helper and
> drivers).

I very much like, the drm_driver dumping ground has been a sore spot for
me for a long time, and the per-object callback structures look so much
nicer in kms. That's why I also really liked moving all the vblank stuff
from drm_driver to the drm_crtc_(helper_)funcs struct.

Cheers, Daniel
> 
> Noralf.
> 
> Noralf Trønnes (3):
>   drm/driver: Add defaults for .gem_prime_export/import callbacks
>   drm/gem: Add drm_gem_object_funcs
>   drm/cma: Use drm_gem_object_funcs
> 
>  Documentation/gpu/todo.rst           |   7 ++
>  drivers/gpu/drm/drm_client.c         |  12 ++-
>  drivers/gpu/drm/drm_fb_helper.c      |   8 +-
>  drivers/gpu/drm/drm_gem.c            | 108 +++++++++++++++++++++++++--
>  drivers/gpu/drm/drm_gem_cma_helper.c |  99 +++++++++----------------
>  drivers/gpu/drm/drm_prime.c          |  50 +++++++------
>  drivers/gpu/drm/vc4/vc4_bo.c         |  46 ++++++------
>  drivers/gpu/drm/vc4/vc4_drv.c        |  26 +------
>  drivers/gpu/drm/vc4/vc4_drv.h        |   6 +-
>  include/drm/drm_drv.h                |   4 +
>  include/drm/drm_gem.h                | 138 +++++++++++++++++++++++++++++++++++
>  include/drm/drm_gem_cma_helper.h     |  17 +----
>  12 files changed, 350 insertions(+), 171 deletions(-)
> 
> -- 
> 2.15.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
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

  parent reply	other threads:[~2018-09-22 10:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 16:42 [RFC 0/3] drm/gem: Add drm_gem_object_funcs Noralf Trønnes
2018-09-21 16:42 ` [RFC 1/3] drm/driver: Add defaults for .gem_prime_export/import callbacks Noralf Trønnes
2018-09-22 10:10   ` Daniel Vetter
2018-09-22 15:58     ` Noralf Trønnes
2018-09-24 14:47       ` Daniel Vetter
2018-09-21 16:42 ` [RFC 2/3] drm/gem: Add drm_gem_object_funcs Noralf Trønnes
2018-09-22 10:41   ` Daniel Vetter
2018-09-22 16:01     ` Noralf Trønnes
2018-09-24 14:54       ` Daniel Vetter
2018-09-21 16:42 ` [RFC 3/3] drm/cma: Use drm_gem_object_funcs Noralf Trønnes
2018-09-22 10:04 ` Daniel Vetter [this message]
2018-09-22 15:57   ` [RFC 0/3] drm/gem: Add drm_gem_object_funcs Noralf Trønnes

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=20180922100402.GO11082@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=noralf@tronnes.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