igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2] lib/igt_fb: Added XYUV format support for testing
@ 2018-08-29 11:06 Stanislav Lisovskiy
  2018-08-30  8:05 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_fb: Added XYUV format support for testing (rev2) Patchwork
  2018-08-30  8:18 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Lisovskiy @ 2018-08-29 11:06 UTC (permalink / raw)
  To: igt-dev; +Cc: stanislav.lisovskiy, ville.syrjala, martin.peres

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.
---
 include/drm-uapi/drm_fourcc.h |  1 +
 lib/igt_fb.c                  | 93 +++++++++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+)

diff --git a/include/drm-uapi/drm_fourcc.h b/include/drm-uapi/drm_fourcc.h
index e04613d3..0bf66de2 100644
--- a/include/drm-uapi/drm_fourcc.h
+++ b/include/drm-uapi/drm_fourcc.h
@@ -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_XYUV		fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
 
 /*
  * 2 plane RGB + A
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index ae71d967..2d0311ae 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -72,6 +72,10 @@ static struct format_desc_struct {
 	  .cairo_id = CAIRO_FORMAT_RGB16_565,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
+	{ .name = "XYUV", .depth = 24, .drm_id = DRM_FORMAT_XYUV,
+	  .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, },
@@ -1500,6 +1504,88 @@ 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, planar_stride = blit->linear.stride;
+	uint8_t *buf = malloc(blit->linear.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->linear.map, blit->linear.size);
+	yuv24 = &buf[blit->linear.offsets[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 * planar_stride + j*sizeof(uint32_t)];
+			u = yuv24[i * planar_stride + j*sizeof(uint32_t) + 1];
+			y = yuv24[i * planar_stride + j*sizeof(uint32_t) + 2];
+			yuv.d[0] = v;
+			yuv.d[1] = u;
+			yuv.d[2] = y;
+			yuv.d[3] = 1.0f;
+
+			rgb = igt_matrix_transform(&m, &yuv);
+
+			write_rgb(&rgb24[i * rgb24_stride + j*sizeof(uint32_t)], &rgb);
+		}
+	}
+
+	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->linear.map;
+	unsigned rgb24_stride = blit->rgb24.stride, planar_stride = blit->linear.stride;
+	uint8_t *buf = malloc(blit->linear.size);
+	struct igt_mat4 m = igt_rgb_to_ycbcr_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->rgb24.map, blit->linear.size);
+	rgb24 = &buf[blit->linear.offsets[0]];
+
+	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)]);
+
+			yuv = igt_matrix_transform(&m, &rgb);
+
+			yuv444[i * planar_stride + j*sizeof(uint32_t)] = yuv.d[0];
+			yuv444[i * planar_stride + j*sizeof(uint32_t) + 1] = yuv.d[1];
+			yuv444[i * planar_stride + j*sizeof(uint32_t) + 2] = yuv.d[2];
+		}
+	}
+
+	free(buf);
+}
+
+
+
+
 static void convert_rgb24_to_nv12(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
 {
 	int i, j;
@@ -1756,6 +1842,9 @@ static void destroy_cairo_surface__convert(void *arg)
 	case DRM_FORMAT_VYUY:
 		convert_rgb24_to_yuyv(fb, blit, yuyv_swizzle(fb->drm_format));
 		break;
+	case DRM_FORMAT_XYUV:
+		convert_rgb24_to_yuv444(fb, blit);
+		break;
 	default:
 		igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
 			     fb->drm_format);
@@ -1809,6 +1898,9 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 	case DRM_FORMAT_VYUY:
 		convert_yuyv_to_rgb24(fb, blit, yuyv_swizzle(fb->drm_format));
 		break;
+	case DRM_FORMAT_XYUV:
+		convert_yuv444_to_rgb24(fb, blit);
+		break;
 	default:
 		igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
 			     fb->drm_format);
@@ -1825,6 +1917,7 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 				    blit, destroy_cairo_surface__convert);
 }
 
+
 /**
  * igt_get_cairo_surface:
  * @fd: open drm file descriptor
-- 
2.17.0

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_fb: Added XYUV format support for testing (rev2)
  2018-08-29 11:06 [igt-dev] [PATCH i-g-t v2] lib/igt_fb: Added XYUV format support for testing Stanislav Lisovskiy
@ 2018-08-30  8:05 ` Patchwork
  2018-08-30  8:18 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2018-08-30  8:05 UTC (permalink / raw)
  To: Stanislav Lisovskiy; +Cc: igt-dev

== Series Details ==

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

== Summary ==

= CI Bug Log - changes from IGT_4610_full -> IGTPW_1752_full =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1752_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1752_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/2/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_flip@2x-flip-vs-bad-tiling:
      shard-hsw:          SKIP -> FAIL +3

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-hsw:          PASS -> FAIL +101

    igt@kms_flip@2x-nonexisting-fb-interruptible:
      shard-glk:          PASS -> FAIL +91

    igt@kms_flip@bo-too-big-interruptible:
      shard-snb:          PASS -> FAIL +50

    igt@kms_flip@dpms-off-confusion:
      shard-glk:          NOTRUN -> FAIL +7

    igt@kms_flip@flip-vs-absolute-wf_vblank:
      shard-snb:          NOTRUN -> FAIL

    igt@kms_flip@flip-vs-bad-tiling:
      shard-kbl:          SKIP -> FAIL +1
      shard-snb:          SKIP -> FAIL +1

    igt@kms_flip@flip-vs-bad-tiling-interruptible:
      shard-glk:          SKIP -> FAIL +3
      shard-apl:          SKIP -> FAIL +1

    igt@kms_flip@flip-vs-dpms-off-vs-modeset:
      shard-apl:          PASS -> FAIL +50

    igt@kms_flip@wf_vblank-ts-check-interruptible:
      shard-kbl:          PASS -> FAIL +52

    
    ==== Warnings ====

    igt@kms_draw_crc@draw-method-xrgb2101010-mmap-wc-untiled:
      shard-snb:          SKIP -> PASS

    igt@testdisplay:
      shard-glk:          INCOMPLETE (k.org#198133, fdo#103359, fdo#107093) -> FAIL

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

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

    igt@kms_cursor_legacy@cursor-vs-flip-toggle:
      shard-hsw:          PASS -> FAIL (fdo#103355)

    igt@perf_pmu@busy-idle-rcs0:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    
    ==== Possible fixes ====

    igt@gem_ctx_isolation@vcs0-s3:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#107556) -> PASS

    igt@gem_ctx_isolation@vcs1-none:
      shard-snb:          INCOMPLETE (fdo#105411) -> SKIP

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

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-snb:          FAIL (fdo#103166) -> PASS

    
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#107093 https://bugs.freedesktop.org/show_bug.cgi?id=107093
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4610 -> IGTPW_1752
    * Linux: CI_DRM_4706 -> CI_DRM_4715

  CI_DRM_4706: 6d5687919f3a3426243041b99111b576dd0576d0 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1752: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1752/
  IGT_4610: c40743d3fce5055682d31610519758dd7379c0f8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_fb: Added XYUV format support for testing (rev2)
  2018-08-29 11:06 [igt-dev] [PATCH i-g-t v2] lib/igt_fb: Added XYUV format support for testing Stanislav Lisovskiy
  2018-08-30  8:05 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_fb: Added XYUV format support for testing (rev2) Patchwork
@ 2018-08-30  8:18 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2018-08-30  8:18 UTC (permalink / raw)
  To: Stanislav Lisovskiy; +Cc: igt-dev

== Series Details ==

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

== Summary ==

= CI Bug Log - changes from CI_DRM_4715 -> IGTPW_1752 =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1752 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1752, 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/2/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_flip@basic-flip-vs-dpms:
      fi-ilk-650:         PASS -> FAIL +4
      fi-pnv-d510:        PASS -> FAIL +3
      fi-skl-6770hq:      PASS -> FAIL +3
      fi-ivb-3520m:       PASS -> FAIL +3
      fi-snb-2520m:       NOTRUN -> FAIL +3
      fi-gdg-551:         PASS -> FAIL +3
      fi-kbl-7500u:       PASS -> FAIL +4
      fi-bdw-gvtdvm:      PASS -> FAIL +3
      fi-glk-dsi:         PASS -> FAIL +3

    igt@kms_flip@basic-flip-vs-modeset:
      fi-blb-e6850:       PASS -> FAIL +3
      fi-byt-j1900:       PASS -> FAIL +3
      fi-ivb-3770:        PASS -> FAIL +3
      fi-glk-j4005:       PASS -> FAIL +3
      fi-skl-6700hq:      PASS -> FAIL +3
      fi-bxt-j4205:       PASS -> FAIL +3
      fi-hsw-4770:        PASS -> FAIL +3
      fi-cfl-s3:          PASS -> FAIL +3

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-icl-u:           PASS -> FAIL +3
      fi-hsw-peppy:       PASS -> FAIL +3
      fi-snb-2600:        PASS -> FAIL +3
      fi-skl-6260u:       PASS -> FAIL +3
      fi-hsw-4770r:       PASS -> FAIL +3
      {fi-bdw-samus}:     PASS -> FAIL +3
      {fi-cfl-8109u}:     PASS -> FAIL +4
      fi-kbl-r:           PASS -> FAIL +3
      fi-bwr-2160:        PASS -> FAIL +3
      fi-bdw-5557u:       PASS -> FAIL +3
      {fi-bsw-kefka}:     PASS -> FAIL +3
      fi-skl-gvtdvm:      PASS -> FAIL +3
      {fi-byt-clapper}:   PASS -> FAIL +3

    igt@kms_flip@basic-plain-flip:
      fi-bsw-n3050:       PASS -> FAIL +3
      fi-byt-n2820:       PASS -> FAIL +3
      fi-cfl-guc:         PASS -> FAIL +3
      {fi-skl-iommu}:     PASS -> FAIL +3
      fi-cnl-psr:         PASS -> FAIL +3
      fi-bxt-dsi:         NOTRUN -> FAIL +3
      fi-kbl-7560u:       PASS -> FAIL +3
      fi-skl-6600u:       PASS -> FAIL +3
      fi-whl-u:           PASS -> FAIL +3
      fi-cfl-8700k:       PASS -> FAIL +3
      fi-skl-guc:         PASS -> FAIL +4
      fi-kbl-7567u:       PASS -> FAIL +3
      fi-elk-e7500:       PASS -> FAIL +3

    igt@kms_setmode@basic-clone-single-crtc:
      fi-skl-6700k2:      PASS -> FAIL +4

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      fi-kbl-7567u:       PASS -> DMESG-FAIL (fdo#106560, fdo#106947)

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       PASS -> DMESG-WARN (fdo#107139, fdo#105128)

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-FAIL (fdo#102614)

    igt@kms_pipe_crc_basic@read-crc-pipe-a:
      fi-skl-6700k2:      PASS -> FAIL (fdo#103191)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
  fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139


== Participating hosts (53 -> 49) ==

  Additional (1): fi-bxt-dsi 
  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * IGT: IGT_4610 -> IGTPW_1752

  CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1752: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1752/
  IGT_4610: c40743d3fce5055682d31610519758dd7379c0f8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-30  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-29 11:06 [igt-dev] [PATCH i-g-t v2] lib/igt_fb: Added XYUV format support for testing Stanislav Lisovskiy
2018-08-30  8:05 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_fb: Added XYUV format support for testing (rev2) Patchwork
2018-08-30  8:18 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).