Skip to contentSkip to conversation

lib/igt_fb: Added XYUV format support for testing

PATCH Superseded Stanislav Lisovskiy 3 participants 8 messages Oct 8, 2018 – Oct 24, 2018 Library code

v10 of 13 Superseded Latest is v13 →

lore
Share & tools
lore
#0 lore raw

PATCH v10 1/1 lib/igt_fb: Added XYUV format support for testing

XYUV format support has been added to DRM, modified IGT to reflect those changes.

v2: Fixed merge conflict, started to use new yuv<=>rgb
conversion functions.

v3: Fixed kms_available_modes_crc test to support new XYUV
format. Fixed a problem, where test complains that two outputs might use same pipe at the same time.

v4: Fixed convertion procedure in igt_fb to support XYUV
properly.

v5: Fixed a coding typo.

v6: Set depth equal to -1 for XYUV format in order to prevent
it to be used by igt_bpp_depth_to_drm_format, as we do not want YUV formats to be used in that case.

v7: Fix "black" color initialization for create_bo_for_fb with
proper value. Changed naming "planar_stride" to "xyuv_stride".

v8: Change naming from DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888

v9: Fixed compilation errors by rebasing to recent master.

v10: Adding reference to correspondent kernel commit with the new format
in include/drm-uapi

drm-tip:

	commit f75df2cad986f40e190ee97fe3b49dd17174f1af
	Author: Stanislav Lisovskiy <[email protected]>
	Date:   Fri Jul 6 11:57:27 2018 +0300

	    drm: Introduce new DRM_FORMAT_XYUV
---
 include/drm-uapi/drm_fourcc.h |  1 +
 lib/igt_fb.c                  | 89 +++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
