public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/2] lib/igt_fb: Add support for C8 pixel format
Date: Fri, 10 May 2019 20:18:59 +0300	[thread overview]
Message-ID: <20190510171900.29593-1-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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>
---
 lib/igt_fb.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index d4929019971c..19523a4def54 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,
@@ -3248,6 +3254,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) ||
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-05-10 17:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 17:18 Ville Syrjala [this message]
2019-05-10 17:19 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_plane: Test C8 pixel format Ville Syrjala
2019-05-10 17:47 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/igt_fb: Add support for " Patchwork
2019-05-10 21:25 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190510171900.29593-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox