Skip to content

Commit 9f257a7

Browse files
kJugghal-feng
authored andcommitted
drm/fourcc: Add drm/vs tiled modifiers
These are mainly used internally in vs-drm, I'm not sure if the new modifiers can be used with the existing ones. If there is a problem, I will improve it further. Signed-off-by: Keith Zhao <keith.zhao@starfivetech.com>
1 parent d883b40 commit 9f257a7

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

include/uapi/drm/drm_fourcc.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ extern "C" {
419419
#define DRM_FORMAT_MOD_VENDOR_ARM 0x08
420420
#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09
421421
#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a
422+
#define DRM_FORMAT_MOD_VENDOR_VS 0x0b
422423

423424
/* add more to the end as needed */
424425

@@ -1562,6 +1563,32 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
15621563
#define AMD_FMT_MOD_CLEAR(field) \
15631564
(~((__u64)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
15641565

1566+
#define DRM_FORMAT_MOD_VS_TYPE_NORMAL 0x00
1567+
#define DRM_FORMAT_MOD_VS_TYPE_COMPRESSED 0x01
1568+
#define DRM_FORMAT_MOD_VS_TYPE_CUSTOM_10BIT 0x02
1569+
#define DRM_FORMAT_MOD_VS_TYPE_MASK ((__u64)0x3 << 54)
1570+
1571+
#define fourcc_mod_vs_code(type, val) \
1572+
fourcc_mod_code(VS, ((((__u64)type) << 54) | (val)))
1573+
1574+
#define DRM_FORMAT_MOD_VS_NORM_MODE_MASK 0x1F
1575+
#define DRM_FORMAT_MOD_VS_LINEAR 0x00
1576+
#define DRM_FORMAT_MOD_VS_SUPER_TILED_XMAJOR 0x02
1577+
#define DRM_FORMAT_MOD_VS_SUPER_TILED_YMAJOR 0x03
1578+
#define DRM_FORMAT_MOD_VS_TILE_8X8 0x04
1579+
#define DRM_FORMAT_MOD_VS_TILE_8X4 0x07
1580+
#define DRM_FORMAT_MOD_VS_SUPER_TILED_XMAJOR_8X4 0x0B
1581+
#define DRM_FORMAT_MOD_VS_SUPER_TILED_YMAJOR_4X8 0x0C
1582+
#define DRM_FORMAT_MOD_VS_TILE_MODE4X4 0x15
1583+
1584+
#define fourcc_mod_vs_norm_code(tile) \
1585+
fourcc_mod_vs_code(DRM_FORMAT_MOD_VS_TYPE_NORMAL, \
1586+
(tile))
1587+
1588+
#define fourcc_mod_vs_custom_code(tile) \
1589+
fourcc_mod_vs_code(DRM_FORMAT_MOD_VS_TYPE_CUSTOM_10BIT, \
1590+
(tile))
1591+
15651592
#if defined(__cplusplus)
15661593
}
15671594
#endif

0 commit comments

Comments
 (0)