dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/nouveau: Advertise correct modifiers on GB20x
@ 2025-08-11 22:00 James Jones
  2025-08-11 22:00 ` [PATCH 1/3] drm: define NVIDIA DRM format modifiers for GB20x James Jones
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: James Jones @ 2025-08-11 22:00 UTC (permalink / raw)
  To: Danilo Krummrich, Lyude Paul, Faith Ekstrand
  Cc: nouveau, dri-devel, linux-kernel, David Airlie, Simona Vetter,
	Joel Fernandes, James Jones

This series adds new format modifiers for 8 and 16-bit formats on GB20x
GPUs, preventing them from mistakenly sharing block-linear surfaces
using these formats with prior GPUs that use a different layout.

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 chosen 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, utilizing simple helper functions in
client code when accessing the parameteric format modifier fields
easily addresses the complexity, and I have audited the relevant code
and do not believe the double evaluation should cause any problems in
practice.

Tested on GB20x and TU10x cards using the following:

-kmscube w/NVK+Zink built with these patches applied:

   https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36336

 with various manually specified formats
 and both manually specified and automatically
 selected modifiers.

-drmfmtmods, a tiny test program that lists modifiers:

   https://github.com/cubanismo/drmfmtmods

Changes since the RFC version here:

  https://lore.kernel.org/nouveau/20250703223658.1457-1-jajones@nvidia.com/

-Dropped the helper macros & static inlines in
 drm_fourcc.h as requested by Faith Ekstrand,
 who noted these aren't helpful for UMD code,
 which is all written in rust now. I may re-
 introduce some of these in a subsequent series,
 but we both agreed we do not want to delay
 progress on the modifiers themselves while we
 debate the details of those cometic details.

-Reserved an extra bit for future sector
 layouts.

-Fixed handling of linear modifiers on GB20x
 and NV5x/G8x/G9x/GT2xx chips.

James Jones (3):
  drm: define NVIDIA DRM format modifiers for GB20x
  drm/nouveau/disp: Always accept linear modifier
  drm/nouveau: Advertise correct modifiers on GB20x

 drivers/gpu/drm/nouveau/dispnv50/disp.c     |  3 ++
 drivers/gpu/drm/nouveau/dispnv50/disp.h     |  1 +
 drivers/gpu/drm/nouveau/dispnv50/wndw.c     | 25 ++++++++++++++--
 drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c | 33 +++++++++++++++++++++
 include/uapi/drm/drm_fourcc.h               | 25 ++++++++++------
 5 files changed, 76 insertions(+), 11 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-09-02 13:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 22:00 [PATCH 0/3] drm/nouveau: Advertise correct modifiers on GB20x James Jones
2025-08-11 22:00 ` [PATCH 1/3] drm: define NVIDIA DRM format modifiers for GB20x James Jones
2025-08-22 15:51   ` Faith Ekstrand
2025-08-22 16:16   ` Faith Ekstrand
2025-09-02 13:41   ` Danilo Krummrich
2025-08-11 22:00 ` [PATCH 2/3] drm/nouveau/disp: Always accept linear modifier James Jones
2025-08-22 16:17   ` Faith Ekstrand
2025-08-22 20:55   ` Danilo Krummrich
2025-08-22 21:11     ` James Jones
2025-08-22 21:14       ` Danilo Krummrich
2025-08-22 23:14   ` Danilo Krummrich
2025-08-11 22:00 ` [PATCH 3/3] drm/nouveau: Advertise correct modifiers on GB20x James Jones
2025-08-22 15:48   ` Faith Ekstrand
2025-08-22 17:03     ` James Jones
2025-08-22 17:10       ` Faith Ekstrand
2025-08-22 20:44 ` [PATCH 0/3] " Faith Ekstrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).