[PATCH v3 00/12] drm/msm/dpu: rework format handling code

Dmitry Baryshkov posted 12 patches 2 months, 3 weeks ago
drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c    |  174 ++--
drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h | 1155 ------------------------
drivers/gpu/drm/msm/disp/mdp_format.c          |  614 +++++++------
3 files changed, 391 insertions(+), 1552 deletions(-)
[PATCH v3 00/12] drm/msm/dpu: rework format handling code
Posted by Dmitry Baryshkov 2 months, 3 weeks ago
- Rework mdp_format.c in order to make format table manageable
- Rework layout population for UBWC formats in DPU driver

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Changes in v3:
- Readded disappeared YUV flag to PSEUDO_YUV_FMT_TILED
- Link to v2: https://lore.kernel.org/r/20250905-dpu-formats-v2-0-7a674028c048@oss.qualcomm.com

Changes in v2:
- Dropped DX flag from the tiled NV12 format structure (Jessica)
- Changed round_up(foo, 192) to the roundup() as the former one is
  supposed to be used with power of 2 argument (Jessica)
- Fixed undefined varuables warning in
  _dpu_format_populate_plane_sizes_ubwc() by dropping the always-true
  condition (LKP)
- Link to v1: https://lore.kernel.org/r/20250705-dpu-formats-v1-0-40f0bb31b8c8@oss.qualcomm.com

---
Dmitry Baryshkov (12):
      drm/msm/disp: set num_planes to 1 for interleaved YUV formats
      drm/msm/disp: set num_planes and fetch_mode in INTERLEAVED_RGB_FMT
      drm/msm/disp: set num_planes, fetch_mode and tile_height in INTERLEAVED_RGB_FMT_TILED
      drm/msm/disp: simplify RGB{,A,X} formats definitions
      drm/msm/disp: simplify tiled RGB{,A,X} formats definitions
      drm/msm/disp: pull in common YUV format parameters
      drm/msm/disp: pull in common tiled YUV format parameters
      drm/msm/disp: drop PSEUDO_YUV_FMT_LOOSE_TILED
      drm/msm/dpu: simplify _dpu_format_populate_plane_sizes_*
      drm/msm/dpu: drop redundant num_planes assignment in _dpu_format_populate_plane_sizes*()
      drm/msm/dpu: rewrite _dpu_format_populate_plane_sizes_ubwc()
      drm/msm/dpu: use standard functions in _dpu_format_populate_plane_sizes_ubwc()

 drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c    |  174 ++--
 drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h | 1155 ------------------------
 drivers/gpu/drm/msm/disp/mdp_format.c          |  614 +++++++------
 3 files changed, 391 insertions(+), 1552 deletions(-)
---
base-commit: b179ce312bafcb8c68dc718e015aee79b7939ff0
change-id: 20250705-dpu-formats-0d5ae4d1a1b9

Best regards,
-- 
With best wishes
Dmitry
Re: [PATCH v3 00/12] drm/msm/dpu: rework format handling code
Posted by Dmitry Baryshkov 3 weeks, 2 days ago
On Fri, 14 Nov 2025 05:43:27 +0200, Dmitry Baryshkov wrote:
> - Rework mdp_format.c in order to make format table manageable
> - Rework layout population for UBWC formats in DPU driver
> 
> 

Applied to msm-next, thanks!

[01/12] drm/msm/disp: set num_planes to 1 for interleaved YUV formats
        https://gitlab.freedesktop.org/lumag/msm/-/commit/6421e1c5075b
[02/12] drm/msm/disp: set num_planes and fetch_mode in INTERLEAVED_RGB_FMT
        https://gitlab.freedesktop.org/lumag/msm/-/commit/4066b57678b0
[03/12] drm/msm/disp: set num_planes, fetch_mode and tile_height in INTERLEAVED_RGB_FMT_TILED
        https://gitlab.freedesktop.org/lumag/msm/-/commit/adcd6dfea82e
[04/12] drm/msm/disp: simplify RGB{,A,X} formats definitions
        https://gitlab.freedesktop.org/lumag/msm/-/commit/8549e95a4b54
[05/12] drm/msm/disp: simplify tiled RGB{,A,X} formats definitions
        https://gitlab.freedesktop.org/lumag/msm/-/commit/2bd6ae0edf76
