]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/drm/drm_fourcc.h
drm: Centralize format information
[mirror_ubuntu-bionic-kernel.git] / include / drm / drm_fourcc.h
index 30c30fa87ee8892177ecd9179b035dda8fc6ae2d..135fef050ee60839303374975e94e43b88a7cebc 100644 (file)
 #include <linux/types.h>
 #include <uapi/drm/drm_fourcc.h>
 
+/**
+ * struct drm_format_info - information about a DRM format
+ * @format: 4CC format identifier (DRM_FORMAT_*)
+ * @depth: Color depth (number of bits per pixel excluding padding bits),
+ *     valid for a subset of RGB formats only. This is a legacy field, do not
+ *     use in new code and set to 0 for new formats.
+ * @num_planes: Number of color planes (1 to 3)
+ * @cpp: Number of bytes per pixel (per plane)
+ * @hsub: Horizontal chroma subsampling factor
+ * @vsub: Vertical chroma subsampling factor
+ */
+struct drm_format_info {
+       u32 format;
+       u8 depth;
+       u8 num_planes;
+       u8 cpp[3];
+       u8 hsub;
+       u8 vsub;
+};
+
+const struct drm_format_info *drm_format_info(u32 format);
 uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth);
 void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, int *bpp);
 int drm_format_num_planes(uint32_t format);