[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 00/25] drm/dumb-buffers: Fix and improve buffer-size calculation
- To: simona@xxxxxxxx, airlied@xxxxxxxxx, mripard@xxxxxxxxxx, maarten.lankhorst@xxxxxxxxxxxxxxx, geert@xxxxxxxxxxxxxx, tomi.valkeinen@xxxxxxxxxxxxxxxx
- From: Thomas Zimmermann <tzimmermann@xxxxxxx>
- Date: Wed, 28 May 2025 10:23:41 +0200
- Authentication-results: smtp-out1.suse.de; none
- Autocrypt: addr=tzimmermann@xxxxxxx; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb U6B1BkX2XDKDGffF4TxlOpSQzdtNI/9gleOoUA8+jy8knnDYzjBNOZqLG2FuTdicBXblz0Mf vg41gd9kCwYXDnD91rJU8tzylXv03E75NCaTx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xxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxx, spice-devel@xxxxxxxxxxxxxxxxxxxxx, linux-renesas-soc@xxxxxxxxxxxxxxx, linux-rockchip@xxxxxxxxxxxxxxxxxxx, linux-tegra@xxxxxxxxxxxxxxx, intel-xe@xxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 28 May 2025 08:23:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
ping
I'm still looking for more reviews; especially patches 1 and 2.
Best regards
Thomas
Am 11.03.25 um 16:47 schrieb 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 sometimes incorrect.
This series fixes this for most drivers. Default scanline pitch and
buffer size are now calculated with the existing 4CC helpers. There is
a new helper drm_mode_size_dumb() that calculates scanline pitch and
buffer size according to driver requirements.
The series fixes the common GEM implementations for DMA, SHMEM and
VRAM. It further changes most implementations of dumb_create to use
the new helper. A small number of drivers has more complicated
calculations and will be updated by a later patches.
v4:
- improve UAPI documentation
- document bpp special cases
- use drm_warn_once()
- add TODO lists
- armada: fix pitch alignment
v3:
- document UAPI semantics
- fall back to bpp-based allocation for unknown color modes
- cleanups
v2:
- rewrite series
- convert many individual drivers besides the shared GEM helpers
Thomas Zimmermann (25):
drm/dumb-buffers: Sanitize output on errors
drm/dumb-buffers: Provide helper to set pitch and size
drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/gem-shmem: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/gem-vram: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/armada: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/gma500: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/hibmc: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/mediatek: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/qxl: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/renesas/rcar-du: Compute dumb-buffer sizes with
drm_mode_size_dumb()
drm/renesas/rz-du: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/virtio: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/xe: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/xen: Compute dumb-buffer sizes with drm_mode_size_dumb()
drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
Documentation/gpu/todo.rst | 28 +++
drivers/gpu/drm/armada/armada_gem.c | 16 +-
drivers/gpu/drm/drm_dumb_buffers.c | 172 ++++++++++++++++--
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 | 89 +++------
drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 +-
drivers/gpu/drm/gma500/gem.c | 21 +--
.../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 25 ++-
drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 29 ++-
drivers/gpu/drm/loongson/lsdc_gem.c | 29 +--
drivers/gpu/drm/mediatek/mtk_gem.c | 13 +-
drivers/gpu/drm/msm/msm_gem.c | 27 ++-
drivers/gpu/drm/nouveau/nouveau_display.c | 7 +-
drivers/gpu/drm/omapdrm/omap_gem.c | 15 +-
drivers/gpu/drm/qxl/qxl_dumb.c | 17 +-
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 7 +-
drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 7 +-
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 12 +-
drivers/gpu/drm/tegra/gem.c | 8 +-
drivers/gpu/drm/virtio/virtgpu_gem.c | 11 +-
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 21 +--
drivers/gpu/drm/xe/xe_bo.c | 8 +-
drivers/gpu/drm/xen/xen_drm_front.c | 7 +-
drivers/gpu/drm/xlnx/zynqmp_kms.c | 7 +-
include/drm/drm_dumb_buffers.h | 14 ++
include/drm/drm_gem_vram_helper.h | 6 -
include/uapi/drm/drm_mode.h | 50 ++++-
28 files changed, 449 insertions(+), 228 deletions(-)
create mode 100644 include/drm/drm_dumb_buffers.h
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
|