summaryrefslogtreecommitdiff
path: root/lib/igt_fb.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2019-05-10 19:47:50 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2019-05-28 22:38:00 +0300
commit8a07b094cf39cae93625bffcb5c6667b8f585e08 (patch)
tree936328395c179597811faa067bc088df0d47063b /lib/igt_fb.c
parent2d64cb6808075b0d0696a89d2ce290220e6eff8e (diff)
lib/igt_fb: Add support for C8 pixel format
Expose C8 support by utilizing pixman's rgb332 support. By using rgb332 we don't have to worry too much about how to populate the LUT, though for now we still leave that responsibility to individual tests. If desired we could make igt_kms generate a suitable LUT when the test itself didn't bother. But meh for now. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r--lib/igt_fb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index c6e18397b..9d4f905e1 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -98,6 +98,12 @@ static const struct format_desc_struct {
.num_planes = 1, .plane_bpp = { 16, },
.hsub = 1, .vsub = 1,
},
+ { .name = "C8", .depth = -1, .drm_id = DRM_FORMAT_C8,
+ .cairo_id = CAIRO_FORMAT_INVALID,
+ .pixman_id = PIXMAN_r3g3b2,
+ .num_planes = 1, .plane_bpp = { 8, },
+ .hsub = 1, .vsub = 1,
+ },
{ .name = "XRGB1555", .depth = -1, .drm_id = DRM_FORMAT_XRGB1555,
.cairo_id = CAIRO_FORMAT_INVALID,
.pixman_id = PIXMAN_x1r5g5b5,
@@ -3233,6 +3239,15 @@ bool igt_fb_supported_format(uint32_t drm_format)
{
const struct format_desc_struct *f;
+ /*
+ * C8 needs a LUT which (at least for the time being)
+ * is the responsibility of each test. Not all tests
+ * have the required code so let's keep C8 hidden from
+ * most eyes.
+ */
+ if (drm_format == DRM_FORMAT_C8)
+ return false;
+
for_each_format(f)
if (f->drm_id == drm_format)
return (f->cairo_id != CAIRO_FORMAT_INVALID) ||