Skip to content

RFC Add Format Modifiers for NVIDIA Blackwell chipsets

James Jones dri-devel nouveau 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4drm: macros defining fields of NVIDIA modifiersinclude/uapi/drm/drm_fourcc.h+29 -90 replies
2/4drm: add inline helper funcs for NVIDIA modifiersinclude/uapi/drm/drm_fourcc.h+41 -30 replies
3/4drm/nouveau: use format modifier helper funcsdrivers/gpu/drm/nouveau/nouveau_display.c+8 -40 replies
4/4drm: define NVIDIA DRM format modifiers for GB20xinclude/uapi/drm/drm_fourcc.h+28 -183 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC 0/4] Add Format Modifiers for NVIDIA Blackwell chipsets

The layout of bits within the individual tiles (referred to as sectors in the DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D() macro) changed for some formats starting in Blackwell 2 GPUs. New format modifiers are needed to denote the difference and prevent direct sharing of these incompatible buffers with older GPUs.

This patch series proposes first adding some helper macros and inline functions to drm_fourcc.h to make the NVIDIA block-linear format modifiers easier to work with given the proposed solution makes them harder to parse, then extending the existing sector type field in the parametric format modifier macro DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D() by another bit to accommodate the new layout type.

There are a few ways the parameteric format modifier definition could have been altered to handle the new layouts:

-The GOB Height and Page Kind field has a reserved value that could
have been used. However, the GOB height and page kind enums did not change relative to prior chips, so this is sort of a lie. However, this is the least-invasive change.

-An entirely new field could have been added. This seems
inappropriate given the presence of an existing appropriate field. The advantage here is it avoids splitting the sector layout field across two bitfields.

The proposed approach is the logically consistent one, but has the downside of being the most complex, and that it causes the DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D() macro to evaluate its 's' parameter twice. However, I believe the added helper functions and macros address the complexity, and I have audited the relevant code and do not believe the double evaluation should cause any problems in practice.

James Jones (4):
drm: macros defining fields of NVIDIA modifiers
drm: add inline helper funcs for NVIDIA modifiers drm/nouveau: use format modifier helper funcs
drm: define NVIDIA DRM format modifiers for GB20x

 drivers/gpu/drm/nouveau/nouveau_display.c |  12 ++-
 include/uapi/drm/drm_fourcc.h             | 100 ++++++++++++++++++----
 2 files changed, 92 insertions(+), 20 deletions(-)
Signature · 1 line
2.49.0