All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
@ 2019-09-09 18:29 Wang, Chao-kai (Stylon)
  2019-09-09 19:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wang, Chao-kai (Stylon) @ 2019-09-09 18:29 UTC (permalink / raw)
  To: igt-dev

From: Stylon Wang <stylon.wang@amd.com>

HDMI 2.0 compliance tests needs 4K modes with YUV encoding.
This test selects 4K modes based on specified VIC.

Change-Id: I32f4793240764582fdbd47ffdd4a9661e66a5105
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
---
 tools/Makefile.am                  |   3 +
 tools/Makefile.sources             |   4 +
 tools/amd_hdmi_compliance_yuv420.c | 193 +++++++++++++++++++++++++++++
 tools/meson.build                  |   5 +
 4 files changed, 205 insertions(+)
 create mode 100644 tools/amd_hdmi_compliance_yuv420.c

diff --git a/tools/Makefile.am b/tools/Makefile.am
index 4f54720f..1a23e078 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -11,6 +11,9 @@ bin_PROGRAMS += intel_dp_compliance
 intel_dp_compliance_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
 intel_dp_compliance_LDADD = $(top_builddir)/lib/libintel_tools.la
 
+bin_PROGRAMS += amd_hdmi_compliance_yuv420
+amd_hdmi_compliance_yuv420_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
+
 SUBDIRS = null_state_gen registers
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include/drm-uapi -I$(top_srcdir)/lib \
diff --git a/tools/Makefile.sources b/tools/Makefile.sources
index 50706f41..8196cb59 100644
--- a/tools/Makefile.sources
+++ b/tools/Makefile.sources
@@ -66,3 +66,7 @@ intel_dp_compliance_SOURCES = \
         intel_dp_compliance_hotplug.c \
         $(NULL)
 
+amd_hdmi_compliance_yuv420_SOURCES = \
+        amd_hdmi_compliance_yuv420.c \
+		$(NULL)
+
diff --git a/tools/amd_hdmi_compliance_yuv420.c b/tools/amd_hdmi_compliance_yuv420.c
new file mode 100644
index 00000000..5f5eae2c
--- /dev/null
+++ b/tools/amd_hdmi_compliance_yuv420.c
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2019 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "igt.h"
+
+/* Common test data */
+typedef struct data {
+	struct igt_fb pattern_fb_info;
+	int fd;
+	igt_display_t display;
+	igt_plane_t *primary;
+	igt_output_t *output;
+	igt_pipe_t *pipe;
+	enum pipe pipe_id;
+	bool use_virtual_connector;
+} data_t;
+
+// Video modes indexed by VIC
+static drmModeModeInfo test_modes[] = {
+	[1] = { 25175,
+			640, 656, 752, 800, 0,
+			480, 489, 492, 525, 0,
+			60, 0xa, 0x40,
+			"640x480",	/* VIC 1 */
+	},
+	[96] = { 594000,
+			 3840, 4896, 4984, 5280, 0,
+			 2160, 2168, 2178, 2250, 0,
+			50, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
+			"3840x2160",	/* VIC 96 */
+	},
+	[97] = { 594000,
+			3840, 4016, 4104, 4400, 0,
+			2160, 2168, 2178, 2250, 0,
+			60, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
+			"3840x2160",	/* VIC 97 */
+	},
+	[101] = { 594000,
+			  4096, 5064, 5152, 5280, 0,
+			  2160, 2168, 2178, 2250, 0,
+			  50, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
+			  "4096x2160",	/* VIC 101 */
+	},
+	[102] = { 594000,
+			  4096, 4184, 4272, 4400, 0,
+			  2160, 2168, 2178, 2250, 0,
+			  60, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
+			  "4096x2160",	/* VIC 102 */
+	},
+	[106] = { 594000,
+			 3840, 4896, 4984, 5280, 0,
+			 2160, 2168, 2178, 2250, 0,
+			50, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
+			"3840x2160",	/* VIC 106 */
+	},
+	[107] = { 594000,
+			3840, 4016, 4104, 4400, 0,
+			2160, 2168, 2178, 2250, 0,
+			60, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
+			"3840x2160",	/* VIC 107 */
+	},
+};
+
+/* Common test setup. */
+static void test_init(data_t *data)
+{
+	igt_display_t *display = &data->display;
+
+	data->pipe_id = PIPE_A;
+	data->pipe = &data->display.pipes[data->pipe_id];
+
+	igt_display_reset(display);
+
+	/* find a connected HDMI output */
+	data->output = NULL;
+	for (int i=0; i < data->display.n_outputs; ++i) {
+		drmModeConnector *connector = data->display.outputs[i].config.connector;
+		if (connector->connection == DRM_MODE_CONNECTED &&
+				(connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+				 (data->use_virtual_connector &&
+				  connector->connector_type == DRM_MODE_CONNECTOR_VIRTUAL))) {
+			data->output = &data->display.outputs[i];
+		}
+	}
+
+	igt_require(data->output);
+
+	data->primary =
+		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
+
+	igt_output_set_pipe(data->output, data->pipe_id);
+
+}
+
+/* Common test cleanup. */
+static void test_fini(data_t *data)
+{
+	igt_display_reset(&data->display);
+}
+
+static void test_vic_mode(data_t *data, int vic)
+{
+	igt_display_t *display = &data->display;
+	drmModeModeInfo *mode;
+	igt_fb_t afb;
+
+	test_init(data);
+
+	mode = &test_modes[vic];
+
+	igt_output_override_mode(data->output, mode);
+
+	igt_create_pattern_fb(data->fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, 0, &afb);
+
+	igt_plane_set_fb(data->primary, &afb);
+
+	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+	fprintf(stderr, "Press [Enter] to finish\n");
+	getchar();
+
+	test_fini(data);
+}
+
+const char *optstr = "hvt:";
+static void usage(const char *name)
+{
+	fprintf(stderr, "Usage: %s [-ht]\n", name);
+	fprintf(stderr, "-h:	show help\n");
+	fprintf(stderr, "-t vic: select video mode based on VIC\n");
+	fprintf(stderr, "-v:	test on 'Virtual' connector as well, for debugging.\n");
+}
+
+int main(int argc, char **argv)
+{
+	data_t data;
+	int c;
+	int vic = 1; /* default to VIC 1 (640x480) */
+
+	memset(&data, 0, sizeof(data));
+
+	while((c = getopt(argc, argv, optstr)) != -1) {
+		switch(c) {
+		case 't':
+			vic = atoi(optarg);
+			break;
+		case 'v':
+			data.use_virtual_connector = true;
+			break;
+		default:
+		case 'h':
+			usage(argv[0]);
+			exit(1);
+		}
+	}
+
+	if (vic < 1 ||
+		vic > ARRAY_SIZE(test_modes) ||
+		!test_modes[vic].name[0]) {
+		fprintf(stderr, "VIC %d is not supported\n", vic);
+		exit(1);
+	}
+
+	data.fd = drm_open_driver_master(DRIVER_ANY);
+	kmstest_set_vt_graphics_mode();
+
+	igt_display_require(&data.display, data.fd);
+	igt_require(data.display.is_atomic);
+	igt_display_require_output(&data.display);
+
+	test_vic_mode(&data, vic);
+
+	igt_display_fini(&data.display);
+}
diff --git a/tools/meson.build b/tools/meson.build
index 6e72b263..fa366ab2 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -100,6 +100,11 @@ executable('intel_gpu_top', 'intel_gpu_top.c',
 	   install_rpath : bindir_rpathdir,
 	   dependencies : lib_igt_perf)
 
+executable('amd_hdmi_compliance_yuv420', 'amd_hdmi_compliance_yuv420.c',
+	   dependencies : [tool_deps],
+	   install_rpath : bindir_rpathdir,
+	   install : true)
+
 conf_data = configuration_data()
 conf_data.set('prefix', prefix)
 conf_data.set('exec_prefix', '${prefix}')
-- 
2.17.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
  2019-09-09 18:29 [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding Wang, Chao-kai (Stylon)
@ 2019-09-09 19:11 ` Patchwork
  2019-09-09 20:40 ` [igt-dev] [PATCH i-g-t] " Harry Wentland
  2019-09-10  3:36 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2019-09-09 19:11 UTC (permalink / raw)
  To: Wang, Chao-kai (Stylon); +Cc: igt-dev

== Series Details ==

Series: tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
URL   : https://patchwork.freedesktop.org/series/66451/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6854 -> IGTPW_3438
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/66451/revisions/1/mbox/

Known issues
------------

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

### IGT changes ###

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

  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167


Participating hosts (51 -> 47)
------------------------------

  Additional (3): fi-icl-dsi fi-cfl-guc fi-icl-u3 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5176 -> IGTPW_3438

  CI-20190529: 20190529
  CI_DRM_6854: 5a70800ed2837e2d35a331e2cfd43a55df58c4fc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3438: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/
  IGT_5176: 0102dcf4e2e8b357b59173fe1ff78069148080c6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
  2019-09-09 18:29 [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding Wang, Chao-kai (Stylon)
  2019-09-09 19:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2019-09-09 20:40 ` Harry Wentland
  2019-09-10  3:36 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Harry Wentland @ 2019-09-09 20:40 UTC (permalink / raw)
  To: Wang, Chao-kai (Stylon), igt-dev

On 2019-09-09 2:29 p.m., Wang, Chao-kai (Stylon) wrote:
> From: Stylon Wang <stylon.wang@amd.com>
> 
> HDMI 2.0 compliance tests needs 4K modes with YUV encoding.
> This test selects 4K modes based on specified VIC.
> 
> Change-Id: I32f4793240764582fdbd47ffdd4a9661e66a5105

Drop the Change-Id for upstream.

> Signed-off-by: Stylon Wang <stylon.wang@amd.com>
> ---
>   tools/Makefile.am                  |   3 +
>   tools/Makefile.sources             |   4 +
>   tools/amd_hdmi_compliance_yuv420.c | 193 +++++++++++++++++++++++++++++
>   tools/meson.build                  |   5 +
>   4 files changed, 205 insertions(+)
>   create mode 100644 tools/amd_hdmi_compliance_yuv420.c
> 
> diff --git a/tools/Makefile.am b/tools/Makefile.am
> index 4f54720f..1a23e078 100644
> --- a/tools/Makefile.am
> +++ b/tools/Makefile.am
> @@ -11,6 +11,9 @@ bin_PROGRAMS += intel_dp_compliance
>   intel_dp_compliance_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
>   intel_dp_compliance_LDADD = $(top_builddir)/lib/libintel_tools.la
>   
> +bin_PROGRAMS += amd_hdmi_compliance_yuv420
> +amd_hdmi_compliance_yuv420_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
> +
>   SUBDIRS = null_state_gen registers
>   
>   AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include/drm-uapi -I$(top_srcdir)/lib \
> diff --git a/tools/Makefile.sources b/tools/Makefile.sources
> index 50706f41..8196cb59 100644
> --- a/tools/Makefile.sources
> +++ b/tools/Makefile.sources
> @@ -66,3 +66,7 @@ intel_dp_compliance_SOURCES = \
>           intel_dp_compliance_hotplug.c \
>           $(NULL)
>   
> +amd_hdmi_compliance_yuv420_SOURCES = \
> +        amd_hdmi_compliance_yuv420.c \
> +		$(NULL)
> +
> diff --git a/tools/amd_hdmi_compliance_yuv420.c b/tools/amd_hdmi_compliance_yuv420.c
> new file mode 100644
> index 00000000..5f5eae2c
> --- /dev/null
> +++ b/tools/amd_hdmi_compliance_yuv420.c
> @@ -0,0 +1,193 @@
> +/*
> + * Copyright 2019 Advanced Micro Devices, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +#include "igt.h"
> +
> +/* Common test data */
> +typedef struct data {
> +	struct igt_fb pattern_fb_info;
> +	int fd;
> +	igt_display_t display;
> +	igt_plane_t *primary;
> +	igt_output_t *output;
> +	igt_pipe_t *pipe;
> +	enum pipe pipe_id;
> +	bool use_virtual_connector;
> +} data_t;
> +
> +// Video modes indexed by VIC
> +static drmModeModeInfo test_modes[] = {
> +	[1] = { 25175,
> +			640, 656, 752, 800, 0,
> +			480, 489, 492, 525, 0,
> +			60, 0xa, 0x40,
> +			"640x480",	/* VIC 1 */

Looks like you're using 4 spaces = 1 tab. Please change your editor to 8 
spaces = 1 tab.

Otherwise it looks good. With those things fixed this patch is

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> +	},
> +	[96] = { 594000,
> +			 3840, 4896, 4984, 5280, 0,
> +			 2160, 2168, 2178, 2250, 0,
> +			50, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
> +			"3840x2160",	/* VIC 96 */
> +	},
> +	[97] = { 594000,
> +			3840, 4016, 4104, 4400, 0,
> +			2160, 2168, 2178, 2250, 0,
> +			60, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
> +			"3840x2160",	/* VIC 97 */
> +	},
> +	[101] = { 594000,
> +			  4096, 5064, 5152, 5280, 0,
> +			  2160, 2168, 2178, 2250, 0,
> +			  50, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
> +			  "4096x2160",	/* VIC 101 */
> +	},
> +	[102] = { 594000,
> +			  4096, 4184, 4272, 4400, 0,
> +			  2160, 2168, 2178, 2250, 0,
> +			  60, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
> +			  "4096x2160",	/* VIC 102 */
> +	},
> +	[106] = { 594000,
> +			 3840, 4896, 4984, 5280, 0,
> +			 2160, 2168, 2178, 2250, 0,
> +			50, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
> +			"3840x2160",	/* VIC 106 */
> +	},
> +	[107] = { 594000,
> +			3840, 4016, 4104, 4400, 0,
> +			2160, 2168, 2178, 2250, 0,
> +			60, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
> +			"3840x2160",	/* VIC 107 */
> +	},
> +};
> +
> +/* Common test setup. */
> +static void test_init(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +
> +	data->pipe_id = PIPE_A;
> +	data->pipe = &data->display.pipes[data->pipe_id];
> +
> +	igt_display_reset(display);
> +
> +	/* find a connected HDMI output */
> +	data->output = NULL;
> +	for (int i=0; i < data->display.n_outputs; ++i) {
> +		drmModeConnector *connector = data->display.outputs[i].config.connector;
> +		if (connector->connection == DRM_MODE_CONNECTED &&
> +				(connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> +				 (data->use_virtual_connector &&
> +				  connector->connector_type == DRM_MODE_CONNECTOR_VIRTUAL))) {
> +			data->output = &data->display.outputs[i];
> +		}
> +	}
> +
> +	igt_require(data->output);
> +
> +	data->primary =
> +		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
> +
> +	igt_output_set_pipe(data->output, data->pipe_id);
> +
> +}
> +
> +/* Common test cleanup. */
> +static void test_fini(data_t *data)
> +{
> +	igt_display_reset(&data->display);
> +}
> +
> +static void test_vic_mode(data_t *data, int vic)
> +{
> +	igt_display_t *display = &data->display;
> +	drmModeModeInfo *mode;
> +	igt_fb_t afb;
> +
> +	test_init(data);
> +
> +	mode = &test_modes[vic];
> +
> +	igt_output_override_mode(data->output, mode);
> +
> +	igt_create_pattern_fb(data->fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, 0, &afb);
> +
> +	igt_plane_set_fb(data->primary, &afb);
> +
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	fprintf(stderr, "Press [Enter] to finish\n");
> +	getchar();
> +
> +	test_fini(data);
> +}
> +
> +const char *optstr = "hvt:";
> +static void usage(const char *name)
> +{
> +	fprintf(stderr, "Usage: %s [-ht]\n", name);
> +	fprintf(stderr, "-h:	show help\n");
> +	fprintf(stderr, "-t vic: select video mode based on VIC\n");
> +	fprintf(stderr, "-v:	test on 'Virtual' connector as well, for debugging.\n");
> +}
> +
> +int main(int argc, char **argv)
> +{
> +	data_t data;
> +	int c;
> +	int vic = 1; /* default to VIC 1 (640x480) */
> +
> +	memset(&data, 0, sizeof(data));
> +
> +	while((c = getopt(argc, argv, optstr)) != -1) {
> +		switch(c) {
> +		case 't':
> +			vic = atoi(optarg);
> +			break;
> +		case 'v':
> +			data.use_virtual_connector = true;
> +			break;
> +		default:
> +		case 'h':
> +			usage(argv[0]);
> +			exit(1);
> +		}
> +	}
> +
> +	if (vic < 1 ||
> +		vic > ARRAY_SIZE(test_modes) ||
> +		!test_modes[vic].name[0]) {
> +		fprintf(stderr, "VIC %d is not supported\n", vic);
> +		exit(1);
> +	}
> +
> +	data.fd = drm_open_driver_master(DRIVER_ANY);
> +	kmstest_set_vt_graphics_mode();
> +
> +	igt_display_require(&data.display, data.fd);
> +	igt_require(data.display.is_atomic);
> +	igt_display_require_output(&data.display);
> +
> +	test_vic_mode(&data, vic);
> +
> +	igt_display_fini(&data.display);
> +}
> diff --git a/tools/meson.build b/tools/meson.build
> index 6e72b263..fa366ab2 100644
> --- a/tools/meson.build
> +++ b/tools/meson.build
> @@ -100,6 +100,11 @@ executable('intel_gpu_top', 'intel_gpu_top.c',
>   	   install_rpath : bindir_rpathdir,
>   	   dependencies : lib_igt_perf)
>   
> +executable('amd_hdmi_compliance_yuv420', 'amd_hdmi_compliance_yuv420.c',
> +	   dependencies : [tool_deps],
> +	   install_rpath : bindir_rpathdir,
> +	   install : true)
> +
>   conf_data = configuration_data()
>   conf_data.set('prefix', prefix)
>   conf_data.set('exec_prefix', '${prefix}')
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
  2019-09-09 18:29 [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding Wang, Chao-kai (Stylon)
  2019-09-09 19:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2019-09-09 20:40 ` [igt-dev] [PATCH i-g-t] " Harry Wentland
@ 2019-09-10  3:36 ` Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2019-09-10  3:36 UTC (permalink / raw)
  To: Wang, Chao-kai (Stylon); +Cc: igt-dev

== Series Details ==

Series: tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
URL   : https://patchwork.freedesktop.org/series/66451/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6854_full -> IGTPW_3438_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/66451/revisions/1/mbox/

Known issues
------------

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_schedule@independent-bsd1:
    - shard-iclb:         [PASS][1] -> [SKIP][2] ([fdo#109276]) +16 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@gem_exec_schedule@independent-bsd1.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb8/igt@gem_exec_schedule@independent-bsd1.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#111325]) +2 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb6/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb2/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * igt@gem_linear_blits@normal:
    - shard-apl:          [PASS][5] -> [INCOMPLETE][6] ([fdo#103927]) +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-apl6/igt@gem_linear_blits@normal.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-apl8/igt@gem_linear_blits@normal.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-render:
    - shard-iclb:         [PASS][7] -> [FAIL][8] ([fdo#103167]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-render.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-render.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [PASS][9] -> [SKIP][10] ([fdo#109642] / [fdo#111068])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@kms_psr2_su@frontbuffer.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb5/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_sprite_plane_move:
    - shard-iclb:         [PASS][11] -> [SKIP][12] ([fdo#109441]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb6/igt@kms_psr@psr2_sprite_plane_move.html

  * igt@kms_vblank@pipe-c-ts-continuation-suspend:
    - shard-apl:          [PASS][13] -> [DMESG-WARN][14] ([fdo#108566]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-apl2/igt@kms_vblank@pipe-c-ts-continuation-suspend.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-apl6/igt@kms_vblank@pipe-c-ts-continuation-suspend.html

  
#### Possible fixes ####

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][15] ([fdo#110841]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb7/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_balancer@smoke:
    - shard-iclb:         [SKIP][17] ([fdo#110854]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb6/igt@gem_exec_balancer@smoke.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb4/igt@gem_exec_balancer@smoke.html

  * igt@gem_exec_schedule@fifo-bsd:
    - shard-iclb:         [SKIP][19] ([fdo#111325]) -> [PASS][20] +3 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@gem_exec_schedule@fifo-bsd.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb3/igt@gem_exec_schedule@fifo-bsd.html

  * igt@gem_exec_schedule@preempt-other-bsd1:
    - shard-iclb:         [SKIP][21] ([fdo#109276]) -> [PASS][22] +14 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb3/igt@gem_exec_schedule@preempt-other-bsd1.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb4/igt@gem_exec_schedule@preempt-other-bsd1.html

  * igt@i915_pm_rc6_residency@rc6-accuracy:
    - shard-snb:          [SKIP][23] ([fdo#109271]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-snb4/igt@i915_pm_rc6_residency@rc6-accuracy.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-snb5/igt@i915_pm_rc6_residency@rc6-accuracy.html

  * igt@i915_suspend@sysfs-reader:
    - shard-apl:          [DMESG-WARN][25] ([fdo#108566]) -> [PASS][26] +6 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-apl8/igt@i915_suspend@sysfs-reader.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-apl3/igt@i915_suspend@sysfs-reader.html

  * igt@kms_cursor_crc@pipe-c-cursor-128x42-sliding:
    - shard-apl:          [FAIL][27] ([fdo#103232]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-apl1/igt@kms_cursor_crc@pipe-c-cursor-128x42-sliding.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-apl7/igt@kms_cursor_crc@pipe-c-cursor-128x42-sliding.html
    - shard-kbl:          [FAIL][29] ([fdo#103232]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-kbl1/igt@kms_cursor_crc@pipe-c-cursor-128x42-sliding.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-128x42-sliding.html

  * igt@kms_cursor_crc@pipe-c-cursor-256x85-offscreen:
    - shard-iclb:         [INCOMPLETE][31] ([fdo#107713]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb7/igt@kms_cursor_crc@pipe-c-cursor-256x85-offscreen.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb6/igt@kms_cursor_crc@pipe-c-cursor-256x85-offscreen.html

  * igt@kms_cursor_legacy@cursor-vs-flip-legacy:
    - shard-apl:          [INCOMPLETE][33] ([fdo#103927]) -> [PASS][34] +1 similar issue
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-apl3/igt@kms_cursor_legacy@cursor-vs-flip-legacy.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-apl2/igt@kms_cursor_legacy@cursor-vs-flip-legacy.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-snb:          [INCOMPLETE][35] ([fdo#105411]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-snb1/igt@kms_flip@flip-vs-suspend-interruptible.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-snb7/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-pwrite:
    - shard-iclb:         [FAIL][37] ([fdo#103167]) -> [PASS][38] +2 similar issues
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-pwrite.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb1/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-rte:
    - shard-iclb:         [FAIL][39] ([fdo#103167] / [fdo#110378]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-rte.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-rte.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
    - shard-kbl:          [INCOMPLETE][41] ([fdo#103665]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-kbl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-kbl3/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html

  
#### Warnings ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [FAIL][43] ([fdo#111329]) -> [SKIP][44] ([fdo#109276])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb4/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb3/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_mocs_settings@mocs-reset-bsd2:
    - shard-iclb:         [SKIP][45] ([fdo#109276]) -> [FAIL][46] ([fdo#111330]) +2 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-iclb5/igt@gem_mocs_settings@mocs-reset-bsd2.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-iclb2/igt@gem_mocs_settings@mocs-reset-bsd2.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-onoff:
    - shard-apl:          [SKIP][47] ([fdo#109271]) -> [INCOMPLETE][48] ([fdo#103927])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6854/shard-apl5/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-onoff.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/shard-apl7/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-onoff.html

  
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110378]: https://bugs.freedesktop.org/show_bug.cgi?id=110378
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
  [fdo#111329]: https://bugs.freedesktop.org/show_bug.cgi?id=111329
  [fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330


Participating hosts (10 -> 6)
------------------------------

  Missing    (4): pig-skl-6260u shard-skl pig-hsw-4770r pig-glk-j5005 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5176 -> IGTPW_3438
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_6854: 5a70800ed2837e2d35a331e2cfd43a55df58c4fc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3438: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3438/
  IGT_5176: 0102dcf4e2e8b357b59173fe1ff78069148080c6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
  2019-09-13  9:57   ` Petri Latvala
@ 2019-09-16 12:35     ` Kazlauskas, Nicholas
  0 siblings, 0 replies; 8+ messages in thread
From: Kazlauskas, Nicholas @ 2019-09-16 12:35 UTC (permalink / raw)
  To: Wang, Chao-kai (Stylon), igt-dev, Petri Latvala

On 2019-09-13 5:57 a.m., Petri Latvala wrote:
> On Wed, Sep 11, 2019 at 02:29:51PM +0000, Kazlauskas, Nicholas wrote:
>> On 2019-09-11 10:11 a.m., Wang, Chao-kai (Stylon) wrote:
>>> From: Stylon Wang <stylon.wang@amd.com>
>>>
>>> HDMI 2.0 compliance tests needs 4K modes with YUV encoding.
>>> This test selects 4K modes based on specified VIC.
>>
>> It helps to note what changed in a patch series in both the patch title
>> and in the commit message here.
>>
>> You can add a v2 to the patch header by appending a -v2 to your command, eg:
>>
>> "git send-email -v2 ..."
>>
>> And in the commit description you should do something like:
>>
>> v2:
>> - example change 1
>> - example change 2
>>
>> Other than that, I do have some general comments and nitpicks:
>>
>> I think this tool might be better off named as just amd_hdmi_compliance
>> so we can expand on this later.
> 
> Is there anything specific that makes this tool AMD-specific? It even
> uses DRIVER_ANY.
> 
> I guess the same question can be asked about intel_dp_compliance.c...
> 
> 
> 

Nothing yet that I can see in the patch itself.

I know that debugfs entries to help with automating this compliance were 
added to amdgpu (like the one that controls 420 vs 444 output), so I 
would imagine that they would be added after though.

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

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

* Re: [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
  2019-09-11 14:29 ` Kazlauskas, Nicholas
@ 2019-09-13  9:57   ` Petri Latvala
  2019-09-16 12:35     ` Kazlauskas, Nicholas
  0 siblings, 1 reply; 8+ messages in thread
From: Petri Latvala @ 2019-09-13  9:57 UTC (permalink / raw)
  To: Kazlauskas, Nicholas; +Cc: igt-dev

On Wed, Sep 11, 2019 at 02:29:51PM +0000, Kazlauskas, Nicholas wrote:
> On 2019-09-11 10:11 a.m., Wang, Chao-kai (Stylon) wrote:
> > From: Stylon Wang <stylon.wang@amd.com>
> > 
> > HDMI 2.0 compliance tests needs 4K modes with YUV encoding.
> > This test selects 4K modes based on specified VIC.
> 
> It helps to note what changed in a patch series in both the patch title 
> and in the commit message here.
> 
> You can add a v2 to the patch header by appending a -v2 to your command, eg:
> 
> "git send-email -v2 ..."
> 
> And in the commit description you should do something like:
> 
> v2:
> - example change 1
> - example change 2
> 
> Other than that, I do have some general comments and nitpicks:
> 
> I think this tool might be better off named as just amd_hdmi_compliance 
> so we can expand on this later.

Is there anything specific that makes this tool AMD-specific? It even
uses DRIVER_ANY.

I guess the same question can be asked about intel_dp_compliance.c...



-- 
Petri Latvala




> 
> Nicholas Kazlauskas
> 
> > 
> > Signed-off-by: Stylon Wang <stylon.wang@amd.com>
> > ---
> >   tools/Makefile.am                  |   3 +
> >   tools/Makefile.sources             |   4 +
> >   tools/amd_hdmi_compliance_yuv420.c | 193 +++++++++++++++++++++++++++++
> >   tools/meson.build                  |   5 +
> >   4 files changed, 205 insertions(+)
> >   create mode 100644 tools/amd_hdmi_compliance_yuv420.c
> > 
> > diff --git a/tools/Makefile.am b/tools/Makefile.am
> > index 4f54720f..1a23e078 100644
> > --- a/tools/Makefile.am
> > +++ b/tools/Makefile.am
> > @@ -11,6 +11,9 @@ bin_PROGRAMS += intel_dp_compliance
> >   intel_dp_compliance_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
> >   intel_dp_compliance_LDADD = $(top_builddir)/lib/libintel_tools.la
> >   
> > +bin_PROGRAMS += amd_hdmi_compliance_yuv420
> > +amd_hdmi_compliance_yuv420_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
> > +
> >   SUBDIRS = null_state_gen registers
> >   
> >   AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include/drm-uapi -I$(top_srcdir)/lib \
> > diff --git a/tools/Makefile.sources b/tools/Makefile.sources
> > index 50706f41..8196cb59 100644
> > --- a/tools/Makefile.sources
> > +++ b/tools/Makefile.sources
> > @@ -66,3 +66,7 @@ intel_dp_compliance_SOURCES = \
> >           intel_dp_compliance_hotplug.c \
> >           $(NULL)
> >   
> > +amd_hdmi_compliance_yuv420_SOURCES = \
> > +        amd_hdmi_compliance_yuv420.c \
> > +		$(NULL)
> > +
> > diff --git a/tools/amd_hdmi_compliance_yuv420.c b/tools/amd_hdmi_compliance_yuv420.c
> > new file mode 100644
> > index 00000000..5f5eae2c
> > --- /dev/null
> > +++ b/tools/amd_hdmi_compliance_yuv420.c
> > @@ -0,0 +1,193 @@
> > +/*
> > + * Copyright 2019 Advanced Micro Devices, Inc.
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the "Software"),
> > + * to deal in the Software without restriction, including without limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be included in
> > + * all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> > + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> > + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + * OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +#include "igt.h"
> > +
> > +/* Common test data */
> > +typedef struct data {
> > +	struct igt_fb pattern_fb_info;
> > +	int fd;
> > +	igt_display_t display;
> > +	igt_plane_t *primary;
> > +	igt_output_t *output;
> > +	igt_pipe_t *pipe;
> > +	enum pipe pipe_id;
> > +	bool use_virtual_connector;
> > +} data_t;
> > +
> > +// Video modes indexed by VIC
> 
> IGT uses kernel style formatting so this comment should be:
> 
> /* Video modes indexed by VIC */
> 
> > +static drmModeModeInfo test_modes[] = {
> > +	[1] = { 25175,
> > +			640, 656, 752, 800, 0,
> > +			480, 489, 492, 525, 0,
> > +			60, 0xa, 0x40,
> > +			"640x480",	/* VIC 1 */
> > +	},
> > +	[96] = { 594000,
> > +			 3840, 4896, 4984, 5280, 0,
> > +			 2160, 2168, 2178, 2250, 0,
> > +			50, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
> > +			"3840x2160",	/* VIC 96 */
> > +	},
> > +	[97] = { 594000,
> > +			3840, 4016, 4104, 4400, 0,
> > +			2160, 2168, 2178, 2250, 0,
> > +			60, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
> > +			"3840x2160",	/* VIC 97 */
> > +	},
> > +	[101] = { 594000,
> > +			  4096, 5064, 5152, 5280, 0,
> > +			  2160, 2168, 2178, 2250, 0,
> > +			  50, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
> > +			  "4096x2160",	/* VIC 101 */
> > +	},
> > +	[102] = { 594000,
> > +			  4096, 4184, 4272, 4400, 0,
> > +			  2160, 2168, 2178, 2250, 0,
> > +			  60, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
> > +			  "4096x2160",	/* VIC 102 */
> > +	},
> > +	[106] = { 594000,
> > +			 3840, 4896, 4984, 5280, 0,
> > +			 2160, 2168, 2178, 2250, 0,
> > +			50, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
> > +			"3840x2160",	/* VIC 106 */
> > +	},
> > +	[107] = { 594000,
> > +			3840, 4016, 4104, 4400, 0,
> > +			2160, 2168, 2178, 2250, 0,
> > +			60, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
> > +			"3840x2160",	/* VIC 107 */
> > +	},
> > +};
> > +
> > +/* Common test setup. */
> > +static void test_init(data_t *data)
> > +{
> > +	igt_display_t *display = &data->display;
> > +
> > +	data->pipe_id = PIPE_A;
> > +	data->pipe = &data->display.pipes[data->pipe_id];
> > +
> > +	igt_display_reset(display);
> > +
> > +	/* find a connected HDMI output */
> > +	data->output = NULL;
> > +	for (int i=0; i < data->display.n_outputs; ++i) {
> > +		drmModeConnector *connector = data->display.outputs[i].config.connector;
> > +		if (connector->connection == DRM_MODE_CONNECTED &&
> > +				(connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> > +				 (data->use_virtual_connector &&
> > +				  connector->connector_type == DRM_MODE_CONNECTOR_VIRTUAL))) {
> > +			data->output = &data->display.outputs[i];
> > +		}
> > +	}
> > +
> > +	igt_require(data->output);
> > +
> > +	data->primary =
> > +		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
> > +
> > +	igt_output_set_pipe(data->output, data->pipe_id);
> > +
> > +}
> > +
> > +/* Common test cleanup. */
> > +static void test_fini(data_t *data)
> > +{
> > +	igt_display_reset(&data->display);
> > +}
> > +
> > +static void test_vic_mode(data_t *data, int vic)
> > +{
> > +	igt_display_t *display = &data->display;
> > +	drmModeModeInfo *mode;
> > +	igt_fb_t afb;
> > +
> > +	test_init(data);
> > +
> > +	mode = &test_modes[vic];
> > +
> > +	igt_output_override_mode(data->output, mode);
> > +
> > +	igt_create_pattern_fb(data->fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, 0, &afb);
> > +
> > +	igt_plane_set_fb(data->primary, &afb);
> > +
> > +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +
> > +	fprintf(stderr, "Press [Enter] to finish\n");
> 
> I think igt_info(...) is preferred here over fprintf directly.
> 
> > +	getchar();
> I understand that you aren't using igt_debug_wait_for_keypress here, but 
> I think an improvement that could be made is to extract this out into a 
> sub function that waits explicitly for the newline:
> 
> static void wait_for_keypress(void)
> {
> 	while (getchar() != '\n')
> 		;
> }
> 
> > +
> > +	test_fini(data);
> > +}
> > +
> > +const char *optstr = "hvt:";
> > +static void usage(const char *name)
> > +{
> > +	fprintf(stderr, "Usage: %s [-ht]\n", name);
> > +	fprintf(stderr, "-h:	show help\n");
> > +	fprintf(stderr, "-t vic: select video mode based on VIC\n");
> > +	fprintf(stderr, "-v:	test on 'Virtual' connector as well, for debugging.\n");
> 
> igt_info(...) if possible here
> 
> > +}
> > +
> > +int main(int argc, char **argv)
> > +{
> > +	data_t data;
> > +	int c;
> > +	int vic = 1; /* default to VIC 1 (640x480) */
> > +
> > +	memset(&data, 0, sizeof(data));
> > +
> > +	while((c = getopt(argc, argv, optstr)) != -1) {
> > +		switch(c) {
> > +		case 't':
> > +			vic = atoi(optarg);
> > +			break;
> > +		case 'v':
> > +			data.use_virtual_connector = true;
> > +			break;
> > +		default:
> > +		case 'h':
> > +			usage(argv[0]);
> > +			exit(1);
> > +		}
> > +	}
> > +
> > +	if (vic < 1 ||
> > +		vic > ARRAY_SIZE(test_modes) ||
> > +		!test_modes[vic].name[0]) {
> > +		fprintf(stderr, "VIC %d is not supported\n", vic);
> 
> igt_info(...) if possible here
> 
> > +		exit(1);
> > +	}
> > +
> > +	data.fd = drm_open_driver_master(DRIVER_ANY);
> > +	kmstest_set_vt_graphics_mode();
> > +
> > +	igt_display_require(&data.display, data.fd);
> > +	igt_require(data.display.is_atomic);
> > +	igt_display_require_output(&data.display);
> > +
> > +	test_vic_mode(&data, vic);
> > +
> > +	igt_display_fini(&data.display);
> > +}
> > diff --git a/tools/meson.build b/tools/meson.build
> > index 6e72b263..fa366ab2 100644
> > --- a/tools/meson.build
> > +++ b/tools/meson.build
> > @@ -100,6 +100,11 @@ executable('intel_gpu_top', 'intel_gpu_top.c',
> >   	   install_rpath : bindir_rpathdir,
> >   	   dependencies : lib_igt_perf)
> >   
> > +executable('amd_hdmi_compliance_yuv420', 'amd_hdmi_compliance_yuv420.c',
> > +	   dependencies : [tool_deps],
> > +	   install_rpath : bindir_rpathdir,
> > +	   install : true)
> > +
> >   conf_data = configuration_data()
> >   conf_data.set('prefix', prefix)
> >   conf_data.set('exec_prefix', '${prefix}')
> > 
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
  2019-09-11 14:11 [igt-dev] [PATCH i-g-t] " Wang, Chao-kai (Stylon)
@ 2019-09-11 14:29 ` Kazlauskas, Nicholas
  2019-09-13  9:57   ` Petri Latvala
  0 siblings, 1 reply; 8+ messages in thread
From: Kazlauskas, Nicholas @ 2019-09-11 14:29 UTC (permalink / raw)
  To: Wang, Chao-kai (Stylon), igt-dev

On 2019-09-11 10:11 a.m., Wang, Chao-kai (Stylon) wrote:
> From: Stylon Wang <stylon.wang@amd.com>
> 
> HDMI 2.0 compliance tests needs 4K modes with YUV encoding.
> This test selects 4K modes based on specified VIC.

It helps to note what changed in a patch series in both the patch title 
and in the commit message here.

You can add a v2 to the patch header by appending a -v2 to your command, eg:

"git send-email -v2 ..."

And in the commit description you should do something like:

v2:
- example change 1
- example change 2

Other than that, I do have some general comments and nitpicks:

I think this tool might be better off named as just amd_hdmi_compliance 
so we can expand on this later.

Nicholas Kazlauskas

> 
> Signed-off-by: Stylon Wang <stylon.wang@amd.com>
> ---
>   tools/Makefile.am                  |   3 +
>   tools/Makefile.sources             |   4 +
>   tools/amd_hdmi_compliance_yuv420.c | 193 +++++++++++++++++++++++++++++
>   tools/meson.build                  |   5 +
>   4 files changed, 205 insertions(+)
>   create mode 100644 tools/amd_hdmi_compliance_yuv420.c
> 
> diff --git a/tools/Makefile.am b/tools/Makefile.am
> index 4f54720f..1a23e078 100644
> --- a/tools/Makefile.am
> +++ b/tools/Makefile.am
> @@ -11,6 +11,9 @@ bin_PROGRAMS += intel_dp_compliance
>   intel_dp_compliance_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
>   intel_dp_compliance_LDADD = $(top_builddir)/lib/libintel_tools.la
>   
> +bin_PROGRAMS += amd_hdmi_compliance_yuv420
> +amd_hdmi_compliance_yuv420_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
> +
>   SUBDIRS = null_state_gen registers
>   
>   AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include/drm-uapi -I$(top_srcdir)/lib \
> diff --git a/tools/Makefile.sources b/tools/Makefile.sources
> index 50706f41..8196cb59 100644
> --- a/tools/Makefile.sources
> +++ b/tools/Makefile.sources
> @@ -66,3 +66,7 @@ intel_dp_compliance_SOURCES = \
>           intel_dp_compliance_hotplug.c \
>           $(NULL)
>   
> +amd_hdmi_compliance_yuv420_SOURCES = \
> +        amd_hdmi_compliance_yuv420.c \
> +		$(NULL)
> +
> diff --git a/tools/amd_hdmi_compliance_yuv420.c b/tools/amd_hdmi_compliance_yuv420.c
> new file mode 100644
> index 00000000..5f5eae2c
> --- /dev/null
> +++ b/tools/amd_hdmi_compliance_yuv420.c
> @@ -0,0 +1,193 @@
> +/*
> + * Copyright 2019 Advanced Micro Devices, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +#include "igt.h"
> +
> +/* Common test data */
> +typedef struct data {
> +	struct igt_fb pattern_fb_info;
> +	int fd;
> +	igt_display_t display;
> +	igt_plane_t *primary;
> +	igt_output_t *output;
> +	igt_pipe_t *pipe;
> +	enum pipe pipe_id;
> +	bool use_virtual_connector;
> +} data_t;
> +
> +// Video modes indexed by VIC

IGT uses kernel style formatting so this comment should be:

/* Video modes indexed by VIC */

> +static drmModeModeInfo test_modes[] = {
> +	[1] = { 25175,
> +			640, 656, 752, 800, 0,
> +			480, 489, 492, 525, 0,
> +			60, 0xa, 0x40,
> +			"640x480",	/* VIC 1 */
> +	},
> +	[96] = { 594000,
> +			 3840, 4896, 4984, 5280, 0,
> +			 2160, 2168, 2178, 2250, 0,
> +			50, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
> +			"3840x2160",	/* VIC 96 */
> +	},
> +	[97] = { 594000,
> +			3840, 4016, 4104, 4400, 0,
> +			2160, 2168, 2178, 2250, 0,
> +			60, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
> +			"3840x2160",	/* VIC 97 */
> +	},
> +	[101] = { 594000,
> +			  4096, 5064, 5152, 5280, 0,
> +			  2160, 2168, 2178, 2250, 0,
> +			  50, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
> +			  "4096x2160",	/* VIC 101 */
> +	},
> +	[102] = { 594000,
> +			  4096, 4184, 4272, 4400, 0,
> +			  2160, 2168, 2178, 2250, 0,
> +			  60, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
> +			  "4096x2160",	/* VIC 102 */
> +	},
> +	[106] = { 594000,
> +			 3840, 4896, 4984, 5280, 0,
> +			 2160, 2168, 2178, 2250, 0,
> +			50, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
> +			"3840x2160",	/* VIC 106 */
> +	},
> +	[107] = { 594000,
> +			3840, 4016, 4104, 4400, 0,
> +			2160, 2168, 2178, 2250, 0,
> +			60, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
> +			"3840x2160",	/* VIC 107 */
> +	},
> +};
> +
> +/* Common test setup. */
> +static void test_init(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +
> +	data->pipe_id = PIPE_A;
> +	data->pipe = &data->display.pipes[data->pipe_id];
> +
> +	igt_display_reset(display);
> +
> +	/* find a connected HDMI output */
> +	data->output = NULL;
> +	for (int i=0; i < data->display.n_outputs; ++i) {
> +		drmModeConnector *connector = data->display.outputs[i].config.connector;
> +		if (connector->connection == DRM_MODE_CONNECTED &&
> +				(connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> +				 (data->use_virtual_connector &&
> +				  connector->connector_type == DRM_MODE_CONNECTOR_VIRTUAL))) {
> +			data->output = &data->display.outputs[i];
> +		}
> +	}
> +
> +	igt_require(data->output);
> +
> +	data->primary =
> +		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
> +
> +	igt_output_set_pipe(data->output, data->pipe_id);
> +
> +}
> +
> +/* Common test cleanup. */
> +static void test_fini(data_t *data)
> +{
> +	igt_display_reset(&data->display);
> +}
> +
> +static void test_vic_mode(data_t *data, int vic)
> +{
> +	igt_display_t *display = &data->display;
> +	drmModeModeInfo *mode;
> +	igt_fb_t afb;
> +
> +	test_init(data);
> +
> +	mode = &test_modes[vic];
> +
> +	igt_output_override_mode(data->output, mode);
> +
> +	igt_create_pattern_fb(data->fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, 0, &afb);
> +
> +	igt_plane_set_fb(data->primary, &afb);
> +
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	fprintf(stderr, "Press [Enter] to finish\n");

I think igt_info(...) is preferred here over fprintf directly.

> +	getchar();
I understand that you aren't using igt_debug_wait_for_keypress here, but 
I think an improvement that could be made is to extract this out into a 
sub function that waits explicitly for the newline:

static void wait_for_keypress(void)
{
	while (getchar() != '\n')
		;
}

> +
> +	test_fini(data);
> +}
> +
> +const char *optstr = "hvt:";
> +static void usage(const char *name)
> +{
> +	fprintf(stderr, "Usage: %s [-ht]\n", name);
> +	fprintf(stderr, "-h:	show help\n");
> +	fprintf(stderr, "-t vic: select video mode based on VIC\n");
> +	fprintf(stderr, "-v:	test on 'Virtual' connector as well, for debugging.\n");

igt_info(...) if possible here

> +}
> +
> +int main(int argc, char **argv)
> +{
> +	data_t data;
> +	int c;
> +	int vic = 1; /* default to VIC 1 (640x480) */
> +
> +	memset(&data, 0, sizeof(data));
> +
> +	while((c = getopt(argc, argv, optstr)) != -1) {
> +		switch(c) {
> +		case 't':
> +			vic = atoi(optarg);
> +			break;
> +		case 'v':
> +			data.use_virtual_connector = true;
> +			break;
> +		default:
> +		case 'h':
> +			usage(argv[0]);
> +			exit(1);
> +		}
> +	}
> +
> +	if (vic < 1 ||
> +		vic > ARRAY_SIZE(test_modes) ||
> +		!test_modes[vic].name[0]) {
> +		fprintf(stderr, "VIC %d is not supported\n", vic);

igt_info(...) if possible here

> +		exit(1);
> +	}
> +
> +	data.fd = drm_open_driver_master(DRIVER_ANY);
> +	kmstest_set_vt_graphics_mode();
> +
> +	igt_display_require(&data.display, data.fd);
> +	igt_require(data.display.is_atomic);
> +	igt_display_require_output(&data.display);
> +
> +	test_vic_mode(&data, vic);
> +
> +	igt_display_fini(&data.display);
> +}
> diff --git a/tools/meson.build b/tools/meson.build
> index 6e72b263..fa366ab2 100644
> --- a/tools/meson.build
> +++ b/tools/meson.build
> @@ -100,6 +100,11 @@ executable('intel_gpu_top', 'intel_gpu_top.c',
>   	   install_rpath : bindir_rpathdir,
>   	   dependencies : lib_igt_perf)
>   
> +executable('amd_hdmi_compliance_yuv420', 'amd_hdmi_compliance_yuv420.c',
> +	   dependencies : [tool_deps],
> +	   install_rpath : bindir_rpathdir,
> +	   install : true)
> +
>   conf_data = configuration_data()
>   conf_data.set('prefix', prefix)
>   conf_data.set('exec_prefix', '${prefix}')
> 

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

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

* [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding
@ 2019-09-11 14:11 Wang, Chao-kai (Stylon)
  2019-09-11 14:29 ` Kazlauskas, Nicholas
  0 siblings, 1 reply; 8+ messages in thread
From: Wang, Chao-kai (Stylon) @ 2019-09-11 14:11 UTC (permalink / raw)
  To: igt-dev

From: Stylon Wang <stylon.wang@amd.com>

HDMI 2.0 compliance tests needs 4K modes with YUV encoding.
This test selects 4K modes based on specified VIC.

Signed-off-by: Stylon Wang <stylon.wang@amd.com>
---
 tools/Makefile.am                  |   3 +
 tools/Makefile.sources             |   4 +
 tools/amd_hdmi_compliance_yuv420.c | 193 +++++++++++++++++++++++++++++
 tools/meson.build                  |   5 +
 4 files changed, 205 insertions(+)
 create mode 100644 tools/amd_hdmi_compliance_yuv420.c

diff --git a/tools/Makefile.am b/tools/Makefile.am
index 4f54720f..1a23e078 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -11,6 +11,9 @@ bin_PROGRAMS += intel_dp_compliance
 intel_dp_compliance_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
 intel_dp_compliance_LDADD = $(top_builddir)/lib/libintel_tools.la
 
+bin_PROGRAMS += amd_hdmi_compliance_yuv420
+amd_hdmi_compliance_yuv420_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
+
 SUBDIRS = null_state_gen registers
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include/drm-uapi -I$(top_srcdir)/lib \
diff --git a/tools/Makefile.sources b/tools/Makefile.sources
index 50706f41..8196cb59 100644
--- a/tools/Makefile.sources
+++ b/tools/Makefile.sources
@@ -66,3 +66,7 @@ intel_dp_compliance_SOURCES = \
         intel_dp_compliance_hotplug.c \
         $(NULL)
 
+amd_hdmi_compliance_yuv420_SOURCES = \
+        amd_hdmi_compliance_yuv420.c \
+		$(NULL)
+
diff --git a/tools/amd_hdmi_compliance_yuv420.c b/tools/amd_hdmi_compliance_yuv420.c
new file mode 100644
index 00000000..5f5eae2c
--- /dev/null
+++ b/tools/amd_hdmi_compliance_yuv420.c
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2019 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "igt.h"
+
+/* Common test data */
+typedef struct data {
+	struct igt_fb pattern_fb_info;
+	int fd;
+	igt_display_t display;
+	igt_plane_t *primary;
+	igt_output_t *output;
+	igt_pipe_t *pipe;
+	enum pipe pipe_id;
+	bool use_virtual_connector;
+} data_t;
+
+// Video modes indexed by VIC
+static drmModeModeInfo test_modes[] = {
+	[1] = { 25175,
+			640, 656, 752, 800, 0,
+			480, 489, 492, 525, 0,
+			60, 0xa, 0x40,
+			"640x480",	/* VIC 1 */
+	},
+	[96] = { 594000,
+			 3840, 4896, 4984, 5280, 0,
+			 2160, 2168, 2178, 2250, 0,
+			50, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
+			"3840x2160",	/* VIC 96 */
+	},
+	[97] = { 594000,
+			3840, 4016, 4104, 4400, 0,
+			2160, 2168, 2178, 2250, 0,
+			60, 0x5|DRM_MODE_FLAG_PIC_AR_16_9, 0x40,
+			"3840x2160",	/* VIC 97 */
+	},
+	[101] = { 594000,
+			  4096, 5064, 5152, 5280, 0,
+			  2160, 2168, 2178, 2250, 0,
+			  50, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
+			  "4096x2160",	/* VIC 101 */
+	},
+	[102] = { 594000,
+			  4096, 4184, 4272, 4400, 0,
+			  2160, 2168, 2178, 2250, 0,
+			  60, 0x5|DRM_MODE_FLAG_PIC_AR_256_135, 0x40,
+			  "4096x2160",	/* VIC 102 */
+	},
+	[106] = { 594000,
+			 3840, 4896, 4984, 5280, 0,
+			 2160, 2168, 2178, 2250, 0,
+			50, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
+			"3840x2160",	/* VIC 106 */
+	},
+	[107] = { 594000,
+			3840, 4016, 4104, 4400, 0,
+			2160, 2168, 2178, 2250, 0,
+			60, 0x5|DRM_MODE_FLAG_PIC_AR_64_27, 0x40,
+			"3840x2160",	/* VIC 107 */
+	},
+};
+
+/* Common test setup. */
+static void test_init(data_t *data)
+{
+	igt_display_t *display = &data->display;
+
+	data->pipe_id = PIPE_A;
+	data->pipe = &data->display.pipes[data->pipe_id];
+
+	igt_display_reset(display);
+
+	/* find a connected HDMI output */
+	data->output = NULL;
+	for (int i=0; i < data->display.n_outputs; ++i) {
+		drmModeConnector *connector = data->display.outputs[i].config.connector;
+		if (connector->connection == DRM_MODE_CONNECTED &&
+				(connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+				 (data->use_virtual_connector &&
+				  connector->connector_type == DRM_MODE_CONNECTOR_VIRTUAL))) {
+			data->output = &data->display.outputs[i];
+		}
+	}
+
+	igt_require(data->output);
+
+	data->primary =
+		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
+
+	igt_output_set_pipe(data->output, data->pipe_id);
+
+}
+
+/* Common test cleanup. */
+static void test_fini(data_t *data)
+{
+	igt_display_reset(&data->display);
+}
+
+static void test_vic_mode(data_t *data, int vic)
+{
+	igt_display_t *display = &data->display;
+	drmModeModeInfo *mode;
+	igt_fb_t afb;
+
+	test_init(data);
+
+	mode = &test_modes[vic];
+
+	igt_output_override_mode(data->output, mode);
+
+	igt_create_pattern_fb(data->fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, 0, &afb);
+
+	igt_plane_set_fb(data->primary, &afb);
+
+	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+	fprintf(stderr, "Press [Enter] to finish\n");
+	getchar();
+
+	test_fini(data);
+}
+
+const char *optstr = "hvt:";
+static void usage(const char *name)
+{
+	fprintf(stderr, "Usage: %s [-ht]\n", name);
+	fprintf(stderr, "-h:	show help\n");
+	fprintf(stderr, "-t vic: select video mode based on VIC\n");
+	fprintf(stderr, "-v:	test on 'Virtual' connector as well, for debugging.\n");
+}
+
+int main(int argc, char **argv)
+{
+	data_t data;
+	int c;
+	int vic = 1; /* default to VIC 1 (640x480) */
+
+	memset(&data, 0, sizeof(data));
+
+	while((c = getopt(argc, argv, optstr)) != -1) {
+		switch(c) {
+		case 't':
+			vic = atoi(optarg);
+			break;
+		case 'v':
+			data.use_virtual_connector = true;
+			break;
+		default:
+		case 'h':
+			usage(argv[0]);
+			exit(1);
+		}
+	}
+
+	if (vic < 1 ||
+		vic > ARRAY_SIZE(test_modes) ||
+		!test_modes[vic].name[0]) {
+		fprintf(stderr, "VIC %d is not supported\n", vic);
+		exit(1);
+	}
+
+	data.fd = drm_open_driver_master(DRIVER_ANY);
+	kmstest_set_vt_graphics_mode();
+
+	igt_display_require(&data.display, data.fd);
+	igt_require(data.display.is_atomic);
+	igt_display_require_output(&data.display);
+
+	test_vic_mode(&data, vic);
+
+	igt_display_fini(&data.display);
+}
diff --git a/tools/meson.build b/tools/meson.build
index 6e72b263..fa366ab2 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -100,6 +100,11 @@ executable('intel_gpu_top', 'intel_gpu_top.c',
 	   install_rpath : bindir_rpathdir,
 	   dependencies : lib_igt_perf)
 
+executable('amd_hdmi_compliance_yuv420', 'amd_hdmi_compliance_yuv420.c',
+	   dependencies : [tool_deps],
+	   install_rpath : bindir_rpathdir,
+	   install : true)
+
 conf_data = configuration_data()
 conf_data.set('prefix', prefix)
 conf_data.set('exec_prefix', '${prefix}')
-- 
2.17.1

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

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

end of thread, other threads:[~2019-09-16 12:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09 18:29 [igt-dev] [PATCH i-g-t] tools/amd_hdmi_compliance_yuv420: Test 4K video modes with YUV encoding Wang, Chao-kai (Stylon)
2019-09-09 19:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-09-09 20:40 ` [igt-dev] [PATCH i-g-t] " Harry Wentland
2019-09-10  3:36 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2019-09-11 14:11 [igt-dev] [PATCH i-g-t] " Wang, Chao-kai (Stylon)
2019-09-11 14:29 ` Kazlauskas, Nicholas
2019-09-13  9:57   ` Petri Latvala
2019-09-16 12:35     ` Kazlauskas, Nicholas

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.