Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/dumb-buffers: Fix and improve buffer-size calculation
@ 2024-11-11 14:23 Thomas Zimmermann
  2024-11-11 14:23 ` [PATCH 1/5] drm/dumb-buffers: Sanitize output on errors Thomas Zimmermann
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2024-11-11 14:23 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, simona, p.zabel
  Cc: dri-devel, imx, Thomas Zimmermann

Dumb-buffer pitch and size is specified by width, height, bits-per-pixel
plus various hardware-specific alignments. The calculation of these
values is inconsistent and duplicated among drivers. The results for
formats with bpp < 8 are incorrect.

This series begins to fix this. Default scanline pitch and buffer size
are now calculated with the existing 4CC helpers. The results are
provided to drivers to avoid recalculating them. The series fixes the
3 common GEM implementations for DMA, SHMEM and VRAM. Other memory
managers can later be addressed separately.

Thomas Zimmermann (5):
  drm/dumb-buffers: Sanitize output on errors
  drm/dumb-buffers: Fix size calculations and set default pitch and size
  drm/gem-dma: Use aligned default pitch and size for dumb buffers
  drm/gem-shmem: Use aligned default pitch and size for dumb buffers
  drm/gem-vram: Use default pitch and size for dumb buffers

 drivers/gpu/drm/drm_dumb_buffers.c       | 123 +++++++++++++++++------
 drivers/gpu/drm/drm_gem_dma_helper.c     |   7 +-
 drivers/gpu/drm/drm_gem_shmem_helper.c   |  16 +--
 drivers/gpu/drm/drm_gem_vram_helper.c    |  24 ++++-
 drivers/gpu/drm/imx/ipuv3/imx-drm-core.c |   2 +
 include/drm/drm_dumb_buffers.h           |  12 +++
 6 files changed, 141 insertions(+), 43 deletions(-)
 create mode 100644 include/drm/drm_dumb_buffers.h

-- 
2.47.0


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

end of thread, other threads:[~2024-11-11 14:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11 14:23 [PATCH 0/5] drm/dumb-buffers: Fix and improve buffer-size calculation Thomas Zimmermann
2024-11-11 14:23 ` [PATCH 1/5] drm/dumb-buffers: Sanitize output on errors Thomas Zimmermann
2024-11-11 14:23 ` [PATCH 2/5] drm/dumb-buffers: Fix size calculations and set default pitch and size Thomas Zimmermann
2024-11-11 14:23 ` [PATCH 3/5] drm/gem-dma: Use aligned default pitch and size for dumb buffers Thomas Zimmermann
2024-11-11 14:23 ` [PATCH 4/5] drm/gem-shmem: " Thomas Zimmermann
2024-11-11 14:23 ` [PATCH 5/5] drm/gem-vram: Use " Thomas Zimmermann

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