<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 11pt;">This is awaiting moderators' review, after the approval may be the CI would be triggered.
<br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 11pt;"></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<font size="2"><span style="font-size:11pt">Thanks,</span></font></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<font size="2"><span style="font-size:11pt">Bindu </span></font><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com><br>
<b>Sent:</b> Friday, July 23, 2021 9:33 AM<br>
<b>To:</b> R, Bindu <Bindu.R@amd.com>; petri.latvala@intel.com <petri.latvala@intel.com>; arek@hiler.eu <arek@hiler.eu><br>
<b>Cc:</b> markyacoub@google.com <markyacoub@google.com>; igt-dev@lists.freedesktop.org <igt-dev@lists.freedesktop.org>; Wentland, Harry <Harry.Wentland@amd.com>; Jacob, Anson <Anson.Jacob@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Choi, Nicholas
<Nicholas.Choi@amd.com><br>
<b>Subject:</b> Re: [PATCH v2] tests/kms_bw: New test for bandwidth validation</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">For some reason, I don't see this patch in the patchwork and in the<br>
igt-dev mailing list. Did the CI run in this patch? Any idea on what<br>
happened here?<br>
<br>
Thanks<br>
Siqueira<br>
<br>
On 07/22, Bindu Ramamurthy wrote:<br>
> From: Aurabindo Pillai <aurabindo.pillai@amd.com><br>
> <br>
> Add linear tiling mode tests<br>
> <br>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com><br>
> Acked-by: Bindu Ramamurthy <bindu.r@amd.com><br>
> ---<br>
> <br>
> Changes since v2:<br>
> Test added as generic IGT. <br>
> <br>
> <br>
> tests/kms_bw.c | 250 ++++++++++++++++++++++++++++++++++++++++++++++<br>
> tests/meson.build | 1 +<br>
> 2 files changed, 251 insertions(+)<br>
> create mode 100644 tests/kms_bw.c<br>
> <br>
> diff --git a/tests/kms_bw.c b/tests/kms_bw.c<br>
> new file mode 100644<br>
> index 00000000..65b97c98<br>
> --- /dev/null<br>
> +++ b/tests/kms_bw.c<br>
> @@ -0,0 +1,250 @@<br>
> +/*<br>
> + * Copyrights 2021 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
> + * OTHER DEALINGS IN THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#include "drm_mode.h"<br>
> +#include "igt.h"<br>
> +#include "drm.h"<br>
> +#include <stdio.h><br>
> +#include <xf86drmMode.h><br>
> +<br>
> +/* Maximum pipes on any ASIC. */<br>
> +#define MAX_PIPES 6<br>
> +<br>
> +/* Common test data. */<br>
> +typedef struct data {<br>
> + igt_display_t display;<br>
> + igt_plane_t *primary[MAX_PIPES];<br>
> + igt_output_t *output[MAX_PIPES];<br>
> + igt_pipe_t *pipe[MAX_PIPES];<br>
> + igt_pipe_crc_t *pipe_crc[MAX_PIPES];<br>
> + drmModeModeInfo mode[MAX_PIPES];<br>
> + enum pipe pipe_id[MAX_PIPES];<br>
> + int w[MAX_PIPES];<br>
> + int h[MAX_PIPES];<br>
> + int fd;<br>
> +} data_t;<br>
> +<br>
> +static const drmModeModeInfo test_mode_1 = {<br>
> + .name = "1920x1080p\0",<br>
> + .vrefresh = 60,<br>
> + .clock = 173000,<br>
> + .hdisplay = 1920,<br>
> + .hsync_start = 2048,<br>
> + .hsync_end = 2248,<br>
> + .htotal = 2576,<br>
> + .vdisplay = 1080,<br>
> + .vsync_start = 1083,<br>
> + .vsync_end = 1088,<br>
> + .vtotal = 1120,<br>
> + .type = 0x40,<br>
> + .flags = DRM_MODE_FLAG_NHSYNC,<br>
> + .hskew = 0,<br>
> + .vscan = 0,<br>
> +};<br>
> +<br>
> +static const drmModeModeInfo test_mode_2 = {<br>
> + .name = "2560x1440p\0",<br>
> + .vrefresh = 60,<br>
> + .clock = 312250,<br>
> + .hdisplay = 2560,<br>
> + .hsync_start = 2752,<br>
> + .hsync_end = 3024,<br>
> + .htotal = 3488,<br>
> + .vdisplay = 1440,<br>
> + .vsync_start = 1443,<br>
> + .vsync_end = 1448,<br>
> + .vtotal = 1493,<br>
> + .type = 0x40,<br>
> + .flags = DRM_MODE_FLAG_NHSYNC,<br>
> + .hskew = 0,<br>
> + .vscan = 0,<br>
> +};<br>
> +<br>
> +static const drmModeModeInfo test_mode_3 = {<br>
> + .name = "3840x2160p\0",<br>
> + .vrefresh = 60,<br>
> + .clock = 533000,<br>
> + .hdisplay = 3840,<br>
> + .hsync_start = 3888,<br>
> + .hsync_end = 3920,<br>
> + .htotal = 4000,<br>
> + .vdisplay = 2160,<br>
> + .vsync_start = 2163,<br>
> + .vsync_end = 2168,<br>
> + .vtotal = 2222,<br>
> + .type = 0x40,<br>
> + .flags = DRM_MODE_FLAG_NHSYNC,<br>
> + .hskew = 0,<br>
> + .vscan = 0,<br>
> +};<br>
> +<br>
> +static void test_init(data_t *data)<br>
> +{<br>
> + igt_display_t *display = &data->display;<br>
> + int i, max_pipes = display->n_pipes;<br>
> +<br>
> + for_each_pipe(display, i) {<br>
> + data->pipe_id[i] = PIPE_A + i;<br>
> + data->pipe[i] = &data->display.pipes[data->pipe_id[i]];<br>
> + data->primary[i] = igt_pipe_get_plane_type(<br>
> + data->pipe[i], DRM_PLANE_TYPE_PRIMARY);<br>
> + data->pipe_crc[i] =<br>
> + igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");<br>
> + }<br>
> +<br>
> + for (i = 0; i < display->n_outputs && i < max_pipes; i++) {<br>
> + igt_output_t *output = &display->outputs[i];<br>
> +<br>
> + data->output[i] = output;<br>
> +<br>
> + /* Only allow physically connected displays for the tests. */<br>
> + if (!igt_output_is_connected(output))<br>
> + continue;<br>
> +<br>
> + igt_assert(kmstest_get_connector_default_mode(<br>
> + data->fd, output->config.connector, &data->mode[i]));<br>
> +<br>
> + data->w[i] = data->mode[i].hdisplay;<br>
> + data->h[i] = data->mode[i].vdisplay;<br>
> + }<br>
> +<br>
> +<br>
> + igt_require(data->output[0]);<br>
> + igt_display_reset(display);<br>
> +}<br>
> +<br>
> +static void test_fini(data_t *data)<br>
> +{<br>
> + igt_display_t *display = &data->display;<br>
> + int i;<br>
> +<br>
> + for_each_pipe(display, i) {<br>
> + igt_pipe_crc_free(data->pipe_crc[i]);<br>
> + }<br>
> +<br>
> + igt_display_reset(display);<br>
> + igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);<br>
> +}<br>
> +<br>
> +/* Forces a mode for a connector. */<br>
> +static void force_output_mode(data_t *d, igt_output_t *output,<br>
> + const drmModeModeInfo *mode)<br>
> +{<br>
> + /* This allows us to create a virtual sink. */<br>
> + if (!igt_output_is_connected(output)) {<br>
> + kmstest_force_edid(d->fd, output->config.connector,<br>
> + igt_kms_get_4k_edid());<br>
> +<br>
> + kmstest_force_connector(d->fd, output->config.connector,<br>
> + FORCE_CONNECTOR_DIGITAL);<br>
> + }<br>
> +<br>
> + igt_output_override_mode(output, mode);<br>
> +}<br>
> +<br>
> +static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo *mode) {<br>
> + igt_display_t *display = &data->display;<br>
> + igt_output_t *output;<br>
> + struct igt_fb buffer[MAX_PIPES];<br>
> + igt_crc_t zero, captured[MAX_PIPES];<br>
> + void *user_data = NULL;<br>
> + int ret;<br>
> + int i = 0;<br>
> +<br>
> + test_init(data);<br>
> +<br>
> + igt_skip_on_f(pipe >= igt_display_get_n_pipes(display),<br>
> + "ASIC does not have %d pipes\n", pipe);<br>
> +<br>
> + /* create buffers */<br>
> + for (i = 0; i <= pipe; i++) {<br>
> +<br>
> + output = data->output[i];<br>
> + if (!output) {<br>
> + continue;<br>
> + }<br>
> +<br>
> + force_output_mode(data, output, mode);<br>
> +<br>
> + igt_create_color_fb(display->drm_fd, test_mode_1.hdisplay,<br>
> + test_mode_1.vdisplay, DRM_FORMAT_XRGB8888,<br>
> + DRM_FORMAT_MOD_NONE, 1.f, 0.f, 0.f,<br>
> + &buffer[i]);<br>
> +<br>
> + igt_output_set_pipe(output, i);<br>
> +<br>
> + igt_plane_set_fb(data->primary[i], &buffer[i]);<br>
> + }<br>
> +<br>
> + ret = igt_display_try_commit_atomic(<br>
> + display, DRM_MODE_ATOMIC_ALLOW_MODESET, user_data);<br>
> +<br>
> + igt_assert_f(ret >= 0, "Modeset failed\n");<br>
> +<br>
> + for (i = 0; i <= pipe; i++) {<br>
> + igt_pipe_crc_collect_crc(data->pipe_crc[i], &captured[i]);<br>
> + igt_assert_f(!igt_check_crc_equal(&zero, &captured[i]),<br>
> + "CRC is zero\n");<br>
> + igt_remove_fb(display->drm_fd, &buffer[i]);<br>
> + }<br>
> +<br>
> + test_fini(data);<br>
> +}<br>
> +<br>
> +igt_main<br>
> +{<br>
> + data_t data;<br>
> + int i = 0;<br>
> +<br>
> + igt_skip_on_simulation();<br>
> +<br>
> + memset(&data, 0, sizeof(data));<br>
> +<br>
> + igt_fixture<br>
> + {<br>
> + data.fd = drm_open_driver_master(DRIVER_ANY);<br>
> +<br>
> + kmstest_set_vt_graphics_mode();<br>
> +<br>
> + igt_display_require(&data.display, data.fd);<br>
> + igt_require(&data.display.is_atomic);<br>
> + igt_display_require_output(&data.display);<br>
> +<br>
> + }<br>
> +<br>
> + for (i = 0; i < MAX_PIPES; i++) {<br>
> + igt_subtest_f("linear-tiling-%d-displays-%s", i+1,<br>
> + test_mode_1.name)<br>
> + run_test_linear_tiling(&data, i, &test_mode_1);<br>
> + igt_subtest_f("linear-tiling-%d-displays-%s", i+1,<br>
> + test_mode_2.name)<br>
> + run_test_linear_tiling(&data, i, &test_mode_2);<br>
> + igt_subtest_f("linear-tiling-%d-displays-%s", i+1,<br>
> + test_mode_3.name)<br>
> + run_test_linear_tiling(&data, i, &test_mode_3);<br>
> + }<br>
> +<br>
> + igt_fixture<br>
> + {<br>
> + igt_display_fini(&data.display);<br>
> + }<br>
> +}<br>
> diff --git a/tests/meson.build b/tests/meson.build<br>
> index 1bdfddbb..6d1ebe42 100644<br>
> --- a/tests/meson.build<br>
> +++ b/tests/meson.build<br>
> @@ -22,6 +22,7 @@ test_progs = [<br>
> 'kms_big_fb',<br>
> 'kms_big_joiner' ,<br>
> 'kms_busy',<br>
> + 'kms_bw',<br>
> 'kms_ccs',<br>
> 'kms_cdclk',<br>
> 'kms_concurrent',<br>
> -- <br>
> 2.25.1<br>
> <br>
<br>
-- <br>
Rodrigo Siqueira<br>
<a href="https://siqueira.tech">https://siqueira.tech</a><br>
</div>
</span></font></div>
</div>
</body>
</html>