From: Thomas Zimmermann <tzimmermann@suse.de>
To: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, simona@ffwll.ch, p.zabel@pengutronix.de
Cc: dri-devel@lists.freedesktop.org, imx@lists.linux.dev,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 0/5] drm/dumb-buffers: Fix and improve buffer-size calculation
Date: Mon, 11 Nov 2024 15:23:02 +0100 [thread overview]
Message-ID: <20241111143114.631690-1-tzimmermann@suse.de> (raw)
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
next reply other threads:[~2024-11-11 14:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-11 14:23 Thomas Zimmermann [this message]
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
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=20241111143114.631690-1-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=imx@lists.linux.dev \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=simona@ffwll.ch \
/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