Skip to contentSkip to conversation

DO NOT MERGE: NV12 Experiment

PATCH New Swati Sharma 2 participants 3 messages May 11, 2023 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 DO NOT MERGE: NV12 Experiment

From: Jeevan B <[email protected]>

---
 tests/intel-ci/fast-feedback.testlist |   9 +-
 tests/kms_pipe_crc_basic.c            | 292 ++++++++++++++++++++++++--
 2 files changed, 285 insertions(+), 16 deletions(-)
tests/intel-ci/fast-feedback.testlist +8 -1
index d9fcb62d..4af9e8d2 100644
@@ -118,7 +118,14 @@ igt@kms_force_connector_basic@force-edid
 igt@kms_force_connector_basic@force-load-detect
 igt@kms_force_connector_basic@prune-stale-modes
 igt@kms_frontbuffer_tracking@basic
-igt@kms_pipe_crc_basic@compare-crc-sanitycheck
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-xrgb
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-xrgb-red
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-xrgb-green
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-xrgb-blue
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12-red
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12-green
+igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12-blue
 igt@kms_pipe_crc_basic@hang-read-crc
 igt@kms_pipe_crc_basic@nonblocking-crc
 igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence
tests/kms_pipe_crc_basic.c +277 -15

322 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 lib/igt_fb: round rgb->yuv conversion results

---
 lib/igt_fb.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
lib/igt_fb.c +15 -10
index 0fe5b6ad..2fa84288 100644
@@ -3047,11 +3047,16 @@ static void igt_fb_destroy_cairo_shadow_buffer(struct igt_fb *shadow,
 	munmap(ptr, shadow->size);
 }
 
-static uint8_t clamprgb(float val)
+static uint8_t clamp8(float val)
 {
 	return clamp((int)(val + 0.5f), 0, 255);
 }
 
+static uint8_t clamp16(float val)
+{
+	return clamp((int)(val + 0.5f), 0, 65535);
+}
+
 static void read_rgb(struct igt_vec4 *rgb, const uint8_t *rgb24)
 {
 	rgb->d[0] = rgb24[2];
@@ -3062,9 +3067,9 @@ static void read_rgb(struct igt_vec4 *rgb, const uint8_t *rgb24)
 
 static void write_rgb(uint8_t *rgb24, const struct igt_vec4 *rgb)
 {
-	rgb24[2] = clamprgb(rgb->d[0]);
-	rgb24[1] = clamprgb(rgb->d[1]);
-	rgb24[0] = clamprgb(rgb->d[2]);
+	rgb24[2] = clamp8(rgb->d[0]);
+	rgb24[1] = clamp8(rgb->d[1]);
+	rgb24[0] = clamp8(rgb->d[2]);
 }
 
 struct fb_convert_buf {
@@ -3384,7 +3389,7 @@ static void convert_rgb24_to_yuv(struct fb_convert *cvt)
 
 			rgb_tmp += bpp;
 
-			*y_tmp = yuv.d[0];
+			*y_tmp = clamp8(yuv.d[0]);
 			y_tmp += params.ay_inc;
 
 			if ((i % dst_fmt->vsub) || (j % dst_fmt->hsub))
@@ -3414,8 +3419,8 @@ static void convert_rgb24_to_yuv(struct fb_convert *cvt)
 			read_rgb(&pair_rgb, pair_rgb24);
 			pair_yuv = igt_matrix_transform(&m, &pair_rgb);
 
-			*u_tmp = (yuv.d[1] + pair_yuv.d[1]) / 2.0f;
-			*v_tmp = (yuv.d[2] + pair_yuv.d[2]) / 2.0f;
+			*u_tmp = clamp8((yuv.d[1] + pair_yuv.d[1]) / 2.0f);
+			*v_tmp = clamp8((yuv.d[2] + pair_yuv.d[2]) / 2.0f);
 
 			u_tmp += params.uv_inc;
 			v_tmp += params.uv_inc;
@@ -3573,7 +3578,7 @@ static void convert_float_to_yuv16(struct fb_convert *cvt, bool alpha)
 
 			rgb_tmp += fpp;
 
-			*y_tmp = yuv.d[0];
+			*y_tmp = clamp16(yuv.d[0]);
 			y_tmp += params.ay_inc;
 
 			if ((i % dst_fmt->vsub) || (j % dst_fmt->hsub))
@@ -3603,8 +3608,8 @@ static void convert_float_to_yuv16(struct fb_convert *cvt, bool alpha)
 			read_rgbf(&pair_rgb, pair_float);
 			pair_yuv = igt_matrix_transform(&m, &pair_rgb);
 
-			*u_tmp = (yuv.d[1] + pair_yuv.d[1]) / 2.0f;
-			*v_tmp = (yuv.d[2] + pair_yuv.d[2]) / 2.0f;
+			*u_tmp = clamp16((yuv.d[1] + pair_yuv.d[1]) / 2.0f);
+			*v_tmp = clamp16((yuv.d[2] + pair_yuv.d[2]) / 2.0f);
 
 			u_tmp += params.uv_inc;
 			v_tmp += params.uv_inc;
Signature · 1 line
2.25.1
#2 lore raw

[igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [i-g-t,1/2] DO NOT MERGE: NV12 Experiment

In reply to Swati Sharma
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] DO NOT MERGE: NV12 Experiment
URL : https://patchwork.freedesktop.org/series/117617/
State : failure

== Summary ==

Applying: DO NOT MERGE: NV12 Experiment
Using index info to reconstruct a base tree...
M tests/kms_pipe_crc_basic.c
Falling back to patching base and 3-way merge... Auto-merging tests/kms_pipe_crc_basic.c
CONFLICT (content): Merge conflict in tests/kms_pipe_crc_basic.c Patch failed at 0001 DO NOT MERGE: NV12 Experiment
When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".