* [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport
@ 2023-11-03 18:22 Aurabindo Pillai
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/amdgpu: Remove unused struct Aurabindo Pillai
` (6 more replies)
0 siblings, 7 replies; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-03 18:22 UTC (permalink / raw)
To: igt-dev; +Cc: hersenxs.wu
Changes in v2
=================
* Removed an unused struct definition
* Fixes style issues reported by checkpatch.pl
* Added SPDX license identifier to the new test
* Fixed #include order for system includes
---
Aurabindo Pillai (5):
lib/amdgpu: Remove unused struct
llib/amd: Update function documentation
lib/amd: improve readablity for MALL capability check
lib/amd: Add check for SubVP feature status
test/amdgpu: Add test for Sub-viewport
lib/igt_amd.c | 44 ++++++++--
lib/igt_amd.h | 1 +
tests/amdgpu/amd_subvp.c | 180 +++++++++++++++++++++++++++++++++++++++
tests/amdgpu/meson.build | 1 +
4 files changed, 217 insertions(+), 9 deletions(-)
create mode 100644 tests/amdgpu/amd_subvp.c
--
2.39.2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v2 1/5] lib/amdgpu: Remove unused struct
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
@ 2023-11-03 18:22 ` Aurabindo Pillai
2023-11-08 6:38 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 2/5] llib/amd: Update function documentation Aurabindo Pillai
` (5 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-03 18:22 UTC (permalink / raw)
To: igt-dev; +Cc: hersenxs.wu
dim2d has no references within AMDGPU tests, so remove it
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
---
lib/igt_amd.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index 84c6d7545..f0fbe97ef 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -45,11 +45,6 @@
#define Y6 64
#define Y7 128
-struct dim2d
-{
- int w;
- int h;
-};
uint32_t igt_amd_create_bo(int fd, uint64_t size)
{
--
2.39.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v2 2/5] llib/amd: Update function documentation
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/amdgpu: Remove unused struct Aurabindo Pillai
@ 2023-11-03 18:22 ` Aurabindo Pillai
2023-11-08 6:38 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/amd: improve readablity for MALL capability check Aurabindo Pillai
` (4 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-03 18:22 UTC (permalink / raw)
To: igt-dev; +Cc: hersenxs.wu
The existing documetation incorrectly specifies the return value.
Update the doc entry for functions that check MALL status
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
---
lib/igt_amd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index f0fbe97ef..8c736b3e2 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -1178,8 +1178,8 @@ static bool get_dm_capabilities(int drm_fd, char *buf, size_t size)
* @brief check if AMDGPU mall_capable interface entry exist and defined
*
* @param drm_fd DRM file descriptor
- * @return true if dm capabilities interface exists and MALL is supported
- * @return false if capabilities could not be read.
+ * @param supported will be set to true if hardware supports MALL
+ * @param enabled will be set to true if MALL is currently in use
*/
void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled)
{
--
2.39.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v2 3/5] lib/amd: improve readablity for MALL capability check
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/amdgpu: Remove unused struct Aurabindo Pillai
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 2/5] llib/amd: Update function documentation Aurabindo Pillai
@ 2023-11-03 18:22 ` Aurabindo Pillai
2023-11-08 6:39 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 4/5] lib/amd: Add check for SubVP feature status Aurabindo Pillai
` (3 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-03 18:22 UTC (permalink / raw)
To: igt-dev; +Cc: hersenxs.wu
Move the hard coded string out of the function and define
an identifier for checking MALL supported/enabled status
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
---
lib/igt_amd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index 8c736b3e2..177a1094d 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -45,6 +45,8 @@
#define Y6 64
#define Y7 128
+#define mall_supported "mall supported: yes"
+#define mall_enabled "mall supported: yes, enabled: yes"
uint32_t igt_amd_create_bo(int fd, uint64_t size)
{
@@ -1192,11 +1194,11 @@ void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled)
if (!get_dm_capabilities(drm_fd, buf, 1024))
return;
- mall_loc = strstr(buf, "mall supported: yes");
+ mall_loc = strstr(buf, mall_supported);
if (mall_loc)
*supported = true;
- mall_loc = strstr(buf, "enabled: yes");
+ mall_loc = strstr(buf, mall_enabled);
if (mall_loc && *supported)
*enabled = true;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v2 4/5] lib/amd: Add check for SubVP feature status
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
` (2 preceding siblings ...)
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/amd: improve readablity for MALL capability check Aurabindo Pillai
@ 2023-11-03 18:22 ` Aurabindo Pillai
2023-11-08 6:40 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport Aurabindo Pillai
` (2 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-03 18:22 UTC (permalink / raw)
To: igt-dev; +Cc: hersenxs.wu
Add an API to check whether Subviewport feature is supported and enabled
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
---
lib/igt_amd.c | 29 +++++++++++++++++++++++++++++
lib/igt_amd.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index 177a1094d..247a42f37 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -45,6 +45,8 @@
#define Y6 64
#define Y7 128
+#define subvp_supported "sub-viewport supported: yes"
+#define subvp_enabled "sub-viewport supported: yes, enabled: yes"
#define mall_supported "mall supported: yes"
#define mall_enabled "mall supported: yes, enabled: yes"
@@ -1203,6 +1205,33 @@ void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled)
*enabled = true;
}
+/**
+ * @brief check if AMDGPU sub-viewport support exists
+ *
+ * @param drm_fd DRM file descriptor
+ * @param supported set to true if harwdare supports subviewport
+ * @param enabled set tot true if subviewport is currently in use
+ */
+void igt_amd_get_subvp_status(int drm_fd, bool *supported, bool *enabled)
+{
+ char buf[1024];
+ char *subvp_loc;
+
+ *supported = false;
+ *enabled = false;
+
+ if (!get_dm_capabilities(drm_fd, buf, 1024))
+ return;
+
+ subvp_loc = strstr(buf, subvp_supported);
+ if (subvp_loc)
+ *supported = true;
+
+ subvp_loc = strstr(buf, subvp_enabled);
+ if (subvp_loc && *supported)
+ *enabled = true;
+}
+
/**
* @brief check if AMDGPU DM visual confirm debugfs interface entry exist and defined
*
diff --git a/lib/igt_amd.h b/lib/igt_amd.h
index de992ac4f..1e66348ad 100644
--- a/lib/igt_amd.h
+++ b/lib/igt_amd.h
@@ -200,5 +200,6 @@ int igt_amd_get_visual_confirm(int drm_fd);
bool igt_amd_set_visual_confirm(int drm_fd, enum amdgpu_debug_visual_confirm option);
void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled);
+void igt_amd_get_subvp_status(int drm_fd, bool *supported, bool *enabled);
bool igt_amd_output_has_odm_combine_segments(int drm_fd, char *connector_name);
#endif /* IGT_AMD_H */
--
2.39.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
` (3 preceding siblings ...)
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 4/5] lib/amd: Add check for SubVP feature status Aurabindo Pillai
@ 2023-11-03 18:22 ` Aurabindo Pillai
2023-11-03 18:25 ` Aurabindo Pillai
2023-11-08 6:41 ` Alex Hung
2023-11-03 19:31 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add a new " Patchwork
2023-11-06 20:00 ` [igt-dev] [PATCH i-g-t v2 0/5] " Aurabindo Pillai
6 siblings, 2 replies; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-03 18:22 UTC (permalink / raw)
To: igt-dev; +Cc: hersenxs.wu
Sub-viewport is a power saving feature found on DCN32/DCN321
and newer dGPUs.
Add a test that commit a high resolution test pattern on multiple
displays and checks whether Sub-viewport feature is engaged.
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
---
tests/amdgpu/amd_subvp.c | 180 +++++++++++++++++++++++++++++++++++++++
tests/amdgpu/meson.build | 1 +
2 files changed, 181 insertions(+)
create mode 100644 tests/amdgpu/amd_subvp.c
diff --git a/tests/amdgpu/amd_subvp.c b/tests/amdgpu/amd_subvp.c
new file mode 100644
index 000000000..aa959441b
--- /dev/null
+++ b/tests/amdgpu/amd_subvp.c
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright 2023 Advanced Micro Devices, Inc.
+ */
+
+#include <fcntl.h>
+
+#include "igt.h"
+#include "igt_amd.h"
+#include "igt_core.h"
+
+IGT_TEST_DESCRIPTION("Test enabling sub-viewport feature");
+
+/* Common test data. */
+struct data {
+ igt_display_t display;
+ igt_plane_t *primary[IGT_MAX_PIPES];
+ igt_output_t *output[IGT_MAX_PIPES];
+ igt_pipe_t *pipe[IGT_MAX_PIPES];
+ igt_pipe_crc_t *pipe_crc[IGT_MAX_PIPES];
+ drmModeModeInfo mode[IGT_MAX_PIPES];
+ enum pipe pipe_id[IGT_MAX_PIPES];
+ int fd;
+};
+
+struct line_check {
+ int found;
+ const char *substr;
+};
+
+static const drmModeModeInfo test_mode[] = {
+ { 533250,
+ 3840, 3888, 3920, 4000, 0,
+ 2160, 2214, 2219, 2222, 0,
+ 60,
+ DRM_MODE_FLAG_NHSYNC,
+ 0x48,
+ "4k60\0",
+ }, /* from LG Ultra HD, product_id = 5B09, serial_number = 1010101 */
+};
+
+/* Forces a mode for a connector. */
+static void force_output_mode(struct data *d, igt_output_t *output,
+ const drmModeModeInfo *mode)
+{
+ /* This allows us to create a virtual sink. */
+ if (!igt_output_is_connected(output)) {
+ kmstest_force_edid(d->fd, output->config.connector,
+ igt_kms_get_4k_edid());
+
+ kmstest_force_connector(d->fd, output->config.connector,
+ FORCE_CONNECTOR_DIGITAL);
+ }
+
+ igt_output_override_mode(output, mode);
+}
+
+/* Common test setup. */
+static void test_init(struct data *data)
+{
+ igt_display_t *display = &data->display;
+ int i, n;
+ bool subvp_capable = false;
+ bool subvp_en = false;
+
+ for_each_pipe(display, i) {
+ data->pipe_id[i] = PIPE_A + i;
+ data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
+ data->primary[i] = igt_pipe_get_plane_type(data->pipe[i],
+ DRM_PLANE_TYPE_PRIMARY);
+ data->pipe_crc[i] = igt_pipe_crc_new(data->fd,
+ data->pipe_id[i],
+ IGT_PIPE_CRC_SOURCE_AUTO);
+ }
+
+ for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
+ igt_output_t *output = &display->outputs[i];
+
+ data->output[n] = output;
+ /* Only allow physically connected displays for the tests. */
+ if (!igt_output_is_connected(output))
+ continue;
+ /* SubVP is only enabled on DP */
+ if (output->config.connector->connector_type !=
+ DRM_MODE_CONNECTOR_DisplayPort)
+ continue;
+
+ igt_assert(kmstest_get_connector_default_mode(
+ data->fd, output->config.connector, &data->mode[n]));
+
+ force_output_mode(data, data->output[n], &test_mode[0]);
+
+ n += 1;
+ }
+
+ igt_require_f(n >= 2, "Requires at least two connected display\n");
+
+ igt_amd_get_subvp_status(data->fd, &subvp_capable, &subvp_en);
+ igt_require_f(subvp_capable, "Requires hardware that supports Sub-viewport\n");
+
+ igt_display_reset(display);
+}
+
+/* Common test cleanup. */
+static void test_fini(struct data *data)
+{
+ igt_display_t *display = &data->display;
+ int i;
+
+ for_each_pipe(display, i) {
+ igt_pipe_crc_free(data->pipe_crc[i]);
+ }
+
+ igt_display_reset(display);
+ igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+}
+
+static void test_subvp(struct data *data)
+{
+ igt_display_t *display = &data->display;
+ igt_fb_t rfb;
+ bool subvp_supp, subvp_en;
+ igt_output_t *output;
+ int i;
+
+ test_init(data);
+ igt_enable_connectors(data->fd);
+
+ for_each_pipe(&data->display, i) {
+ /* Setup the output */
+ output = data->output[i];
+ if (!output || !igt_output_is_connected(output))
+ continue;
+
+ igt_create_pattern_fb(data->fd,
+ test_mode[0].hdisplay,
+ test_mode[0].vdisplay,
+ DRM_FORMAT_XRGB8888,
+ 0,
+ &rfb);
+
+ igt_output_set_pipe(output, data->pipe_id[i]);
+ igt_plane_set_fb(data->primary[i], &rfb);
+ igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+ }
+
+
+ igt_amd_get_subvp_status(data->fd, &subvp_supp, &subvp_en);
+ igt_fail_on_f(!(subvp_supp && subvp_en), "SUBVP did not get enabled\n");
+
+ igt_remove_fb(data->fd, &rfb);
+ test_fini(data);
+}
+
+igt_main
+{
+ struct data data;
+
+ igt_skip_on_simulation();
+
+ memset(&data, 0, sizeof(data));
+
+ igt_fixture
+ {
+ data.fd = drm_open_driver_master(DRIVER_AMDGPU);
+ igt_display_require(&data.display, data.fd);
+ igt_display_require_output(&data.display);
+ igt_require(data.display.is_atomic);
+
+ kmstest_set_vt_graphics_mode();
+ }
+
+ igt_describe("Tests whether system enables sub-viewport when a specific mode is committed");
+ igt_subtest("dual-4k60") test_subvp(&data);
+
+ igt_fixture
+ {
+ igt_display_fini(&data.display);
+ }
+}
diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build
index f52fc3645..efd911fab 100644
--- a/tests/amdgpu/meson.build
+++ b/tests/amdgpu/meson.build
@@ -36,6 +36,7 @@ if libdrm_amdgpu.found()
'amd_vrr_range',
'amd_mall',
'amd_odm',
+ 'amd_subvp',
]
if libdrm_amdgpu.version().version_compare('> 2.4.97')
amdgpu_progs +=[ 'amd_syncobj', ]
--
2.39.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport Aurabindo Pillai
@ 2023-11-03 18:25 ` Aurabindo Pillai
2023-11-08 6:41 ` Alex Hung
1 sibling, 0 replies; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-03 18:25 UTC (permalink / raw)
To: igt-dev; +Cc: hersenxs.wu
On 2023-11-03 14:22, Aurabindo Pillai wrote:
> Sub-viewport is a power saving feature found on DCN32/DCN321
> and newer dGPUs.
>
> Add a test that commit a high resolution test pattern on multiple
> displays and checks whether Sub-viewport feature is engaged.
>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
> ---
> tests/amdgpu/amd_subvp.c | 180 +++++++++++++++++++++++++++++++++++++++
> tests/amdgpu/meson.build | 1 +
> 2 files changed, 181 insertions(+)
> create mode 100644 tests/amdgpu/amd_subvp.c
>
> diff --git a/tests/amdgpu/amd_subvp.c b/tests/amdgpu/amd_subvp.c
> new file mode 100644
> index 000000000..aa959441b
> --- /dev/null
> +++ b/tests/amdgpu/amd_subvp.c
> @@ -0,0 +1,180 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright 2023 Advanced Micro Devices, Inc.
> + */
> +
> +#include <fcntl.h>
> +
> +#include "igt.h"
> +#include "igt_amd.h"
> +#include "igt_core.h"
> +
> +IGT_TEST_DESCRIPTION("Test enabling sub-viewport feature");
> +
> +/* Common test data. */
> +struct data {
> + igt_display_t display;
> + igt_plane_t *primary[IGT_MAX_PIPES];
> + igt_output_t *output[IGT_MAX_PIPES];
> + igt_pipe_t *pipe[IGT_MAX_PIPES];
> + igt_pipe_crc_t *pipe_crc[IGT_MAX_PIPES];
> + drmModeModeInfo mode[IGT_MAX_PIPES];
> + enum pipe pipe_id[IGT_MAX_PIPES];
> + int fd;
> +};
> +
> +struct line_check {
> + int found;
> + const char *substr;
> +};
> +
> +static const drmModeModeInfo test_mode[] = {
> + { 533250,
> + 3840, 3888, 3920, 4000, 0,
> + 2160, 2214, 2219, 2222, 0,
> + 60,
> + DRM_MODE_FLAG_NHSYNC,
> + 0x48,
> + "4k60\0",
> + }, /* from LG Ultra HD, product_id = 5B09, serial_number = 1010101 */
> +};
> +
> +/* Forces a mode for a connector. */
> +static void force_output_mode(struct data *d, igt_output_t *output,
> + const drmModeModeInfo *mode)
> +{
> + /* This allows us to create a virtual sink. */
> + if (!igt_output_is_connected(output)) {
> + kmstest_force_edid(d->fd, output->config.connector,
> + igt_kms_get_4k_edid());
> +
> + kmstest_force_connector(d->fd, output->config.connector,
> + FORCE_CONNECTOR_DIGITAL);
> + }
> +
> + igt_output_override_mode(output, mode);
> +}
> +
> +/* Common test setup. */
> +static void test_init(struct data *data)
> +{
> + igt_display_t *display = &data->display;
> + int i, n;
> + bool subvp_capable = false;
> + bool subvp_en = false;
> +
> + for_each_pipe(display, i) {
> + data->pipe_id[i] = PIPE_A + i;
> + data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
> + data->primary[i] = igt_pipe_get_plane_type(data->pipe[i],
> + DRM_PLANE_TYPE_PRIMARY);
> + data->pipe_crc[i] = igt_pipe_crc_new(data->fd,
> + data->pipe_id[i],
> + IGT_PIPE_CRC_SOURCE_AUTO);
Sorry, will fix this before merging.
> + }
> +
> + for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
> + igt_output_t *output = &display->outputs[i];
> +
> + data->output[n] = output;
> + /* Only allow physically connected displays for the tests. */
> + if (!igt_output_is_connected(output))
> + continue;
> + /* SubVP is only enabled on DP */
> + if (output->config.connector->connector_type !=
> + DRM_MODE_CONNECTOR_DisplayPort)
> + continue;
> +
> + igt_assert(kmstest_get_connector_default_mode(
> + data->fd, output->config.connector, &data->mode[n]));
> +
> + force_output_mode(data, data->output[n], &test_mode[0]);
> +
> + n += 1;
> + }
> +
> + igt_require_f(n >= 2, "Requires at least two connected display\n");
> +
> + igt_amd_get_subvp_status(data->fd, &subvp_capable, &subvp_en);
> + igt_require_f(subvp_capable, "Requires hardware that supports Sub-viewport\n");
> +
> + igt_display_reset(display);
> +}
> +
> +/* Common test cleanup. */
> +static void test_fini(struct data *data)
> +{
> + igt_display_t *display = &data->display;
> + int i;
> +
> + for_each_pipe(display, i) {
> + igt_pipe_crc_free(data->pipe_crc[i]);
> + }
> +
> + igt_display_reset(display);
> + igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +}
> +
> +static void test_subvp(struct data *data)
> +{
> + igt_display_t *display = &data->display;
> + igt_fb_t rfb;
> + bool subvp_supp, subvp_en;
> + igt_output_t *output;
> + int i;
> +
> + test_init(data);
> + igt_enable_connectors(data->fd);
> +
> + for_each_pipe(&data->display, i) {
> + /* Setup the output */
> + output = data->output[i];
> + if (!output || !igt_output_is_connected(output))
> + continue;
> +
> + igt_create_pattern_fb(data->fd,
> + test_mode[0].hdisplay,
> + test_mode[0].vdisplay,
> + DRM_FORMAT_XRGB8888,
> + 0,
> + &rfb);
> +
> + igt_output_set_pipe(output, data->pipe_id[i]);
> + igt_plane_set_fb(data->primary[i], &rfb);
> + igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> + }
> +
> +
> + igt_amd_get_subvp_status(data->fd, &subvp_supp, &subvp_en);
> + igt_fail_on_f(!(subvp_supp && subvp_en), "SUBVP did not get enabled\n");
> +
> + igt_remove_fb(data->fd, &rfb);
> + test_fini(data);
> +}
> +
> +igt_main
> +{
> + struct data data;
> +
> + igt_skip_on_simulation();
> +
> + memset(&data, 0, sizeof(data));
> +
> + igt_fixture
> + {
> + data.fd = drm_open_driver_master(DRIVER_AMDGPU);
> + igt_display_require(&data.display, data.fd);
> + igt_display_require_output(&data.display);
> + igt_require(data.display.is_atomic);
> +
> + kmstest_set_vt_graphics_mode();
> + }
> +
> + igt_describe("Tests whether system enables sub-viewport when a specific mode is committed");
> + igt_subtest("dual-4k60") test_subvp(&data);
> +
> + igt_fixture
> + {
> + igt_display_fini(&data.display);
> + }
> +}
> diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build
> index f52fc3645..efd911fab 100644
> --- a/tests/amdgpu/meson.build
> +++ b/tests/amdgpu/meson.build
> @@ -36,6 +36,7 @@ if libdrm_amdgpu.found()
> 'amd_vrr_range',
> 'amd_mall',
> 'amd_odm',
> + 'amd_subvp',
> ]
> if libdrm_amdgpu.version().version_compare('> 2.4.97')
> amdgpu_progs +=[ 'amd_syncobj', ]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for Add a new test for Sub-viewport
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
` (4 preceding siblings ...)
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport Aurabindo Pillai
@ 2023-11-03 19:31 ` Patchwork
2023-11-06 20:00 ` [igt-dev] [PATCH i-g-t v2 0/5] " Aurabindo Pillai
6 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2023-11-03 19:31 UTC (permalink / raw)
To: Aurabindo Pillai; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 10820 bytes --]
== Series Details ==
Series: Add a new test for Sub-viewport
URL : https://patchwork.freedesktop.org/series/125969/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_13835 -> IGTPW_10116
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_10116 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_10116, please notify your bug team (lgci.bug.filing@intel.com) to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/index.html
Participating hosts (36 -> 33)
------------------------------
Additional (1): bat-dg2-9
Missing (4): bat-mtlp-8 bat-kbl-2 bat-jsl-1 fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_10116:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@gtt:
- fi-hsw-4770: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/fi-hsw-4770/igt@i915_selftest@live@gtt.html
Known issues
------------
Here are the changes found in IGTPW_10116 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s0@lmem0:
- bat-dg2-9: NOTRUN -> [INCOMPLETE][2] ([i915#9275])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@gem_exec_suspend@basic-s0@lmem0.html
* igt@gem_lmem_swapping@verify-random:
- fi-hsw-4770: NOTRUN -> [SKIP][3] ([fdo#109271]) +3 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/fi-hsw-4770/igt@gem_lmem_swapping@verify-random.html
* igt@gem_mmap@basic:
- bat-dg2-9: NOTRUN -> [SKIP][4] ([i915#4083])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@gem_mmap@basic.html
* igt@gem_mmap_gtt@basic:
- bat-dg2-9: NOTRUN -> [SKIP][5] ([i915#4077]) +2 other tests skip
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@gem_mmap_gtt@basic.html
* igt@gem_render_tiled_blits@basic:
- bat-dg2-9: NOTRUN -> [SKIP][6] ([i915#4079]) +1 other test skip
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@gem_render_tiled_blits@basic.html
* igt@i915_pm_rps@basic-api:
- bat-dg2-9: NOTRUN -> [SKIP][7] ([i915#6621])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@i915_pm_rps@basic-api.html
* igt@i915_selftest@live@hangcheck:
- fi-skl-guc: [PASS][8] -> [DMESG-FAIL][9] ([i915#9549])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13835/fi-skl-guc/igt@i915_selftest@live@hangcheck.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/fi-skl-guc/igt@i915_selftest@live@hangcheck.html
* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-dg2-9: NOTRUN -> [SKIP][10] ([i915#5190])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_addfb_basic@addfb25-y-tiled-small-legacy.html
* igt@kms_addfb_basic@basic-y-tiled-legacy:
- bat-dg2-9: NOTRUN -> [SKIP][11] ([i915#4215] / [i915#5190])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_addfb_basic@basic-y-tiled-legacy.html
* igt@kms_addfb_basic@framebuffer-vs-set-tiling:
- bat-dg2-9: NOTRUN -> [SKIP][12] ([i915#4212]) +6 other tests skip
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html
* igt@kms_addfb_basic@tile-pitch-mismatch:
- bat-dg2-9: NOTRUN -> [SKIP][13] ([i915#4212] / [i915#5608])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_addfb_basic@tile-pitch-mismatch.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-dg2-9: NOTRUN -> [SKIP][14] ([i915#4103] / [i915#4213] / [i915#5608]) +1 other test skip
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
* igt@kms_force_connector_basic@force-load-detect:
- bat-dg2-9: NOTRUN -> [SKIP][15] ([fdo#109285])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_force_connector_basic@force-load-detect.html
* igt@kms_force_connector_basic@prune-stale-modes:
- bat-dg2-9: NOTRUN -> [SKIP][16] ([i915#5274])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_force_connector_basic@prune-stale-modes.html
* igt@kms_psr@sprite_plane_onoff:
- bat-dg2-9: NOTRUN -> [SKIP][17] ([i915#1072]) +3 other tests skip
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_psr@sprite_plane_onoff.html
* igt@kms_setmode@basic-clone-single-crtc:
- bat-dg2-9: NOTRUN -> [SKIP][18] ([i915#3555] / [i915#4098])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@kms_setmode@basic-clone-single-crtc.html
* igt@prime_vgem@basic-fence-flip:
- bat-dg2-9: NOTRUN -> [SKIP][19] ([i915#3708])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@prime_vgem@basic-fence-flip.html
* igt@prime_vgem@basic-fence-mmap:
- bat-dg2-9: NOTRUN -> [SKIP][20] ([i915#3708] / [i915#4077]) +1 other test skip
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@prime_vgem@basic-fence-mmap.html
* igt@prime_vgem@basic-write:
- bat-dg2-9: NOTRUN -> [SKIP][21] ([i915#3291] / [i915#3708]) +2 other tests skip
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-dg2-9/igt@prime_vgem@basic-write.html
#### Possible fixes ####
* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [DMESG-FAIL][22] ([i915#5334]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13835/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
* igt@kms_hdmi_inject@inject-audio:
- fi-kbl-guc: [FAIL][24] ([IGT#3]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13835/fi-kbl-guc/igt@kms_hdmi_inject@inject-audio.html
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/fi-kbl-guc/igt@kms_hdmi_inject@inject-audio.html
* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-b-dp-5:
- bat-adlp-11: [DMESG-FAIL][26] ([i915#6868]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13835/bat-adlp-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-b-dp-5.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-adlp-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-b-dp-5.html
* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-c-dp-5:
- bat-adlp-11: [FAIL][28] ([i915#9047]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13835/bat-adlp-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-c-dp-5.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-adlp-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-c-dp-5.html
* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-dp-5:
- bat-adlp-11: [ABORT][30] ([i915#8668]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13835/bat-adlp-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-dp-5.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/bat-adlp-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-dp-5.html
* igt@vgem_basic@unload:
- fi-hsw-4770: [INCOMPLETE][32] -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13835/fi-hsw-4770/igt@vgem_basic@unload.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/fi-hsw-4770/igt@vgem_basic@unload.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[IGT#3]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/3
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5608]: https://gitlab.freedesktop.org/drm/intel/issues/5608
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6868]: https://gitlab.freedesktop.org/drm/intel/issues/6868
[i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
[i915#9047]: https://gitlab.freedesktop.org/drm/intel/issues/9047
[i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275
[i915#9549]: https://gitlab.freedesktop.org/drm/intel/issues/9549
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7573 -> IGTPW_10116
CI-20190529: 20190529
CI_DRM_13835: ca1fcd4faf444fc6d8b3cf88a17e2eb7765c1299 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_10116: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/index.html
IGT_7573: 69485d223b256208614e9949a4a7e84bde52d5f5 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Testlist changes
----------------
-igt@xe_mmap@cpu-caching
-igt@xe_pat@pat-index-all
-igt@xe_pat@pat-index-xe2
-igt@xe_pat@pat-index-xehpc
-igt@xe_pat@pat-index-xelp
-igt@xe_pat@pat-index-xelpg
-igt@xe_pat@userptr-coh-none
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10116/index.html
[-- Attachment #2: Type: text/html, Size: 12396 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
` (5 preceding siblings ...)
2023-11-03 19:31 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add a new " Patchwork
@ 2023-11-06 20:00 ` Aurabindo Pillai
6 siblings, 0 replies; 14+ messages in thread
From: Aurabindo Pillai @ 2023-11-06 20:00 UTC (permalink / raw)
To: igt-dev, kamil.konieczny; +Cc: hersenxs.wu
On 2023-11-03 14:22, Aurabindo Pillai wrote:
> Changes in v2
> =================
>
> * Removed an unused struct definition
> * Fixes style issues reported by checkpatch.pl
> * Added SPDX license identifier to the new test
> * Fixed #include order for system includes
>
> ---
>
> Aurabindo Pillai (5):
> lib/amdgpu: Remove unused struct
> llib/amd: Update function documentation
> lib/amd: improve readablity for MALL capability check
> lib/amd: Add check for SubVP feature status
> test/amdgpu: Add test for Sub-viewport
>
> lib/igt_amd.c | 44 ++++++++--
> lib/igt_amd.h | 1 +
> tests/amdgpu/amd_subvp.c | 180 +++++++++++++++++++++++++++++++++++++++
> tests/amdgpu/meson.build | 1 +
> 4 files changed, 217 insertions(+), 9 deletions(-)
> create mode 100644 tests/amdgpu/amd_subvp.c
>
Hi Kamil,
Any other concerns?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2 1/5] lib/amdgpu: Remove unused struct
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/amdgpu: Remove unused struct Aurabindo Pillai
@ 2023-11-08 6:38 ` Alex Hung
0 siblings, 0 replies; 14+ messages in thread
From: Alex Hung @ 2023-11-08 6:38 UTC (permalink / raw)
To: Aurabindo Pillai, igt-dev; +Cc: hersenxs.wu
Reviewed-by: Alex Hung <alex.hung@amd.com>
On 2023-11-03 12:22, Aurabindo Pillai wrote:
> dim2d has no references within AMDGPU tests, so remove it
>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
> ---
> lib/igt_amd.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/lib/igt_amd.c b/lib/igt_amd.c
> index 84c6d7545..f0fbe97ef 100644
> --- a/lib/igt_amd.c
> +++ b/lib/igt_amd.c
> @@ -45,11 +45,6 @@
> #define Y6 64
> #define Y7 128
>
> -struct dim2d
> -{
> - int w;
> - int h;
> -};
>
> uint32_t igt_amd_create_bo(int fd, uint64_t size)
> {
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2 2/5] llib/amd: Update function documentation
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 2/5] llib/amd: Update function documentation Aurabindo Pillai
@ 2023-11-08 6:38 ` Alex Hung
0 siblings, 0 replies; 14+ messages in thread
From: Alex Hung @ 2023-11-08 6:38 UTC (permalink / raw)
To: Aurabindo Pillai, igt-dev; +Cc: hersenxs.wu
Reviewed-by: Alex Hung <alex.hung@amd.com>
On 2023-11-03 12:22, Aurabindo Pillai wrote:
> The existing documetation incorrectly specifies the return value.
> Update the doc entry for functions that check MALL status
>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
> ---
> lib/igt_amd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_amd.c b/lib/igt_amd.c
> index f0fbe97ef..8c736b3e2 100644
> --- a/lib/igt_amd.c
> +++ b/lib/igt_amd.c
> @@ -1178,8 +1178,8 @@ static bool get_dm_capabilities(int drm_fd, char *buf, size_t size)
> * @brief check if AMDGPU mall_capable interface entry exist and defined
> *
> * @param drm_fd DRM file descriptor
> - * @return true if dm capabilities interface exists and MALL is supported
> - * @return false if capabilities could not be read.
> + * @param supported will be set to true if hardware supports MALL
> + * @param enabled will be set to true if MALL is currently in use
> */
> void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled)
> {
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2 3/5] lib/amd: improve readablity for MALL capability check
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/amd: improve readablity for MALL capability check Aurabindo Pillai
@ 2023-11-08 6:39 ` Alex Hung
0 siblings, 0 replies; 14+ messages in thread
From: Alex Hung @ 2023-11-08 6:39 UTC (permalink / raw)
To: Aurabindo Pillai, igt-dev; +Cc: hersenxs.wu
Reviewed-by: Alex Hung <alex.hung@amd.com>
On 2023-11-03 12:22, Aurabindo Pillai wrote:
> Move the hard coded string out of the function and define
> an identifier for checking MALL supported/enabled status
>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
> ---
> lib/igt_amd.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_amd.c b/lib/igt_amd.c
> index 8c736b3e2..177a1094d 100644
> --- a/lib/igt_amd.c
> +++ b/lib/igt_amd.c
> @@ -45,6 +45,8 @@
> #define Y6 64
> #define Y7 128
>
> +#define mall_supported "mall supported: yes"
> +#define mall_enabled "mall supported: yes, enabled: yes"
>
> uint32_t igt_amd_create_bo(int fd, uint64_t size)
> {
> @@ -1192,11 +1194,11 @@ void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled)
> if (!get_dm_capabilities(drm_fd, buf, 1024))
> return;
>
> - mall_loc = strstr(buf, "mall supported: yes");
> + mall_loc = strstr(buf, mall_supported);
> if (mall_loc)
> *supported = true;
>
> - mall_loc = strstr(buf, "enabled: yes");
> + mall_loc = strstr(buf, mall_enabled);
> if (mall_loc && *supported)
> *enabled = true;
> }
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2 4/5] lib/amd: Add check for SubVP feature status
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 4/5] lib/amd: Add check for SubVP feature status Aurabindo Pillai
@ 2023-11-08 6:40 ` Alex Hung
0 siblings, 0 replies; 14+ messages in thread
From: Alex Hung @ 2023-11-08 6:40 UTC (permalink / raw)
To: Aurabindo Pillai, igt-dev; +Cc: hersenxs.wu
Reviewed-by: Alex Hung <alex.hung@amd.com>
On 2023-11-03 12:22, Aurabindo Pillai wrote:
> Add an API to check whether Subviewport feature is supported and enabled
>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
> ---
> lib/igt_amd.c | 29 +++++++++++++++++++++++++++++
> lib/igt_amd.h | 1 +
> 2 files changed, 30 insertions(+)
>
> diff --git a/lib/igt_amd.c b/lib/igt_amd.c
> index 177a1094d..247a42f37 100644
> --- a/lib/igt_amd.c
> +++ b/lib/igt_amd.c
> @@ -45,6 +45,8 @@
> #define Y6 64
> #define Y7 128
>
> +#define subvp_supported "sub-viewport supported: yes"
> +#define subvp_enabled "sub-viewport supported: yes, enabled: yes"
> #define mall_supported "mall supported: yes"
> #define mall_enabled "mall supported: yes, enabled: yes"
>
> @@ -1203,6 +1205,33 @@ void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled)
> *enabled = true;
> }
>
> +/**
> + * @brief check if AMDGPU sub-viewport support exists
> + *
> + * @param drm_fd DRM file descriptor
> + * @param supported set to true if harwdare supports subviewport
> + * @param enabled set tot true if subviewport is currently in use
> + */
> +void igt_amd_get_subvp_status(int drm_fd, bool *supported, bool *enabled)
> +{
> + char buf[1024];
> + char *subvp_loc;
> +
> + *supported = false;
> + *enabled = false;
> +
> + if (!get_dm_capabilities(drm_fd, buf, 1024))
> + return;
> +
> + subvp_loc = strstr(buf, subvp_supported);
> + if (subvp_loc)
> + *supported = true;
> +
> + subvp_loc = strstr(buf, subvp_enabled);
> + if (subvp_loc && *supported)
> + *enabled = true;
> +}
> +
> /**
> * @brief check if AMDGPU DM visual confirm debugfs interface entry exist and defined
> *
> diff --git a/lib/igt_amd.h b/lib/igt_amd.h
> index de992ac4f..1e66348ad 100644
> --- a/lib/igt_amd.h
> +++ b/lib/igt_amd.h
> @@ -200,5 +200,6 @@ int igt_amd_get_visual_confirm(int drm_fd);
> bool igt_amd_set_visual_confirm(int drm_fd, enum amdgpu_debug_visual_confirm option);
>
> void igt_amd_get_mall_status(int drm_fd, bool *supported, bool *enabled);
> +void igt_amd_get_subvp_status(int drm_fd, bool *supported, bool *enabled);
> bool igt_amd_output_has_odm_combine_segments(int drm_fd, char *connector_name);
> #endif /* IGT_AMD_H */
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport Aurabindo Pillai
2023-11-03 18:25 ` Aurabindo Pillai
@ 2023-11-08 6:41 ` Alex Hung
1 sibling, 0 replies; 14+ messages in thread
From: Alex Hung @ 2023-11-08 6:41 UTC (permalink / raw)
To: Aurabindo Pillai, igt-dev; +Cc: hersenxs.wu
Reviewed-by: Alex Hung <alex.hung@amd.com>
On 2023-11-03 12:22, Aurabindo Pillai wrote:
> Sub-viewport is a power saving feature found on DCN32/DCN321
> and newer dGPUs.
>
> Add a test that commit a high resolution test pattern on multiple
> displays and checks whether Sub-viewport feature is engaged.
>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
> ---
> tests/amdgpu/amd_subvp.c | 180 +++++++++++++++++++++++++++++++++++++++
> tests/amdgpu/meson.build | 1 +
> 2 files changed, 181 insertions(+)
> create mode 100644 tests/amdgpu/amd_subvp.c
>
> diff --git a/tests/amdgpu/amd_subvp.c b/tests/amdgpu/amd_subvp.c
> new file mode 100644
> index 000000000..aa959441b
> --- /dev/null
> +++ b/tests/amdgpu/amd_subvp.c
> @@ -0,0 +1,180 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright 2023 Advanced Micro Devices, Inc.
> + */
> +
> +#include <fcntl.h>
> +
> +#include "igt.h"
> +#include "igt_amd.h"
> +#include "igt_core.h"
> +
> +IGT_TEST_DESCRIPTION("Test enabling sub-viewport feature");
> +
> +/* Common test data. */
> +struct data {
> + igt_display_t display;
> + igt_plane_t *primary[IGT_MAX_PIPES];
> + igt_output_t *output[IGT_MAX_PIPES];
> + igt_pipe_t *pipe[IGT_MAX_PIPES];
> + igt_pipe_crc_t *pipe_crc[IGT_MAX_PIPES];
> + drmModeModeInfo mode[IGT_MAX_PIPES];
> + enum pipe pipe_id[IGT_MAX_PIPES];
> + int fd;
> +};
> +
> +struct line_check {
> + int found;
> + const char *substr;
> +};
> +
> +static const drmModeModeInfo test_mode[] = {
> + { 533250,
> + 3840, 3888, 3920, 4000, 0,
> + 2160, 2214, 2219, 2222, 0,
> + 60,
> + DRM_MODE_FLAG_NHSYNC,
> + 0x48,
> + "4k60\0",
> + }, /* from LG Ultra HD, product_id = 5B09, serial_number = 1010101 */
> +};
> +
> +/* Forces a mode for a connector. */
> +static void force_output_mode(struct data *d, igt_output_t *output,
> + const drmModeModeInfo *mode)
> +{
> + /* This allows us to create a virtual sink. */
> + if (!igt_output_is_connected(output)) {
> + kmstest_force_edid(d->fd, output->config.connector,
> + igt_kms_get_4k_edid());
> +
> + kmstest_force_connector(d->fd, output->config.connector,
> + FORCE_CONNECTOR_DIGITAL);
> + }
> +
> + igt_output_override_mode(output, mode);
> +}
> +
> +/* Common test setup. */
> +static void test_init(struct data *data)
> +{
> + igt_display_t *display = &data->display;
> + int i, n;
> + bool subvp_capable = false;
> + bool subvp_en = false;
> +
> + for_each_pipe(display, i) {
> + data->pipe_id[i] = PIPE_A + i;
> + data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
> + data->primary[i] = igt_pipe_get_plane_type(data->pipe[i],
> + DRM_PLANE_TYPE_PRIMARY);
> + data->pipe_crc[i] = igt_pipe_crc_new(data->fd,
> + data->pipe_id[i],
> + IGT_PIPE_CRC_SOURCE_AUTO);
> + }
> +
> + for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
> + igt_output_t *output = &display->outputs[i];
> +
> + data->output[n] = output;
> + /* Only allow physically connected displays for the tests. */
> + if (!igt_output_is_connected(output))
> + continue;
> + /* SubVP is only enabled on DP */
> + if (output->config.connector->connector_type !=
> + DRM_MODE_CONNECTOR_DisplayPort)
> + continue;
> +
> + igt_assert(kmstest_get_connector_default_mode(
> + data->fd, output->config.connector, &data->mode[n]));
> +
> + force_output_mode(data, data->output[n], &test_mode[0]);
> +
> + n += 1;
> + }
> +
> + igt_require_f(n >= 2, "Requires at least two connected display\n");
> +
> + igt_amd_get_subvp_status(data->fd, &subvp_capable, &subvp_en);
> + igt_require_f(subvp_capable, "Requires hardware that supports Sub-viewport\n");
> +
> + igt_display_reset(display);
> +}
> +
> +/* Common test cleanup. */
> +static void test_fini(struct data *data)
> +{
> + igt_display_t *display = &data->display;
> + int i;
> +
> + for_each_pipe(display, i) {
> + igt_pipe_crc_free(data->pipe_crc[i]);
> + }
> +
> + igt_display_reset(display);
> + igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +}
> +
> +static void test_subvp(struct data *data)
> +{
> + igt_display_t *display = &data->display;
> + igt_fb_t rfb;
> + bool subvp_supp, subvp_en;
> + igt_output_t *output;
> + int i;
> +
> + test_init(data);
> + igt_enable_connectors(data->fd);
> +
> + for_each_pipe(&data->display, i) {
> + /* Setup the output */
> + output = data->output[i];
> + if (!output || !igt_output_is_connected(output))
> + continue;
> +
> + igt_create_pattern_fb(data->fd,
> + test_mode[0].hdisplay,
> + test_mode[0].vdisplay,
> + DRM_FORMAT_XRGB8888,
> + 0,
> + &rfb);
> +
> + igt_output_set_pipe(output, data->pipe_id[i]);
> + igt_plane_set_fb(data->primary[i], &rfb);
> + igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> + }
> +
> +
> + igt_amd_get_subvp_status(data->fd, &subvp_supp, &subvp_en);
> + igt_fail_on_f(!(subvp_supp && subvp_en), "SUBVP did not get enabled\n");
> +
> + igt_remove_fb(data->fd, &rfb);
> + test_fini(data);
> +}
> +
> +igt_main
> +{
> + struct data data;
> +
> + igt_skip_on_simulation();
> +
> + memset(&data, 0, sizeof(data));
> +
> + igt_fixture
> + {
> + data.fd = drm_open_driver_master(DRIVER_AMDGPU);
> + igt_display_require(&data.display, data.fd);
> + igt_display_require_output(&data.display);
> + igt_require(data.display.is_atomic);
> +
> + kmstest_set_vt_graphics_mode();
> + }
> +
> + igt_describe("Tests whether system enables sub-viewport when a specific mode is committed");
> + igt_subtest("dual-4k60") test_subvp(&data);
> +
> + igt_fixture
> + {
> + igt_display_fini(&data.display);
> + }
> +}
> diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build
> index f52fc3645..efd911fab 100644
> --- a/tests/amdgpu/meson.build
> +++ b/tests/amdgpu/meson.build
> @@ -36,6 +36,7 @@ if libdrm_amdgpu.found()
> 'amd_vrr_range',
> 'amd_mall',
> 'amd_odm',
> + 'amd_subvp',
> ]
> if libdrm_amdgpu.version().version_compare('> 2.4.97')
> amdgpu_progs +=[ 'amd_syncobj', ]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2023-11-08 6:41 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-03 18:22 [igt-dev] [PATCH i-g-t v2 0/5] Add a new test for Sub-viewport Aurabindo Pillai
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/amdgpu: Remove unused struct Aurabindo Pillai
2023-11-08 6:38 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 2/5] llib/amd: Update function documentation Aurabindo Pillai
2023-11-08 6:38 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/amd: improve readablity for MALL capability check Aurabindo Pillai
2023-11-08 6:39 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 4/5] lib/amd: Add check for SubVP feature status Aurabindo Pillai
2023-11-08 6:40 ` Alex Hung
2023-11-03 18:22 ` [igt-dev] [PATCH i-g-t v2 5/5] test/amdgpu: Add test for Sub-viewport Aurabindo Pillai
2023-11-03 18:25 ` Aurabindo Pillai
2023-11-08 6:41 ` Alex Hung
2023-11-03 19:31 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add a new " Patchwork
2023-11-06 20:00 ` [igt-dev] [PATCH i-g-t v2 0/5] " Aurabindo Pillai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox