* [igt-dev] [PATCH i-g-t v3] lib/igt_fb: Added XYUV format support for testing
@ 2018-09-05 12:03 Stanislav Lisovskiy
2018-09-05 12:49 ` Ville Syrjälä
2018-09-05 13:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_fb: Added XYUV format support for testing (rev3) Patchwork
0 siblings, 2 replies; 4+ messages in thread
From: Stanislav Lisovskiy @ 2018-09-05 12:03 UTC (permalink / raw)
To: igt-dev; +Cc: stanislav.lisovskiy, ville.syrjala, juha-pekka.heikkila
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.
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
include/drm-uapi/drm_fourcc.h | 1 +
lib/igt_fb.c | 93 +++++++++++++++++++++++++++++++++
tests/kms_available_modes_crc.c | 2 +
3 files changed, 96 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
diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index b67b4f83..514bf372 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -150,6 +150,7 @@ static const struct {
{ DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
{ DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
{ DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
+ { DRM_FORMAT_XYUV, 0, BYTES_PP_4, 0xffffffff},
/*
* (semi-)planar formats
@@ -479,6 +480,7 @@ test_available_modes(data_t* data)
}
igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
+ igt_output_set_pipe(output, PIPE_NONE);
igt_display_commit2(&data->display, data->commit);
}
igt_assert(invalids == 0);
--
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] 4+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3] lib/igt_fb: Added XYUV format support for testing
2018-09-05 12:03 [igt-dev] [PATCH i-g-t v3] lib/igt_fb: Added XYUV format support for testing Stanislav Lisovskiy
@ 2018-09-05 12:49 ` Ville Syrjälä
2018-09-07 8:31 ` Lisovskiy, Stanislav
2018-09-05 13:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_fb: Added XYUV format support for testing (rev3) Patchwork
1 sibling, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2018-09-05 12:49 UTC (permalink / raw)
To: Stanislav Lisovskiy; +Cc: igt-dev, ville.syrjala, juha-pekka.heikkila
On Wed, Sep 05, 2018 at 03:03:00PM +0300, Stanislav Lisovskiy wrote:
> 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.
>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
> include/drm-uapi/drm_fourcc.h | 1 +
> lib/igt_fb.c | 93 +++++++++++++++++++++++++++++++++
> tests/kms_available_modes_crc.c | 2 +
> 3 files changed, 96 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;
This should be [0]=y [1]=u [2]=v.
> + 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];
And looks like the vector elements are swapped here as well.
Also you should add xuyv handling to create_bo_for_fb() so that a
freshly allocated xuyv fb contains all black.
> + }
> + }
> +
> + 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
> diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
> index b67b4f83..514bf372 100644
> --- a/tests/kms_available_modes_crc.c
> +++ b/tests/kms_available_modes_crc.c
This should be a separate patch.
> @@ -150,6 +150,7 @@ static const struct {
> { DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
> { DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
> { DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
> + { DRM_FORMAT_XYUV, 0, BYTES_PP_4, 0xffffffff},
>
> /*
> * (semi-)planar formats
> @@ -479,6 +480,7 @@ test_available_modes(data_t* data)
> }
> igt_pipe_crc_stop(data->pipe_crc);
> igt_pipe_crc_free(data->pipe_crc);
> + igt_output_set_pipe(output, PIPE_NONE);
> igt_display_commit2(&data->display, data->commit);
> }
> igt_assert(invalids == 0);
> --
> 2.17.0
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_fb: Added XYUV format support for testing (rev3)
2018-09-05 12:03 [igt-dev] [PATCH i-g-t v3] lib/igt_fb: Added XYUV format support for testing Stanislav Lisovskiy
2018-09-05 12:49 ` Ville Syrjälä
@ 2018-09-05 13:01 ` Patchwork
1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-09-05 13:01 UTC (permalink / raw)
To: Stanislav Lisovskiy; +Cc: igt-dev
== Series Details ==
Series: lib/igt_fb: Added XYUV format support for testing (rev3)
URL : https://patchwork.freedesktop.org/series/48789/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4770 -> IGTPW_1791 =
== Summary - FAILURE ==
Serious unknown changes coming with IGTPW_1791 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_1791, 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/3/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in IGTPW_1791:
=== 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: PASS -> 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-ivb-3770: PASS -> FAIL +3
fi-glk-j4005: NOTRUN -> 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: NOTRUN -> 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: PASS -> 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: NOTRUN -> FAIL +3
igt@kms_setmode@basic-clone-single-crtc:
fi-skl-6700k2: PASS -> FAIL +4
==== Warnings ====
igt@pm_rpm@module-reload:
fi-hsw-4770r: SKIP -> PASS
== Known issues ==
Here are the changes found in IGTPW_1791 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_exec_suspend@basic-s3:
fi-skl-caroline: NOTRUN -> INCOMPLETE (fdo#104108, fdo#107556)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-blb-e6850: PASS -> INCOMPLETE (fdo#107718)
igt@kms_psr@primary_page_flip:
fi-icl-u: NOTRUN -> FAIL (fdo#107383) +3
==== Possible fixes ====
igt@drv_module_reload@basic-reload-inject:
fi-hsw-4770r: DMESG-WARN (fdo#107425) -> PASS
igt@prime_vgem@basic-fence-flip:
fi-ilk-650: FAIL (fdo#104008) -> PASS
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#107383 https://bugs.freedesktop.org/show_bug.cgi?id=107383
fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
== Participating hosts (50 -> 48) ==
Additional (4): fi-glk-j4005 fi-skl-caroline fi-icl-u fi-elk-e7500
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600
== Build changes ==
* IGT: IGT_4627 -> IGTPW_1791
CI_DRM_4770: 0c3535cf60140d017a5df73d84d06e8b1a5b5d3b @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1791: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1791/
IGT_4627: e0c3033a57d85c0d2eb33af0451afa16edc79f10 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1791/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3] lib/igt_fb: Added XYUV format support for testing
2018-09-05 12:49 ` Ville Syrjälä
@ 2018-09-07 8:31 ` Lisovskiy, Stanislav
0 siblings, 0 replies; 4+ messages in thread
From: Lisovskiy, Stanislav @ 2018-09-07 8:31 UTC (permalink / raw)
To: ville.syrjala; +Cc: igt-dev, Syrjala, Ville, Heikkila, Juha-pekka
On Wed, 2018-09-05 at 15:49 +0300, Ville Syrjälä wrote:
> On Wed, Sep 05, 2018 at 03:03:00PM +0300, Stanislav Lisovskiy wrote:
> > 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.
> >
> > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > ---
> > include/drm-uapi/drm_fourcc.h | 1 +
> > lib/igt_fb.c | 93
> > +++++++++++++++++++++++++++++++++
> > tests/kms_available_modes_crc.c | 2 +
> > 3 files changed, 96 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;
>
> This should be [0]=y [1]=u [2]=v.
Correct. I've noticed it as well, also forgot to add support
to igt_format_is_yuv function. I have fixed that stuff, however
as I look probably many cases will still fail, until XYUV support
is not merged to kernel, otherwirse drmModeAddFB2 just fails.
Just wanted to check if IGT will work, without kernel patches merged
- looks like not.
>
> > + 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];
>
> And looks like the vector elements are swapped here as well.
>
> Also you should add xuyv handling to create_bo_for_fb() so that a
> freshly allocated xuyv fb contains all black.
>
> > + }
> > + }
> > +
> > + 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
> > diff --git a/tests/kms_available_modes_crc.c
> > b/tests/kms_available_modes_crc.c
> > index b67b4f83..514bf372 100644
> > --- a/tests/kms_available_modes_crc.c
> > +++ b/tests/kms_available_modes_crc.c
>
> This should be a separate patch.
>
> > @@ -150,6 +150,7 @@ static const struct {
> > { DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
> > { DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
> > { DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
> > + { DRM_FORMAT_XYUV, 0, BYTES_PP_4, 0xffffffff},
> >
> > /*
> > * (semi-)planar formats
> > @@ -479,6 +480,7 @@ test_available_modes(data_t* data)
> > }
> > igt_pipe_crc_stop(data->pipe_crc);
> > igt_pipe_crc_free(data->pipe_crc);
> > + igt_output_set_pipe(output, PIPE_NONE);
> > igt_display_commit2(&data->display, data->commit);
> > }
> > igt_assert(invalids == 0);
> > --
> > 2.17.0
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
>
>
--
Best Regards,
Lisovskiy Stanislav
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-07 8:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05 12:03 [igt-dev] [PATCH i-g-t v3] lib/igt_fb: Added XYUV format support for testing Stanislav Lisovskiy
2018-09-05 12:49 ` Ville Syrjälä
2018-09-07 8:31 ` Lisovskiy, Stanislav
2018-09-05 13:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_fb: Added XYUV format support for testing (rev3) Patchwork
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.