summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@bootlin.com>2018-10-04 14:39:04 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-10-08 16:58:02 +0300
commitaedb04496f3e91ba88a08cbc7a71e41bcaf0523b (patch)
tree675a7acad0655406cbfd5ca35c3fb1b3c809acc4 /lib
parent3fa65f4b532bd9a5b5ae3cb0019606a9d56a7934 (diff)
fb: Add more formats
We're going to need some DRM formats, and we're going to need the igt_fb code to handle them. Since it relies on the format_desc structure to map the DRM fourcc to the pixman and cairo formats, we need to add these new formats to that structure. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_fb.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 7e5a6b45..35be2e88 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -72,11 +72,31 @@ static const struct format_desc_struct {
int num_planes;
int plane_bpp[4];
} format_desc[] = {
+ { .name = "ARGB1555", .depth = -1, .drm_id = DRM_FORMAT_ARGB1555,
+ .cairo_id = CAIRO_FORMAT_INVALID,
+ .pixman_id = PIXMAN_a1r5g5b5,
+ .num_planes = 1, .plane_bpp = { 16, },
+ },
+ { .name = "XRGB1555", .depth = -1, .drm_id = DRM_FORMAT_XRGB1555,
+ .cairo_id = CAIRO_FORMAT_INVALID,
+ .pixman_id = PIXMAN_x1r5g5b5,
+ .num_planes = 1, .plane_bpp = { 16, },
+ },
{ .name = "RGB565", .depth = 16, .drm_id = DRM_FORMAT_RGB565,
.cairo_id = CAIRO_FORMAT_RGB16_565,
.pixman_id = PIXMAN_r5g6b5,
.num_planes = 1, .plane_bpp = { 16, },
},
+ { .name = "BGR565", .depth = -1, .drm_id = DRM_FORMAT_BGR565,
+ .cairo_id = CAIRO_FORMAT_INVALID,
+ .pixman_id = PIXMAN_b5g6r5,
+ .num_planes = 1, .plane_bpp = { 16, },
+ },
+ { .name = "BGR888", .depth = -1, .drm_id = DRM_FORMAT_BGR888,
+ .cairo_id = CAIRO_FORMAT_INVALID,
+ .pixman_id = PIXMAN_b8g8r8,
+ .num_planes = 1, .plane_bpp = { 24, },
+ },
{ .name = "RGB888", .depth = -1, .drm_id = DRM_FORMAT_RGB888,
.cairo_id = CAIRO_FORMAT_INVALID,
.pixman_id = PIXMAN_r8g8b8,
@@ -87,6 +107,11 @@ static const struct format_desc_struct {
.pixman_id = PIXMAN_x8r8g8b8,
.num_planes = 1, .plane_bpp = { 32, },
},
+ { .name = "XBGR8888", .depth = -1, .drm_id = DRM_FORMAT_XBGR8888,
+ .cairo_id = CAIRO_FORMAT_INVALID,
+ .pixman_id = PIXMAN_x8b8g8r8,
+ .num_planes = 1, .plane_bpp = { 32, },
+ },
{ .name = "XRGB2101010", .depth = 30, .drm_id = DRM_FORMAT_XRGB2101010,
.cairo_id = CAIRO_FORMAT_RGB30,
.pixman_id = PIXMAN_x2r10g10b10,
@@ -97,6 +122,11 @@ static const struct format_desc_struct {
.pixman_id = PIXMAN_a8r8g8b8,
.num_planes = 1, .plane_bpp = { 32, },
},
+ { .name = "ABGR8888", .depth = -1, .drm_id = DRM_FORMAT_ABGR8888,
+ .cairo_id = CAIRO_FORMAT_INVALID,
+ .pixman_id = PIXMAN_a8b8g8r8,
+ .num_planes = 1, .plane_bpp = { 32, },
+ },
{ .name = "NV12", .depth = -1, .drm_id = DRM_FORMAT_NV12,
.cairo_id = CAIRO_FORMAT_RGB24,
.num_planes = 2, .plane_bpp = { 8, 16, },