From: vitaly prosyak <vprosyak@amd.com>
To: Jesse Zhang <jesse.zhang@amd.com>, igt-dev@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
Tim Huang <tim.huang@amd.com>,
Luben Tuikov <luben.tuikov@amd.com>,
Christian Koenig <christian.koenig@amd.com>
Subject: Re: [igt-dev] [PATCH] tests/amdgpu: add stable pstate test
Date: Fri, 22 Sep 2023 20:24:06 -0400 [thread overview]
Message-ID: <2410f4ea-da8c-21c8-2a29-dd281ae1e149@amd.com> (raw)
In-Reply-To: <20230922055242.3422999-1-jesse.zhang@amd.com>
Hi Jesse,
Please, do not add pstate test to the basic tests.
Please, create a separate file amd_pstate.c, and use conditional compilation which depends on when such' ioctl' was added to drmlib ,
for example, into meson.build we have this approach already.
if libdrm_amdgpu.version().version_compare('> 2.4.99')
amdgpu_progs +=[ 'amd_dispatch',]
else
warning('libdrm <= 2.4.99 found, amdgpu_cs_query_reset_state2 not applicable')
endif
Thanks, Vitaly
On 2023-09-22 01:52, Jesse Zhang wrote:
> Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
> Signed-off-by: Tim Huang <tim.huang@amd.com>
> ---
> tests/amdgpu/amd_basic.c | 43 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/tests/amdgpu/amd_basic.c b/tests/amdgpu/amd_basic.c
> index 24c70a9f7..f23a13343 100644
> --- a/tests/amdgpu/amd_basic.c
> +++ b/tests/amdgpu/amd_basic.c
> @@ -612,6 +612,39 @@ amdgpu_sync_dependency_test(amdgpu_device_handle device_handle)
> free_cmd_base(base);
> }
>
> +#ifdef AMDGPU_CTX_OP_GET_STABLE_PSTATE
> +static void
> +amdgpu_stable_pstate_test(amdgpu_device_handle device_handle)
> +{
> + int r;
> + amdgpu_context_handle context_handle;
> + uint32_t current_pstate = 0, new_pstate = 0;
> +
> + r = amdgpu_cs_ctx_create(device_handle, &context_handle);
> + igt_assert_eq(r, 0);
> +
> + r = amdgpu_cs_ctx_stable_pstate(context_handle,
> + AMDGPU_CTX_OP_GET_STABLE_PSTATE,
> + 0, ¤t_pstate);
> + igt_assert_eq(r, 0);
> + igt_assert_eq(new_pstate, AMDGPU_CTX_STABLE_PSTATE_NONE);
> + r = amdgpu_cs_ctx_stable_pstate(context_handle,
> + AMDGPU_CTX_OP_SET_STABLE_PSTATE,
> + AMDGPU_CTX_STABLE_PSTATE_PEAK, NULL);
> + igt_assert_eq(r, 0);
> +
> + r = amdgpu_cs_ctx_stable_pstate(context_handle,
> + AMDGPU_CTX_OP_GET_STABLE_PSTATE,
> + 0, &new_pstate);
> + igt_assert_eq(r, 0);
> + igt_assert_eq(new_pstate, AMDGPU_CTX_STABLE_PSTATE_PEAK);
> +
> + r = amdgpu_cs_ctx_free(context_handle);
> + igt_assert_eq(r, 0);
> +
> +}
> +#endif
> +
> static void
> amdgpu_gfx_dispatch_test_gfx(amdgpu_device_handle device_handle)
> {
> @@ -739,6 +772,16 @@ igt_main
> }
> }
>
> +#ifdef AMDGPU_CTX_OP_GET_STABLE_PSTATE
> + igt_describe("Check-pstate-for-gfx-power-and-clock");
> + igt_subtest_with_dynamic("stable-pstate-test-with-IP-SMU") {
> + if (arr_cap[AMD_IP_GFX]) {
> + igt_dynamic_f("stable-pstate-test")
> + amdgpu_stable_pstate_test(device);
> + }
> + }
> +#endif
> +
> igt_fixture {
> amdgpu_device_deinitialize(device);
> drm_close_driver(fd);
next prev parent reply other threads:[~2023-09-23 0:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 5:52 [igt-dev] [PATCH] tests/amdgpu: add stable pstate test Jesse Zhang
2023-09-22 21:03 ` Luben Tuikov
2023-09-23 0:24 ` vitaly prosyak [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-09-25 6:05 Jesse Zhang
2023-09-26 1:14 ` vitaly prosyak
2023-09-26 2:50 Jesse Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2410f4ea-da8c-21c8-2a29-dd281ae1e149@amd.com \
--to=vprosyak@amd.com \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jesse.zhang@amd.com \
--cc=luben.tuikov@amd.com \
--cc=tim.huang@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox