Skip to content

Add DRM_COLOROP_3D_LUT_DMA for fast-loading 3D LUT

Harry Wentland amd-gfx dri-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13drm/colorop: Add DRM_COLOROP_3D_LUT_DMAdrivers/gpu/drm/drm_atomic_uapi.c drivers/gpu/drm/drm_colorop.c include/uapi/drm/drm_mode.h+85 -00 replies
2/13drm/colorop: add DRM_COLOROP_3D_LUT_DMA object and statedrivers/gpu/drm/drm_colorop.c include/drm/drm_colorop.h+142 -00 replies
3/13drm/atomic: wire up DMA 3D LUT colorop propertiesdrivers/gpu/drm/drm_atomic.c drivers/gpu/drm/drm_atomic_uapi.c drivers/gpu/drm/drm_framebuffer.c +1 more+76 -40 replies
4/13drm/atomic: validate DMA 3D LUT colorop framebufferdrivers/gpu/drm/drm_atomic.c+62 -00 replies
5/13drm/atomic: add colorop prepare_fb and cleanup_fb helper hooksdrivers/gpu/drm/drm_atomic_helper.c drivers/gpu/drm/drm_colorop.c drivers/gpu/drm/drm_gem_atomic_helper.c +4 more+290 -00 replies
6/13drm/tests: test colorop prepare_fb and cleanup_fb helpersdrivers/gpu/drm/tests/Makefile drivers/gpu/drm/tests/drm_colorop_helper_test.c+398 -00 replies
7/13drm/amd/display: advertise a DMA 3D LUT color pipelinedrivers/gpu/drm/amd/display/Kconfig drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.h +2 more+71 -100 replies
8/13drm/amd/display: pin the DMA 3D LUT framebufferdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.h drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c+129 -40 replies
9/13drm/amd/display: program the DMA 3D LUT coloropdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c+51 -170 replies
10/13drm/amd/display: add 3D LUT DMA pitch alignment capdrivers/gpu/drm/amd/display/dc/dc.h drivers/gpu/drm/amd/display/dc/resource/dcn42/dcn42_resource.c drivers/gpu/drm/amd/display/dc/resource/dcn42b/dcn42b_resource.c+6 -00 replies
11/13drm/amd/display: derive the DMA 3D LUT pitch from DC capsdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.h drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +1 more+21 -200 replies
12/13drm/amd/display: reject direct 3D LUT loading mode changesdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c+79 -00 replies
13/13drm/amd/display: add KUnit tests for the DMA 3D LUT coloropdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_colorop_test.c+284 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 00/13] Add DRM_COLOROP_3D_LUT_DMA for fast-loading 3D LUT

Loading a DRM_COLOROP_3D_LUT on AMD HW takes a long time because the driver has to load the entire 3D LUT via register writes.

Starting with DCN 4 the HW has the ability to load a 3D LUT via DMA, which only requires an address update for programming the 3D LUT.

I propose exposing a new DRM_COLOROP_3D_LUT_DMA type to support this DMA 3D LUT loading mechanism. Users of the DRM_COLOROP_3D_LUT_DMA will parse the supported formats via the LUT_3D_FORMATS blob property, select the desired format via LUT_3D_FORMAT property, and pass the 3D LUT buffer as a drm_framebuffer via FB_ID on the colorop.

For details see the patches and/or posted branches.

In addition to the patches posted here the 3d-fl-fixes kernel branch contains a number of fixes that will be merged via the usual amdgpu display process. It also contains a patch to enable support on Navi 4 (DCN 4.0.1), which won't be upstreamed since that generation requires a userspace workaround. The 3d-fl-workaround IGT branch exists solely for that purpose. Nonetheless, Navi 4 can serve as an enablement vehicle for anyone who wants to see the new interface working.

The kwin branch makes use of a pipeline with DRM_COLOROP_3D_LUT_DMA if such a pipeline is discovered before a pipeline with a DRM_COLOROP_3D_LUT.

### Branches

kernel: https://gitlab.freedesktop.org/hwentland/linux/-/commits/3d-fl
kernel w/ fixes: https://gitlab.freedesktop.org/hwentland/linux/-/commits/3d-fl-fixes
IGT: https://gitlab.freedesktop.org/hwentland/igt-gpu-tools/-/tree/3d-fl
IGT Navi 4 w/a: https://gitlab.freedesktop.org/hwentland/igt-gpu-tools/-/tree/3d-fl-workaround
kwin: https://invent.kde.org/hwentlan/kwin/-/commits/3d-fl

Cc Melissa Wen <[email protected]>
Cc Autumn Ashton <[email protected]>
Cc Xaver Hugl <[email protected]>

Harry Wentland (13):
drm/colorop: Add DRM_COLOROP_3D_LUT_DMA
drm/colorop: add DRM_COLOROP_3D_LUT_DMA object and state drm/atomic: wire up DMA 3D LUT colorop properties drm/atomic: validate DMA 3D LUT colorop framebuffer drm/atomic: add colorop prepare_fb and cleanup_fb helper hooks drm/tests: test colorop prepare_fb and cleanup_fb helpers drm/amd/display: advertise a DMA 3D LUT color pipeline drm/amd/display: pin the DMA 3D LUT framebuffer drm/amd/display: program the DMA 3D LUT colorop drm/amd/display: add 3D LUT DMA pitch alignment cap drm/amd/display: derive the DMA 3D LUT pitch from DC caps drm/amd/display: reject direct 3D LUT loading mode changes drm/amd/display: add KUnit tests for the DMA 3D LUT colorop

 drivers/gpu/drm/amd/display/Kconfig           |  13 +
 .../amd/display/amdgpu_dm/amdgpu_dm_color.c   |  68 ++-
 .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 131 +++++-
 .../amd/display/amdgpu_dm/amdgpu_dm_colorop.h |   8 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   |  71 +++-
 .../amdgpu_dm/tests/amdgpu_dm_colorop_test.c  | 286 ++++++++++++-
 .../amdgpu_dm/tests/amdgpu_dm_plane_test.c    |  65 +++
 drivers/gpu/drm/amd/display/dc/dc.h           |   2 +
 .../dc/resource/dcn42/dcn42_resource.c        |   2 +
 .../dc/resource/dcn42b/dcn42b_resource.c      |   2 +
 drivers/gpu/drm/drm_atomic.c                  |  66 +++
 drivers/gpu/drm/drm_atomic_helper.c           |  93 ++++
 drivers/gpu/drm/drm_atomic_uapi.c             |  28 ++
 drivers/gpu/drm/drm_colorop.c                 |  96 +++++
 drivers/gpu/drm/drm_framebuffer.c             |  45 +-
 drivers/gpu/drm/drm_gem_atomic_helper.c       |  81 ++++
 drivers/gpu/drm/tests/Makefile                |   1 +
 .../gpu/drm/tests/drm_colorop_helper_test.c   | 397 ++++++++++++++++++
 include/drm/drm_atomic.h                      |  20 +
 include/drm/drm_colorop.h                     |  71 ++++
 include/drm/drm_gem_atomic_helper.h           |  11 +
 include/drm/drm_modeset_helper_vtables.h      |  62 +++
 include/uapi/drm/drm.h                        |   7 +-
 include/uapi/drm/drm_mode.h                   |  79 ++++
 24 files changed, 1672 insertions(+), 33 deletions(-)
 create mode 100644 drivers/gpu/drm/tests/drm_colorop_helper_test.c

--
2.56.0