Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Subject: [PATCH i-g-t v2 3/4] tests/kms_draw_crc: Test 64bpp
Date: Fri, 22 Nov 2024 10:48:03 +0200	[thread overview]
Message-ID: <20241122084804.29669-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20241122084804.29669-1-ville.syrjala@linux.intel.com>

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

Test 64bpp formats to make sure igt_draw is working correctly.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/intel/kms_draw_crc.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/intel/kms_draw_crc.c b/tests/intel/kms_draw_crc.c
index e3d1c0ba9bd8..078a6f46d31a 100644
--- a/tests/intel/kms_draw_crc.c
+++ b/tests/intel/kms_draw_crc.c
@@ -34,6 +34,7 @@
 
 #include "i915/gem.h"
 #include "igt.h"
+#include "igt_halffloat.h"
 
 /**
  * SUBTEST: fill-fb
@@ -76,6 +77,7 @@ static const uint32_t formats[] = {
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_RGB565,
 	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_XBGR16161616F,
 };
 
 static const uint64_t modifiers[] = {
@@ -109,9 +111,11 @@ static void find_modeset_params(void)
 	}
 }
 
-static uint32_t get_color(uint32_t drm_format, bool r, bool g, bool b)
+static uint64_t get_color(uint32_t drm_format, bool r, bool g, bool b)
 {
-	uint32_t color = 0;
+	uint64_t color = 0;
+	uint16_t h[3];
+	float f[3];
 
 	switch (drm_format) {
 	case DRM_FORMAT_RGB565:
@@ -129,6 +133,15 @@ static uint32_t get_color(uint32_t drm_format, bool r, bool g, bool b)
 		color |= g ? 0x3FF << 10 : 0;
 		color |= b ? 0x3FF : 0;
 		break;
+	case DRM_FORMAT_XBGR16161616F:
+		f[0] = r ? 1.0f : 0.0f;
+		f[1] = g ? 1.0f : 0.0f;
+		f[2] = b ? 1.0f : 0.0f;
+		igt_float_to_half(f, h, 3);
+		color |= (uint64_t)h[2] << 32 |
+			(uint64_t)h[1] << 16 |
+			(uint64_t)h[0] << 0;
+		break;
 	default:
 		igt_assert(false);
 	}
@@ -290,6 +303,8 @@ static const char *format_str(int format_index)
 		return "xrgb8888";
 	case DRM_FORMAT_XRGB2101010:
 		return "xrgb2101010";
+	case DRM_FORMAT_XBGR16161616F:
+		return "xbgr16161616f";
 	default:
 		igt_assert(false);
 	}
-- 
2.45.2


  parent reply	other threads:[~2024-11-22  8:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22  8:48 [PATCH i-g-t v2 0/4] intel: igt_draw and intel_bufops improvements Ville Syrjala
2024-11-22  8:48 ` [PATCH i-g-t v2 1/4] lib/intel_bufops: Add support for gen2 and i915 tiling layouts Ville Syrjala
2024-11-25  7:09   ` Zbigniew Kempczyński
2024-11-22  8:48 ` [PATCH i-g-t v2 2/4] lib/intel_bufops: Provide pread/pwrite based fallback when we don't have WC Ville Syrjala
2024-12-18 15:08   ` Juha-Pekka Heikkilä
2024-11-22  8:48 ` Ville Syrjala [this message]
2024-11-22  8:48 ` [PATCH i-g-t v2 4/4] tests/intel/gem_draw: Test igt_draw without kms Ville Syrjala
2024-12-18 15:09   ` Juha-Pekka Heikkilä
2024-11-22 10:09 ` ✗ GitLab.Pipeline: warning for intel: igt_draw and intel_bufops improvements (rev4) Patchwork
2024-11-22 10:25 ` ✓ Xe.CI.BAT: success " Patchwork
2024-11-22 10:42 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-23  5:54 ` ✗ Xe.CI.Full: " 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=20241122084804.29669-4-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.com \
    /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