All of lore.kernel.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 2/2] lib/igt_fb: Add support for 10bpc ARGB/ABGR
Date: Thu,  3 Oct 2019 22:58:54 +0300	[thread overview]
Message-ID: <20191003195854.18208-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20191003195854.18208-1-ville.syrjala@linux.intel.com>

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

Hook up conversion routines for 10bpc ARGB/ABGR formats.
Cairo only has the RGB30 without alpha so we'll do the
rendering with floats and use pixman to convert.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_fb.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index db789ae79458..8b47cf975598 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -175,6 +175,18 @@ static const struct format_desc_struct {
 	  .num_planes = 1, .plane_bpp = { 32, },
 	  .hsub = 1, .vsub = 1,
 	},
+	{ .name = "ARGB2101010", .depth = 30, .drm_id = DRM_FORMAT_ARGB2101010,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_a2r10g10b10,
+	  .num_planes = 1, .plane_bpp = { 32, },
+	  .hsub = 1, .vsub = 1,
+	},
+	{ .name = "ABGR2101010", .depth = -1, .drm_id = DRM_FORMAT_ABGR2101010,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_a2b10g10r10,
+	  .num_planes = 1, .plane_bpp = { 32, },
+	  .hsub = 1, .vsub = 1,
+	},
 	{ .name = "XRGB16161616F", .depth = -1, .drm_id = DRM_FORMAT_XRGB16161616F,
 	  .cairo_id = CAIRO_FORMAT_RGBA128F,
 	  .num_planes = 1, .plane_bpp = { 64, },
@@ -313,6 +325,7 @@ static const struct format_desc_struct {
 	},
 	{ .name = "IGT-FLOAT", .depth = -1, .drm_id = IGT_FORMAT_FLOAT,
 	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_rgba_float,
 	  .num_planes = 1, .plane_bpp = { 128 },
 	},
 };
@@ -3110,6 +3123,10 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 		default:
 			igt_assert_f(0, "Unsupported format %u", f->cairo_id);
 		}
+	} else if (PIXMAN_FORMAT_A(f->pixman_id) &&
+		   PIXMAN_FORMAT_R(f->pixman_id) > 8) {
+		cairo_id = CAIRO_FORMAT_RGBA128F;
+		drm_format = IGT_FORMAT_FLOAT;
 	} else if (PIXMAN_FORMAT_A(f->pixman_id)) {
 		cairo_id = CAIRO_FORMAT_ARGB32;
 		drm_format = DRM_FORMAT_ARGB8888;
-- 
2.21.0

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

  reply	other threads:[~2019-10-03 19:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 19:58 [igt-dev] [PATCH i-g-t 1/2] lib/igt_fb: Fix XBGB->XBGR typo Ville Syrjala
2019-10-03 19:58 ` Ville Syrjala [this message]
2019-10-03 20:09   ` [igt-dev] [PATCH i-g-t 2/2] lib/igt_fb: Add support for 10bpc ARGB/ABGR Chris Wilson
2019-10-07 14:15   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2019-10-03 20:04 ` [igt-dev] [PATCH i-g-t 1/2] lib/igt_fb: Fix XBGB->XBGR typo Chris Wilson
2019-10-03 20:52 ` [igt-dev] ✗ GitLab.Pipeline: warning for series starting with [i-g-t,1/2] " Patchwork
2019-10-04 12:38   ` Ville Syrjälä
2019-10-07 15:15 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/igt_fb: Fix XBGB->XBGR typo (rev2) Patchwork
2019-10-07 19:27 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20191003195854.18208-2-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.