Merge tag 'rproc-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson...
[linux-2.6-microblaze.git] / include / drm / drm_fourcc.h
index 3b138d4..22aa64d 100644 (file)
 #include <linux/types.h>
 #include <uapi/drm/drm_fourcc.h>
 
+/**
+ * DRM_FORMAT_MAX_PLANES - maximum number of planes a DRM format can have
+ */
+#define DRM_FORMAT_MAX_PLANES  4u
+
 /*
  * DRM formats are little endian.  Define host endian variants for the
  * most common formats here, to reduce the #ifdefs needed in drivers.
@@ -78,7 +83,7 @@ struct drm_format_info {
                 * triplet @char_per_block, @block_w, @block_h for better
                 * describing the pixel format.
                 */
-               u8 cpp[4];
+               u8 cpp[DRM_FORMAT_MAX_PLANES];
 
                /**
                 * @char_per_block:
@@ -104,7 +109,7 @@ struct drm_format_info {
                 * information from their drm_mode_config.get_format_info hook
                 * if they want the core to be validating the pitch.
                 */
-               u8 char_per_block[4];
+               u8 char_per_block[DRM_FORMAT_MAX_PLANES];
        };
 
        /**
@@ -113,7 +118,7 @@ struct drm_format_info {
         * Block width in pixels, this is intended to be accessed through
         * drm_format_info_block_width()
         */
-       u8 block_w[4];
+       u8 block_w[DRM_FORMAT_MAX_PLANES];
 
        /**
         * @block_h:
@@ -121,7 +126,7 @@ struct drm_format_info {
         * Block height in pixels, this is intended to be accessed through
         * drm_format_info_block_height()
         */
-       u8 block_h[4];
+       u8 block_h[DRM_FORMAT_MAX_PLANES];
 
        /** @hsub: Horizontal chroma subsampling factor */
        u8 hsub;