drm/dumb-buffers: Fix and improve buffer-size calculation
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest25 patches 11 repliesIn review
- v525 patches 12 repliesSuperseded
- v425 patches 6 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 25 patches | 17 replies | Superseded | |
| v2 | 25 patches | 46 replies | Superseded | |
| v1 | 5 patches | 0 replies | Superseded |
Changes in v6 from the cover letter
- extend TODO item (Tomi)
- fix typos in documentation (Tomi)
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/25 | drm/dumb-buffers: Sanitize output on errorsdrivers/ | +29 | 0 replies | |
| 2/25 | drm/dumb-buffers: Provide helper to set pitch and sizeDocumentation/ drivers/ include/ +1 more | +230 | 0 replies | |
| 3/25 | drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ drivers/ | +8 | 5 replies | |
| 4/25 | drm/gem-shmem: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 0 replies | |
| 5/25 | drm/gem-vram: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +23 | 0 replies | |
| 6/25 | drm/armada: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +7 | 0 replies | |
| 7/25 | drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 0 replies | |
| 8/25 | drm/gma500: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +6 | 0 replies | |
| 9/25 | drm/hibmc: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ drivers/ include/ | +24 | 0 replies | |
| 10/25 | drm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +23 | 0 replies | |
| 11/25 | drm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +8 | 0 replies | |
| 12/25 | drm/mediatek: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +4 | 0 replies | |
| 13/25 | drm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +25 | 1 reply | |
| 14/25 | drm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +4 | 0 replies | |
| 15/25 | drm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +7 | 0 replies | |
| 16/25 | drm/qxl: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +8 | 0 replies | |
| 17/25 | drm/renesas/rcar-du: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 0 replies | |
| 18/25 | drm/renesas/rz-du: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 3 replies | |
| 19/25 | drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +6 | 0 replies | |
| 20/25 | drm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 0 replies | |
| 21/25 | drm/virtio: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 0 replies | |
| 22/25 | drm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +4 | 0 replies | |
| 23/25 | drm/xe: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +4 | 1 reply | |
| 24/25 | drm/xen: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 0 replies | |
| 25/25 | drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()drivers/ | +5 | 0 replies |
Reviews trailers per patch
16 of 25 patches have a Reviewed-by or Acked-by.
| Patch | Tomi Valkeinen | Inki Dae | Philipp Zabel | Sui Jingfeng | Dmitry Baryshkov | Lyude Paul | Thierry Reding | Zack Rusin | Laurent Pinchart | Heiko Stuebner | Matthew Auld | Biju Das | Lucas De Marchi |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1/25 | R-b | ||||||||||||
| 2/25 | R-b R-b | ||||||||||||
| 3/25 | R-b | ||||||||||||
| 4/25 | R-b | ||||||||||||
| 5/25 | |||||||||||||
| 6/25 | |||||||||||||
| 7/25 | A-b | ||||||||||||
| 8/25 | |||||||||||||
| 9/25 | |||||||||||||
| 10/25 | R-b | ||||||||||||
| 11/25 | R-b | ||||||||||||
| 12/25 | |||||||||||||
| 13/25 | R-b | ||||||||||||
| 14/25 | R-b | ||||||||||||
| 15/25 | R-b | ||||||||||||
| 16/25 | |||||||||||||
| 17/25 | R-b | R-b | |||||||||||
| 18/25 | T-b | ||||||||||||
| 19/25 | A-b | ||||||||||||
| 20/25 | A-b | ||||||||||||
| 21/25 | |||||||||||||
| 22/25 | R-b | ||||||||||||
| 23/25 | R-b | A-b | |||||||||||
| 24/25 | |||||||||||||
| 25/25 | R-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 13 reviewers.
Cover letter [PATCH v6 00/25] drm/dumb-buffers: Fix and improve buffer-size calculation
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.
v6:
- extend TODO item (Tomi)
- fix typos in documentation (Tomi)
v5:
- use check_mul_overflow() for overflow test (Tomi)
- imx: fix intermediate code (Tomi)
- rz-du: include dumb-buffers header
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 | 37 ++++ drivers/gpu/drm/armada/armada_gem.c | 16 +- drivers/gpu/drm/drm_dumb_buffers.c | 170 ++++++++++++++++-- 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 | 8 +- 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, 457 insertions(+), 228 deletions(-) create mode 100644 include/drm/drm_dumb_buffers.h
Signature · 1 line
2.50.1