]> Gentwo Git Trees - linux/.git/commit
drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 21 Aug 2025 08:17:10 +0000 (10:17 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 29 Sep 2025 11:57:44 +0000 (13:57 +0200)
commitdcacfcd35cef2edb2854e2a04f204e309a8a2605
treee3d4c69301cef222fdf5007f04f06cdb1f6e7fba
parentfb24aaf5415cc686fb0473eb782a7c8a7bab0469
drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch to a multiple of 8.

Push the current calculation into the only direct caller imx. Imx's
hardware requires the framebuffer width to be aligned to 8. The
driver's current approach is actually incorrect, as it only guarantees
this implicitly and requires bpp to be a multiple of 8 already. A
later commit will fix this problem by aligning the scanline pitch
such that an aligned width still fits into each scanline's memory.

A number of other drivers are build on top of gem-dma helpers and
implement their own dumb-buffer allocation. These drivers invoke
drm_gem_dma_dumb_create_internal(), which is not affected by this
commit.

v5:
- avoid reset of arguments (Tomi)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-4-tzimmermann@suse.de
drivers/gpu/drm/drm_gem_dma_helper.c
drivers/gpu/drm/imx/ipuv3/imx-drm-core.c