History

drm/fourcc: Add Arm 16x16 block modifier

Add the DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED modifier to denote the 16x16 block u-interleaved format used in Arm Utgard and Midgard GPUs. Changes from v1:- 1. Reserved the upper four bits (out of the 56 bits assigned to each vendor) to denote the category of Arm specific modifiers. Currently, we have two categories ie AFBC and MISC. Changes from v2:- 1. Preserved Ray's authorship 2. Cleanups/changes suggested by Brian 3. Added r-bs of Brian and Qiang

Raymond Smith committed 7 years ago

Commit ba2a1c81 parent 3dda22d1 file · +25 −1Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/drm/drm_fourcc.h+25−1
@@ -648,7 +648,21 @@ extern "C" { · 647 unmodified lines
648648 * Further information on the use of AFBC modifiers can be found in
649649 * Documentation/gpu/afbc.rst
650650 */
651−#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) fourcc_mod_code(ARM, __afbc_mode)
651+
652+/*
653+ * The top 4 bits (out of the 56 bits alloted for specifying vendor specific
654+ * modifiers) denote the category for modifiers. Currently we have only two
655+ * categories of modifiers ie AFBC and MISC. We can have a maximum of sixteen
656+ * different categories.
657+ */
658+#define DRM_FORMAT_MOD_ARM_CODE(__type, __val) \
659+ fourcc_mod_code(ARM, ((__u64)(__type) << 52) | ((__val) & 0x000fffffffffffffULL))
660+
661+#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00
662+#define DRM_FORMAT_MOD_ARM_TYPE_MISC 0x01
663+
664+#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) \
665+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFBC, __afbc_mode)
652666
653667 /*
654668 * AFBC superblock size
@@ -742,6 +756,16 @@ extern "C" { · 87 unmodified lines
742756 */
743757 #define AFBC_FORMAT_MOD_BCH (1ULL << 11)
744758
759+/*
760+ * Arm 16x16 Block U-Interleaved modifier
761+ *
762+ * This is used by Arm Mali Utgard and Midgard GPUs. It divides the image
763+ * into 16x16 pixel blocks. Blocks are stored linearly in order, but pixels
764+ * in the block are reordered.
765+ */
766+#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \
767+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL)
768+
745769 /*
746770 * Allwinner tiled modifier
747771 *