[06/12] drm/msm/disp: pull in common YUV format parameters
        https://gitlab.freedesktop.org/lumag/msm/-/commit/72ca4e9d0410
[07/12] drm/msm/disp: pull in common tiled YUV format parameters
        https://gitlab.freedesktop.org/lumag/msm/-/commit/a4378e4bb138
[08/12] drm/msm/disp: drop PSEUDO_YUV_FMT_LOOSE_TILED
        https://gitlab.freedesktop.org/lumag/msm/-/commit/3705de1965df
[09/12] drm/msm/dpu: simplify _dpu_format_populate_plane_sizes_*
        https://gitlab.freedesktop.org/lumag/msm/-/commit/72f20360d4cc
[10/12] drm/msm/dpu: drop redundant num_planes assignment in _dpu_format_populate_plane_sizes*()
        https://gitlab.freedesktop.org/lumag/msm/-/commit/d4db3a06c5ba
[11/12] drm/msm/dpu: rewrite _dpu_format_populate_plane_sizes_ubwc()
        https://gitlab.freedesktop.org/lumag/msm/-/commit/ada4a19ed21c
[12/12] drm/msm/dpu: use standard functions in _dpu_format_populate_plane_sizes_ubwc()
        https://gitlab.freedesktop.org/lumag/msm/-/commit/2f3ff6ab8f5c

Best regards,
-- 
With best wishes
Dmitry
Re: [PATCH v3 00/12] drm/msm/dpu: rework format handling code
Posted by Luca Weiss 1 month ago
On Fri Nov 14, 2025 at 4:43 AM CET, Dmitry Baryshkov wrote:
> - Rework mdp_format.c in order to make format table manageable
> - Rework layout population for UBWC formats in DPU driver
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> Changes in v3:
> - Readded disappeared YUV flag to PSEUDO_YUV_FMT_TILED
> - Link to v2: https://lore.kernel.org/r/20250905-dpu-formats-v2-0-7a674028c048@oss.qualcomm.com
>
> Changes in v2:
> - Dropped DX flag from the tiled NV12 format structure (Jessica)
> - Changed round_up(foo, 192) to the roundup() as the former one is
>   supposed to be used with power of 2 argument (Jessica)
> - Fixed undefined varuables warning in
>   _dpu_format_populate_plane_sizes_ubwc() by dropping the always-true
>   condition (LKP)
> - Link to v1: https://lore.kernel.org/r/20250705-dpu-formats-v1-0-40f0bb31b8c8@oss.qualcomm.com
>
> ---
> Dmitry Baryshkov (12):
>       drm/msm/disp: set num_planes to 1 for interleaved YUV formats
>       drm/msm/disp: set num_planes and fetch_mode in INTERLEAVED_RGB_FMT
>       drm/msm/disp: set num_planes, fetch_mode and tile_height in INTERLEAVED_RGB_FMT_TILED
>       drm/msm/disp: simplify RGB{,A,X} formats definitions
>       drm/msm/disp: simplify tiled RGB{,A,X} formats definitions
>       drm/msm/disp: pull in common YUV format parameters
>       drm/msm/disp: pull in common tiled YUV format parameters
>       drm/msm/disp: drop PSEUDO_YUV_FMT_LOOSE_TILED
>       drm/msm/dpu: simplify _dpu_format_populate_plane_sizes_*
>       drm/msm/dpu: drop redundant num_planes assignment in _dpu_format_populate_plane_sizes*()
>       drm/msm/dpu: rewrite _dpu_format_populate_plane_sizes_ubwc()
>       drm/msm/dpu: use standard functions in _dpu_format_populate_plane_sizes_ubwc()

Seems to work as expected according to our messages in IRC, no issues
seen booting up Phosh or SuperTuxKart.

Tested-by: Luca Weiss <luca.weiss@fairphone.com> # qcm6490-fairphone-fp5

Regards
Luca

>
>  drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c    |  174 ++--
>  drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h | 1155 ------------------------
>  drivers/gpu/drm/msm/disp/mdp_format.c          |  614 +++++++------
>  3 files changed, 391 insertions(+), 1552 deletions(-)
> ---
> base-commit: b179ce312bafcb8c68dc718e015aee79b7939ff0
> change-id: 20250705-dpu-formats-0d5ae4d1a1b9
>
> Best regards,