include/drm-uapi/drm_fourcc.h +1 -0
index e04613d3..03e5466c 100644
@@ -112,6 +112,7 @@ extern "C" {
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
 
 #define DRM_FORMAT_AYUV		fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_XYUV8888	fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
 
 /*
  * 2 plane RGB + A
lib/igt_fb.c +89 -0

131 lines not on this page · raw message

Signature · 6 lines
2.17.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb: Added XYUV format support for testing (rev11)

== Series Details ==

== Series Details ==

Series: lib/igt_fb: Added XYUV format support for testing (rev11)
URL : https://patchwork.freedesktop.org/series/48789/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4944 -> IGTPW_1923 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/48789/revisions/11/mbox/

== Known issues ==

Here are the changes found in IGTPW_1923 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-kbl-soraka:      NOTRUN -> INCOMPLETE (fdo#107556, fdo#107859, fdo#107774)

    igt@kms_flip@basic-flip-vs-dpms:
      fi-hsw-4770r:       PASS -> DMESG-WARN (fdo#105602)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-bdw-samus:       NOTRUN -> INCOMPLETE (fdo#107773)

    igt@pm_rpm@module-reload:
      fi-hsw-peppy:       NOTRUN -> DMESG-WARN (fdo#107603, fdo#106386)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s3:
      fi-bdw-samus:       INCOMPLETE (fdo#107773) -> PASS

fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#106386 https://bugs.freedesktop.org/show_bug.cgi?id=106386
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
fdo#107859 https://bugs.freedesktop.org/show_bug.cgi?id=107859

== Participating hosts (45 -> 45) ==

Additional (5): fi-kbl-soraka fi-kbl-7560u fi-hsw-peppy fi-bwr-2160 fi-kbl-r
Missing (5): fi-ctg-p8600 fi-bsw-cyan fi-ilk-m540 fi-byt-squawks fi-icl-u2

== Build changes ==

* IGT: IGT_4670 -> IGTPW_1923

CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1923: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1923/
IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1923/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for lib/igt_fb: Added XYUV format support for testing (rev11)

In reply to Stanislav Lisovskiy
== Series Details ==

== Series Details ==

Series: lib/igt_fb: Added XYUV format support for testing (rev11)
URL : https://patchwork.freedesktop.org/series/48789/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4670_full -> IGTPW_1923_full =

== Summary - WARNING ==

Minor unknown changes coming with IGTPW_1923_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_1923_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/48789/revisions/11/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in IGTPW_1923_full:

=== IGT changes ===

    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS

== Known issues ==

Here are the changes found in IGTPW_1923_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@shrink:
      shard-glk:          PASS -> INCOMPLETE (fdo#106886, k.org#198133, fdo#103359)

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-kbl:          PASS -> INCOMPLETE (fdo#106023, fdo#103665)

    igt@gem_tiled_fence_blits@normal:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_cursor_crc@cursor-128x42-random:
      shard-kbl:          PASS -> FAIL (fdo#103232) +1

    igt@kms_cursor_crc@cursor-256x85-onscreen:
      shard-glk:          PASS -> FAIL (fdo#103232) +2

    igt@kms_cursor_crc@cursor-64x64-onscreen:
      shard-apl:          PASS -> FAIL (fdo#103232) +1

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
      shard-glk:          PASS -> FAIL (fdo#103167) +7

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-glk:          PASS -> FAIL (fdo#103166) +4

    igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
      shard-apl:          PASS -> FAIL (fdo#103166)
      shard-kbl:          PASS -> FAIL (fdo#103166)

    
    ==== Possible fixes ====

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
      shard-kbl:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_cursor_crc@cursor-256x85-sliding:
      shard-glk:          FAIL (fdo#103232) -> PASS +1

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-apl:          FAIL (fdo#103232) -> PASS +6

    igt@kms_cursor_crc@cursor-64x21-sliding:
      shard-kbl:          FAIL (fdo#103232) -> PASS

    igt@kms_cursor_crc@cursor-64x64-suspend:
      shard-apl:          FAIL (fdo#103191, fdo#103232) -> PASS

    igt@kms_cursor_legacy@cursorb-vs-flipb-toggle:
      shard-glk:          DMESG-WARN (fdo#105763, fdo#106538) -> PASS +2

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105363) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
      shard-apl:          FAIL (fdo#103167) -> PASS +4

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
      shard-kbl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-blt:
      shard-glk:          FAIL (fdo#103167) -> PASS +1

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +2
      shard-kbl:          FAIL (fdo#103166) -> PASS +2

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS
      shard-kbl:          FAIL (fdo#99912) -> PASS

    igt@kms_universal_plane@universal-plane-pipe-c-functional:
      shard-glk:          FAIL (fdo#103166) -> PASS +3

fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (6 -> 5) ==

Missing (1): shard-skl

== Build changes ==

* IGT: IGT_4670 -> IGTPW_1923
* Linux: CI_DRM_4933 -> CI_DRM_4944

CI_DRM_4933: 6b7a44d1597791524f46d7ea17620db54dffdc8c @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1923: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1923/
IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1923/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw
In reply to Stanislav Lisovskiy

Op 08-10-18 om 10:18 schreef Stanislav Lisovskiy:

Quoted 29 lines

XYUV format support has been added to DRM, modified IGT to reflect those changes.

v2: Fixed merge conflict, started to use new yuv<=>rgb
conversion functions.

v3: Fixed kms_available_modes_crc test to support new XYUV
format. Fixed a problem, where test complains that two outputs might use same pipe at the same time.

v4: Fixed convertion procedure in igt_fb to support XYUV
properly.

v5: Fixed a coding typo.

v6: Set depth equal to -1 for XYUV format in order to prevent
it to be used by igt_bpp_depth_to_drm_format, as we do not want YUV formats to be used in that case.

v7: Fix "black" color initialization for create_bo_for_fb with
proper value. Changed naming "planar_stride" to "xyuv_stride".

v8: Change naming from DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888

v9: Fixed compilation errors by rebasing to recent master.

v10: Adding reference to correspondent kernel commit with the new format
in include/drm-uapi

Quoted 6 lines

drm-tip:

	commit f75df2cad986f40e190ee97fe3b49dd17174f1af
	Author: Stanislav Lisovskiy <[email protected]>
	Date:   Fri Jul 6 11:57:27 2018 +0300

	    drm: Introduce new DRM_FORMAT_XYUV

In what tree is this commit included? I don't see it in drm-tip, drm-intel or drm-misc.

Quoted 66 lines
---
 include/drm-uapi/drm_fourcc.h |  1 +
 lib/igt_fb.c                  | 89 +++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
include/drm-uapi/drm_fourcc.h +1 -0
index e04613d3..03e5466c 100644
@@ -112,6 +112,7 @@ extern "C" {
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
 
 #define DRM_FORMAT_AYUV		fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_XYUV8888	fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
 
 /*
  * 2 plane RGB + A
lib/igt_fb.c +25 -0
index cba67f41..7d72ee2f 100644
@@ -72,6 +72,10 @@ static const struct format_desc_struct {
 	  .cairo_id = CAIRO_FORMAT_RGB16_565,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
+	{ .name = "XYUV8888", .depth = -1, .drm_id = DRM_FORMAT_XYUV8888,
+	  .cairo_id = CAIRO_FORMAT_RGB24,
+	  .num_planes = 1, .plane_bpp = { 32, },
+	},
 	{ .name = "XRGB8888", .depth = 24, .drm_id = DRM_FORMAT_XRGB8888,
 	  .cairo_id = CAIRO_FORMAT_RGB24,
 	  .num_planes = 1, .plane_bpp = { 32, },
@@ -453,6 +457,10 @@ static int create_bo_for_fb(struct igt_fb *fb)
 				       0x80,
 				       fb->strides[1] * fb->plane_height[1]);
 				break;
+			case DRM_FORMAT_XYUV8888:
+				wmemset(ptr + fb->offsets[0], full_range ? 0x00008080 : 0x00108080,
+					fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
+				break;
 			case DRM_FORMAT_YUYV:
 			case DRM_FORMAT_YVYU:
 				wmemset(ptr + fb->offsets[0],
@@ -1510,6 +1518,79 @@ static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 	free(buf);
 }
 
+static void convert_yuv444_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
+{
+	int i, j;
+	uint8_t *yuv24;
+	uint8_t *rgb24 = blit->rgb24.map;
+	unsigned rgb24_stride = blit->rgb24.stride, xyuv_stride = blit->base.linear.fb.strides[0];
+	uint8_t *buf = malloc(blit->base.linear.fb.size);
+	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb->color_encoding,
+						    fb->color_range);
+
+	/*
+	 * Reading from the BO is awfully slow because of lack of read caching,
+	 * it's faster to copy the whole BO to a temporary buffer and convert
+	 * from there.
+	 */
+	igt_memcpy_from_wc(buf, &blit->base.linear.map[blit->base.linear.fb.offsets[0]], blit->base.linear.fb.size);
+	yuv24 = buf;

lib/igt_fb.c static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo · line 1547

Quoted 10 lines
lib/igt_fb.c +10 -0
+
+	for (i = 0; i < fb->plane_height[0]; i++) {
+		for (j = 0; j < fb->plane_width[0]; j++) {
+			float y, u, v;
+			struct igt_vec4 yuv;
+			struct igt_vec4 rgb;
+
+			v = yuv24[i * xyuv_stride + j*sizeof(uint32_t)];
+			u = yuv24[i * xyuv_stride + j*sizeof(uint32_t) + 1];
+			y = yuv24[i * xyuv_stride + j*sizeof(uint32_t) + 2];

Just use '4' here.

lib/igt_fb.c static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo · line 1555

Quoted 8 lines
lib/igt_fb.c +8 -0
+			yuv.d[0] = y;
+			yuv.d[1] = u;
+			yuv.d[2] = v;
+			yuv.d[3] = 1.0f;
+
+			rgb = igt_matrix_transform(&m, &yuv);
+
+			write_rgb(&rgb24[i * rgb24_stride + j*sizeof(uint32_t)], &rgb);

^Ditto.

Quoted 15 lines
lib/igt_fb.c +15 -0
+		}
+	}
+
+	free(buf);
+}
+
+
+static void convert_rgb24_to_yuv444(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
+{
+	int i, j;
+	uint8_t *rgb24;
+	uint8_t *yuv444 = &blit->base.linear.map[blit->base.linear.fb.offsets[0]];
+	unsigned int rgb24_stride = blit->rgb24.stride, xyuv_stride = blit->base.linear.fb.strides[0];
+	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb->color_encoding,
+						    fb->color_range);

lib/igt_fb.c static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo · line 1580

Quoted 10 lines
lib/igt_fb.c +10 -0
+
+	rgb24 = blit->rgb24.map;
+
+	for (i = 0; i < fb->plane_height[0]; i++) {
+		for (j = 0; j < fb->plane_width[0]; j++) {
+			struct igt_vec4 rgb;
+			struct igt_vec4 yuv;
+			float y, u, v;
+
+			read_rgb(&rgb, &rgb24[i * rgb24_stride + j*sizeof(uint32_t)]);

^

lib/igt_fb.c static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo · line 1586

Quoted 5 lines
lib/igt_fb.c +5 -0
+			yuv = igt_matrix_transform(&m, &rgb);
+
+			yuv444[i * xyuv_stride + j*sizeof(uint32_t)] = yuv.d[2];
+			yuv444[i * xyuv_stride + j*sizeof(uint32_t) + 1] = yuv.d[1];
+			yuv444[i * xyuv_stride + j*sizeof(uint32_t) + 2] = yuv.d[0];

Ditto.

Otherwise looks good, so with that fixed:

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw
Quoted 36 lines · Maarten Lankhorst

Op 08-10-18 om 10:18 schreef Stanislav Lisovskiy:

Quoted 35 lines

XYUV format support has been added to DRM, modified IGT to reflect those changes.

v2: Fixed merge conflict, started to use new yuv<=>rgb
conversion functions.

v3: Fixed kms_available_modes_crc test to support new XYUV
format. Fixed a problem, where test complains that two outputs might use same pipe at the same time.

v4: Fixed convertion procedure in igt_fb to support XYUV
properly.

v5: Fixed a coding typo.

v6: Set depth equal to -1 for XYUV format in order to prevent
it to be used by igt_bpp_depth_to_drm_format, as we do not want YUV formats to be used in that case.

v7: Fix "black" color initialization for create_bo_for_fb with
proper value. Changed naming "planar_stride" to "xyuv_stride".

v8: Change naming from DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888

v9: Fixed compilation errors by rebasing to recent master.

v10: Adding reference to correspondent kernel commit with the new format
in include/drm-uapi

drm-tip:

	commit f75df2cad986f40e190ee97fe3b49dd17174f1af
	Author: Stanislav Lisovskiy <[email protected]>
	Date:   Fri Jul 6 11:57:27 2018 +0300
Quoted 4 lines
Quoted 1 line

drm: Introduce new DRM_FORMAT_XYUV

In what tree is this commit included? I don't see it in drm-tip, drm- intel or drm-misc.

The patch is under review still. It got "Reviewed-by" just last week.

Quoted 83 lines
Quoted 83 lines
---
 include/drm-uapi/drm_fourcc.h |  1 +
 lib/igt_fb.c                  | 89
+++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
include/drm- renamed from include/drm-uapi/drm_fourcc.h +0 -0

uapi/drm_fourcc.h
index e04613d3..03e5466c 100644

include/drm-uapi/drm_fourcc.h +0 -0
@@ -112,6 +112,7 @@ extern "C" {
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U',

'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */

#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U',
'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V')
/* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */

/*
* 2 plane RGB + A

lib/igt_fb.c +4 -0
index cba67f41..7d72ee2f 100644
@@ -72,6 +72,10 @@ static const struct format_desc_struct {
 	  .cairo_id = CAIRO_FORMAT_RGB16_565,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
+	{ .name = "XYUV8888", .depth = -1, .drm_id =
 DRM_FORMAT_XYUV8888,
+	  .cairo_id = CAIRO_FORMAT_RGB24,
+	  .num_planes = 1, .plane_bpp = { 32, },
+	},
 	{ .name = "XRGB8888", .depth = 24, .drm_id =
 DRM_FORMAT_XRGB8888,
lib/igt_fb.c +4 -0
 	  .cairo_id = CAIRO_FORMAT_RGB24,
 	  .num_planes = 1, .plane_bpp = { 32, },
@@ -453,6 +457,10 @@ static int create_bo_for_fb(struct igt_fb *fb)
 				       0x80,
 				       fb->strides[1] * fb-
 >plane_height[1]);
 				break;
+			case DRM_FORMAT_XYUV8888:
+				wmemset(ptr + fb->offsets[0],
 full_range ? 0x00008080 : 0x00108080,
+					fb->strides[0] * fb-
 >plane_height[0] / sizeof(wchar_t));
+				break;
lib/igt_fb.c +0 -0
 			case DRM_FORMAT_YUYV:
 			case DRM_FORMAT_YVYU:
 				wmemset(ptr + fb->offsets[0],
@@ -1510,6 +1518,79 @@ static void convert_nv12_to_rgb24(struct

igt_fb *fb, struct fb_convert_blit_uplo

lib/igt_fb.c +1 -0
 	free(buf);
 }
 
+static void convert_yuv444_to_rgb24(struct igt_fb *fb, struct

fb_convert_blit_upload *blit)

lib/igt_fb.c +5 -0
+{
+	int i, j;
+	uint8_t *yuv24;
+	uint8_t *rgb24 = blit->rgb24.map;
+	unsigned rgb24_stride = blit->rgb24.stride, xyuv_stride =

blit->base.linear.fb.strides[0];

lib/igt_fb.c +2 -0
+	uint8_t *buf = malloc(blit->base.linear.fb.size);
+	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb-
Quoted 1 line

color_encoding,

lib/igt_fb.c +1 -0
+						    fb-
Quoted 1 line

color_range);

lib/igt_fb.c +3 -0
+
+	/*
+	 * Reading from the BO is awfully slow because of lack of

read caching,

lib/igt_fb.c +1 -0
+	 * it's faster to copy the whole BO to a temporary buffer

and convert

lib/igt_fb.c +3 -0
+	 * from there.
+	 */
+	igt_memcpy_from_wc(buf, &blit->base.linear.map[blit-
Quoted 1 line

base.linear.fb.offsets[0]], blit->base.linear.fb.size);

Quoted 16 lines
Quoted 13 lines
lib/igt_fb.c +9 -0
+	yuv24 = buf;
+
+	for (i = 0; i < fb->plane_height[0]; i++) {
+		for (j = 0; j < fb->plane_width[0]; j++) {
+			float y, u, v;
+			struct igt_vec4 yuv;
+			struct igt_vec4 rgb;
+
+			v = yuv24[i * xyuv_stride +

j*sizeof(uint32_t)];

lib/igt_fb.c +1 -0
+			u = yuv24[i * xyuv_stride +

j*sizeof(uint32_t) + 1];

lib/igt_fb.c +1 -0
+			y = yuv24[i * xyuv_stride +
Quoted 1 line

j*sizeof(uint32_t) + 2];

Just use '4' here.

Didn't want to use magic numbers, however you right - being 32-bit usually means the same thing anyway :)

Quoted 57 lines
Quoted 9 lines
lib/igt_fb.c +8 -0
+			yuv.d[0] = y;
+			yuv.d[1] = u;
+			yuv.d[2] = v;
+			yuv.d[3] = 1.0f;
+
+			rgb = igt_matrix_transform(&m, &yuv);
+
+			write_rgb(&rgb24[i * rgb24_stride +

j*sizeof(uint32_t)], &rgb);

^Ditto.

Quoted 30 lines
lib/igt_fb.c +8 -0
+		}
+	}
+
+	free(buf);
+}
+
+
+static void convert_rgb24_to_yuv444(struct igt_fb *fb, struct

fb_convert_blit_upload *blit)

lib/igt_fb.c +4 -0
+{
+	int i, j;
+	uint8_t *rgb24;
+	uint8_t *yuv444 = &blit->base.linear.map[blit-
Quoted 1 line

base.linear.fb.offsets[0]];

lib/igt_fb.c +1 -0
+	unsigned int rgb24_stride = blit->rgb24.stride,

xyuv_stride = blit->base.linear.fb.strides[0];

lib/igt_fb.c +1 -0
+	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb-
Quoted 1 line

color_encoding,

lib/igt_fb.c +1 -0
+						    fb-
Quoted 1 line

color_range);

lib/igt_fb.c +10 -0
+
+	rgb24 = blit->rgb24.map;
+
+	for (i = 0; i < fb->plane_height[0]; i++) {
+		for (j = 0; j < fb->plane_width[0]; j++) {
+			struct igt_vec4 rgb;
+			struct igt_vec4 yuv;
+			float y, u, v;
+
+			read_rgb(&rgb, &rgb24[i * rgb24_stride +
Quoted 1 line

j*sizeof(uint32_t)]);

^

Quoted 8 lines
lib/igt_fb.c +3 -0
+			yuv = igt_matrix_transform(&m, &rgb);
+
+			yuv444[i * xyuv_stride +

j*sizeof(uint32_t)] = yuv.d[2];

lib/igt_fb.c +1 -0
+			yuv444[i * xyuv_stride +

j*sizeof(uint32_t) + 1] = yuv.d[1];

lib/igt_fb.c +1 -0
+			yuv444[i * xyuv_stride +

j*sizeof(uint32_t) + 2] = yuv.d[0];

Ditto.

Otherwise looks good, so with that fixed:

Signature · 7 lines
Best Regards,

Lisovskiy Stanislav
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#5 lore raw

Op 23-10-18 om 15:51 schreef Lisovskiy, Stanislav:

Quoted 37 lines · Maarten Lankhorst
Quoted 36 lines

Op 08-10-18 om 10:18 schreef Stanislav Lisovskiy:

Quoted 35 lines

XYUV format support has been added to DRM, modified IGT to reflect those changes.

v2: Fixed merge conflict, started to use new yuv<=>rgb
conversion functions.

v3: Fixed kms_available_modes_crc test to support new XYUV
format. Fixed a problem, where test complains that two outputs might use same pipe at the same time.

v4: Fixed convertion procedure in igt_fb to support XYUV
properly.

v5: Fixed a coding typo.

v6: Set depth equal to -1 for XYUV format in order to prevent
it to be used by igt_bpp_depth_to_drm_format, as we do not want YUV formats to be used in that case.

v7: Fix "black" color initialization for create_bo_for_fb with
proper value. Changed naming "planar_stride" to "xyuv_stride".

v8: Change naming from DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888

v9: Fixed compilation errors by rebasing to recent master.

v10: Adding reference to correspondent kernel commit with the new format
in include/drm-uapi

drm-tip:

	commit f75df2cad986f40e190ee97fe3b49dd17174f1af
	Author: Stanislav Lisovskiy <[email protected]>
	Date:   Fri Jul 6 11:57:27 2018 +0300
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

drm: Introduce new DRM_FORMAT_XYUV

In what tree is this commit included? I don't see it in drm-tip, drm- intel or drm-misc.

The patch is under review still. It got "Reviewed-by" just last week.

Then there's no sense in linking to a commit, a commit ID only exists if it's in drm-misc or drm-intel. :)

~Maarten
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#6 lore raw
Quoted 47 lines · Maarten Lankhorst

Op 23-10-18 om 15:51 schreef Lisovskiy, Stanislav:

Quoted 46 lines · Maarten Lankhorst
Quoted 44 lines

Op 08-10-18 om 10:18 schreef Stanislav Lisovskiy:

Quoted 32 lines

XYUV format support has been added to DRM, modified IGT to reflect those changes.

v2: Fixed merge conflict, started to use new yuv<=>rgb
conversion functions.

v3: Fixed kms_available_modes_crc test to support new XYUV
format. Fixed a problem, where test complains that two outputs might use same pipe at the same time.

v4: Fixed convertion procedure in igt_fb to support XYUV
properly.

v5: Fixed a coding typo.

v6: Set depth equal to -1 for XYUV format in order to prevent
it to be used by igt_bpp_depth_to_drm_format, as we do not want YUV formats to be used in that case.

v7: Fix "black" color initialization for create_bo_for_fb with
proper value. Changed naming "planar_stride" to
"xyuv_stride".

v8: Change naming from DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888

v9: Fixed compilation errors by rebasing to recent master.

v10: Adding reference to correspondent kernel commit with the new
format
in include/drm-uapi

Quoted 7 lines

drm-tip:

	commit f75df2cad986f40e190ee97fe3b49dd17174f1af
	Author: Stanislav Lisovskiy <stanislav.lisovskiy@intel.
com>
	Date:   Fri Jul 6 11:57:27 2018 +0300

	    drm: Introduce new DRM_FORMAT_XYUV

In what tree is this commit included? I don't see it in drm-tip, drm-
intel or drm-misc.

Quoted 6 lines
Quoted 2 lines

The patch is under review still. It got "Reviewed-by" just last week.

Then there's no sense in linking to a commit, a commit ID only exists if it's in drm-misc or drm-intel. :)

Totally agree :) I was asked to include the commit id, but probably I misunderstood the request. Should it be included once, the kernel code is in drm-tip?

Quoted 1 line

~Maarten

Signature · 7 lines
Best Regards,

Lisovskiy Stanislav
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#7 lore raw

Op 24-10-18 om 08:42 schreef Lisovskiy, Stanislav:

Quoted 46 lines · Maarten Lankhorst
Quoted 45 lines

Op 23-10-18 om 15:51 schreef Lisovskiy, Stanislav:

Quoted 44 lines · Maarten Lankhorst
Quoted 43 lines

Op 08-10-18 om 10:18 schreef Stanislav Lisovskiy:

Quoted 32 lines

XYUV format support has been added to DRM, modified IGT to reflect those changes.

v2: Fixed merge conflict, started to use new yuv<=>rgb
conversion functions.

v3: Fixed kms_available_modes_crc test to support new XYUV
format. Fixed a problem, where test complains that two outputs might use same pipe at the same time.

v4: Fixed convertion procedure in igt_fb to support XYUV
properly.

v5: Fixed a coding typo.

v6: Set depth equal to -1 for XYUV format in order to prevent
it to be used by igt_bpp_depth_to_drm_format, as we do not want YUV formats to be used in that case.

v7: Fix "black" color initialization for create_bo_for_fb with
proper value. Changed naming "planar_stride" to
"xyuv_stride".

v8: Change naming from DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888

v9: Fixed compilation errors by rebasing to recent master.

v10: Adding reference to correspondent kernel commit with the new
format
in include/drm-uapi

Quoted 7 lines

drm-tip:

	commit f75df2cad986f40e190ee97fe3b49dd17174f1af
	Author: Stanislav Lisovskiy <stanislav.lisovskiy@intel.
com>
	Date:   Fri Jul 6 11:57:27 2018 +0300

	    drm: Introduce new DRM_FORMAT_XYUV

In what tree is this commit included? I don't see it in drm-tip, drm-
intel or drm-misc.

Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

The patch is under review still. It got "Reviewed-by" just last week.

Then there's no sense in linking to a commit, a commit ID only exists if it's in drm-misc or drm-intel. :)

Totally agree :) I was asked to include the commit id, but probably I misunderstood the request. Should it be included once, the kernel code is in drm-tip?

Quoted 1 line

~Maarten

Yes, before that you cannot include it since it only exists on your own machine. :)

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev