summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_fourcc.h
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2017-12-22 15:29:26 +0100
committerMaxime Ripard <maxime.ripard@free-electrons.com>2018-01-29 12:07:47 +0100
commit4cc4e1b40f3ff5227c9f326542b75947b464a635 (patch)
tree16a85f97d97e5722d11d92dc5ff8d5568e161866 /include/drm/drm_fourcc.h
parentdrm/stm: ltdc: use crtc_mode_fixup to update adjusted_mode clock (diff)
downloadlinux-4cc4e1b40f3ff5227c9f326542b75947b464a635.tar.xz
linux-4cc4e1b40f3ff5227c9f326542b75947b464a635.zip
drm/fourcc: Add a alpha field to drm_format_info
There's a bunch of drivers that duplicate the same function to know if a particular format embeds an alpha component or not. Let's create a field in the drm_format_info to avoid duplicating that logic and looking up formats all the time. Cc: Eric Anholt <eric@anholt.net> Cc: Inki Dae <inki.dae@samsung.com> Cc: Joonyoung Shim <jy0922.shim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/9cd9951d147ff810c1f6f68d79e7983361ed6b68.1516617243.git-series.maxime.ripard@free-electrons.com
Diffstat (limited to 'include/drm/drm_fourcc.h')
-rw-r--r--include/drm/drm_fourcc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
index 6942e84b6edd..3e86408dac9f 100644
--- a/include/drm/drm_fourcc.h
+++ b/include/drm/drm_fourcc.h
@@ -38,6 +38,7 @@ struct drm_mode_fb_cmd2;
* @cpp: Number of bytes per pixel (per plane)
* @hsub: Horizontal chroma subsampling factor
* @vsub: Vertical chroma subsampling factor
+ * @has_alpha: Does the format embeds an alpha component?
*/
struct drm_format_info {
u32 format;
@@ -46,6 +47,7 @@ struct drm_format_info {
u8 cpp[3];
u8 hsub;
u8 vsub;
+ bool has_alpha;
};
/**