Skip to contentSkip to conversation

drm/fourcc: Add Apple Interchange layout format modifier

PATCH Superseded James Calligeros 2 participants 2 messages Aug 31

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/fourcc: Add Apple Interchange layout format modifier

Apple Interchange is a tiled and compressed image layout used for buffer exchange between Apple hardware blocks. It is similar to the already-supported GPU_TILED_COMPRESSED layout.

Add a format modifier for Apple Interchange so that it can be used for buffer exchange.

---
 include/uapi/drm/drm_fourcc.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
include/uapi/drm/drm_fourcc.h +20 -0
index a103fdc0b3a3..aa51c116cd7d 100644
@@ -1626,6 +1626,26 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
 #define DRM_FORMAT_MOD_APPLE_GPU_TILED fourcc_mod_code(APPLE, 1)
 #define DRM_FORMAT_MOD_APPLE_GPU_TILED_COMPRESSED fourcc_mod_code(APPLE, 2)
 
+/*
+ * Apple Interchange layout
+ *
+ * Apple Interchange is a compressed framebuffer format used exclusively for
+ * sharing buffers between hardware blocks (GPU, display controller, video
+ * codecs) on Apple platforms. It is similar to and uses the same compression
+ * scheme as GPU_TILED_COMPRESSED. There is no known uncompressed variant
+ * of Apple Interchange.
+ *
+ * Unlinke the GPU layouts, tile size is not dependent on bit depth. RGB
+ * images and the chroma components of YUV images use 16x16 tiles. The
+ * luma component of YUV images uses 32x32 tiles. Compression tiles
+ * are once again 16x16 with 8 bytes of metadata per compression subtile.
+ *
+ * AGX has limited support for Apple Interchange. It cannot be used for Z/S
+ * buffers or array images, for example. It is intended for scanout buffer
+ * sharing only.
+ */
+#define DRM_FORMAT_MOD_APPLE_INTERCHANGE fourcc_mod_code(APPLE, 3)
+
 /*
  * AMD modifiers
  *

---
base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
change-id: 20260830-apple-interchange-modifier-cbcc311c835d

Best regards,

Signature · 1 line
James Calligeros <[email protected]>
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Typo in the UAPI documentation comment for `DRM_FORMAT_MOD_APPLE_INTERCHANGE`: 'Unlinke' instead of…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Typo in the UAPI documentation comment for DRM_FORMAT_MOD_APPLE_INTERCHANGE: 'Unlinke' instead of 'Unlike'. --

commit 8d891b8a7418ccf3a3ab6fe8fbc786ff834638af
Author: James Calligeros <[email protected]>

drm/fourcc: Add Apple Interchange layout format modifier

This commit introduces the DRM_FORMAT_MOD_APPLE_INTERCHANGE format modifier for Apple platforms. It describes the format as a compressed framebuffer layout used for sharing buffers between hardware blocks.

Quoted 8 lines
include/uapi/drm/drm_fourcc.h +0 -0
index a103fdc0b3a36..aa51c116cd7dc 100644
@@ -1626,6 +1626,26 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
 #define DRM_FORMAT_MOD_APPLE_GPU_TILED fourcc_mod_code(APPLE, 1)
 #define DRM_FORMAT_MOD_APPLE_GPU_TILED_COMPRESSED fourcc_mod_code(APPLE, 2)
 

include/uapi/drm/drm_fourcc.h drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) · line 1638

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +10 -0
+/*
+ * Apple Interchange layout
+ *
+ * Apple Interchange is a compressed framebuffer format used exclusively for
+ * sharing buffers between hardware blocks (GPU, display controller, video
+ * codecs) on Apple platforms. It is similar to and uses the same compression
+ * scheme as GPU_TILED_COMPRESSED. There is no known uncompressed variant
+ * of Apple Interchange.
+ *
+ * Unlinke the GPU layouts, tile size is not dependent on bit depth. RGB

[Severity: Low]
This isn't a bug, but is this a typo (Unlinke instead of Unlike) in the newly added UAPI documentation block?

Quoted 9 lines
include/uapi/drm/drm_fourcc.h +9 -0
+ * images and the chroma components of YUV images use 16x16 tiles. The
+ * luma component of YUV images uses 32x32 tiles. Compression tiles
+ * are once again 16x16 with 8 bytes of metadata per compression subtile.
+ *
+ * AGX has limited support for Apple Interchange. It cannot be used for Z/S
+ * buffers or array images, for example. It is intended for scanout buffer
+ * sharing only.
+ */
+#define DRM_FORMAT_MOD_APPLE_INTERCHANGE fourcc_mod_code(APPLE, 3)
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1