dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/3] drm/gem: Add drm_gem_object_funcs
@ 2018-09-21 16:42 Noralf Trønnes
  2018-09-21 16:42 ` [RFC 1/3] drm/driver: Add defaults for .gem_prime_export/import callbacks Noralf Trønnes
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Noralf Trønnes @ 2018-09-21 16:42 UTC (permalink / raw)
  To: dri-devel

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

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-09-24 14:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [RFC 0/3] drm/gem: Add drm_gem_object_funcs Daniel Vetter
2018-09-22 15:57   ` Noralf Trønnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox