Skip to content

drm: Provide framebuffer vmap helpers

Thomas Zimmermann dri-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 4 repliesIn review
  2. v25 patches 7 repliesSuperseded
  3. v15 patches 3 repliesSuperseded

Changes in v3 from the cover letter

* free instances of struct vkms_writeback_job on cleanup or errors

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5drm: Define DRM_FORMAT_MAX_PLANESdrivers/gpu/drm/drm_gem_framebuffer_helper.c include/drm/drm_fourcc.h include/drm/drm_framebuffer.h +1 more+26 -170 replies
2/5drm/gem: Provide drm_gem_fb_{vmap,vunmap}()drivers/gpu/drm/drm_gem_atomic_helper.c drivers/gpu/drm/drm_gem_framebuffer_helper.c include/drm/drm_gem_framebuffer_helper.h+82 -340 replies
3/5drm/gem: Clear mapping addresses for unused framebuffer planesdrivers/gpu/drm/drm_gem_framebuffer_helper.c+5 -10 replies
4/5drm/gud: Map framebuffer BOs with drm_gem_fb_vmap()drivers/gpu/drm/gud/gud_pipe.c+5 -54 replies
5/5drm/vkms: Map output framebuffer BOs with drm_gem_fb_vmap()drivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_drv.h drivers/gpu/drm/vkms/vkms_writeback.c+22 -140 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchSam RavnborgRodrigo SiqueiraNoralf Trønnes
1/5R-b
2/5R-b
3/5R-b
4/5A-b A-b
5/5A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/5] drm: Provide framebuffer vmap helpers

Add the new helpers drm_gem_fb_vmap() and drm_gem_fb_vunmap(), which provide vmap/vunmap for all BOs of a framebuffer. Convert shadow- plane helpers, gud and vkms.

Callers of GEM vmap and vunmap functions used to do the minimum work or get some detail wrong. Therefore shadow-plane helpers were intro- duced to implement the details for all callers. The vmapping code in the shadow-plane helpers is also useful for gud and vkms. So it makes sense to provide rsp helpers. Simply call drm_gem_fb_vmap() to retrieve mappings of all of a framebuffer's BOs.

Future work: besides the mapping's addresses, drm_gem_fb_vmap() should also return the mappings with the framebuffer data offset added. These are the addresses were the actual image data is located. A follow-up set of patches will implement this feature.

v3:
* free instances of struct vkms_writeback_job on cleanup or errors
v2:
* update commit message for first patch (Maxime)
* fix error handling after DRM_FORMAT_MAX_PLANES changes (kernel test robot)
* fix includes (kernel test robot)
* use [static N] notations for array parameters

Thomas Zimmermann (5):
drm: Define DRM_FORMAT_MAX_PLANES
drm/gem: Provide drm_gem_fb_{vmap,vunmap}()
drm/gem: Clear mapping addresses for unused framebuffer planes drm/gud: Map framebuffer BOs with drm_gem_fb_vmap() drm/vkms: Map output framebuffer BOs with drm_gem_fb_vmap()

 drivers/gpu/drm/drm_gem_atomic_helper.c      | 37 +-------
 drivers/gpu/drm/drm_gem_framebuffer_helper.c | 96 ++++++++++++++++++--
 drivers/gpu/drm/gud/gud_pipe.c               | 10 +-
 drivers/gpu/drm/vkms/vkms_composer.c         |  2 +-
 drivers/gpu/drm/vkms/vkms_drv.h              |  6 +-
 drivers/gpu/drm/vkms/vkms_writeback.c        | 28 +++---
 include/drm/drm_fourcc.h                     | 13 ++-
 include/drm/drm_framebuffer.h                |  8 +-
 include/drm/drm_gem_atomic_helper.h          |  3 +-
 include/drm/drm_gem_framebuffer_helper.h     |  6 ++
 10 files changed, 139 insertions(+), 70 deletions(-)

base-commit: 2bda1ca4d4acb4892556fec3a7ea1f02afcd40bb
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24 --
2.32.0