summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_fb.c16
-rw-r--r--lib/igt_fb.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index f1989249..48f7921e 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2727,3 +2727,19 @@ bool igt_format_is_yuv(uint32_t drm_format)
return false;
}
}
+
+/**
+ * igt_format_plane_bpp:
+ * @drm_format: drm fourcc
+ * @plane: format plane index
+ *
+ * This functions returns the number of bits per pixel for the given @plane
+ * index of the @drm_format.
+ */
+int igt_format_plane_bpp(uint32_t drm_format, int plane)
+{
+ const struct format_desc_struct *format =
+ lookup_drm_format(drm_format);
+
+ return format->plane_bpp[plane];
+}
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 232370bd..0bac83c3 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -181,6 +181,7 @@ uint32_t igt_drm_format_to_bpp(uint32_t drm_format);
const char *igt_format_str(uint32_t drm_format);
bool igt_fb_supported_format(uint32_t drm_format);
bool igt_format_is_yuv(uint32_t drm_format);
+int igt_format_plane_bpp(uint32_t drm_format, int plane);
#endif /* __IGT_FB_H__ */