[PATCH 2/2] tests/xe_eudebug_online: update thread count handling in query_attention_bitmask_size()
Cavitt, Jonathan
jonathan.cavitt at intel.com
Thu Nov 14 22:00:08 UTC 2024
-----Original Message-----
From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Maslak, Jan
Sent: Thursday, November 14, 2024 8:29 AM
To: igt-dev at lists.freedesktop.org
Cc: Grzegorzek, Dominik <dominik.grzegorzek at intel.com>; Maslak, Jan <jan.maslak at intel.com>
Subject: [PATCH 2/2] tests/xe_eudebug_online: update thread count handling in query_attention_bitmask_size()
>
> ---
This patch seems to be missing a commit message. The commit message doesn't need
to be particularly complicated, as long as it explains what the patch does and why it's
necessary. Though the specifics of what needs to go here depend on your decisions with
regards to the notes I gave for the prior patch, so I can't exactly give an example here.
> tests/intel/xe_eudebug_online.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/tests/intel/xe_eudebug_online.c b/tests/intel/xe_eudebug_online.c
> index 0ef0d8093..514c59f8a 100644
> --- a/tests/intel/xe_eudebug_online.c
> +++ b/tests/intel/xe_eudebug_online.c
> @@ -1118,7 +1118,9 @@ static bool intel_gen_has_lockstep_eus(int fd)
>
> static int query_attention_bitmask_size(int fd, int gt)
> {
> - const unsigned int threads = 8;
> + uint32_t thread_count_len;
> + uint32_t* thread_count_ptr;
> + uint32_t thread_count;
> struct drm_xe_query_topology_mask *c_dss = NULL, *g_dss = NULL, *eu_per_dss = NULL;
> struct drm_xe_query_topology_mask *topology;
> struct drm_xe_device_query query = {
> @@ -1130,6 +1132,10 @@ static int query_attention_bitmask_size(int fd, int gt)
> int pos = 0, eus;
> uint8_t *any_dss;
>
> + thread_count_ptr = xe_hwconfig_lookup_value(fd, INTEL_HWCONFIG_NUM_THREADS_PER_EU, &thread_count_len);
My notes for here depend on how the prior patch is changed.
If you decide to commit fully to the suggested changes in the prior patch,
then instead of looking up the full value here, you'd want to grab the
xe_device using xe_device_get, read the value from the hwconfig attribute,
then free the xe_device using xe_device_free at the end of the test.
On the other hand, if the prior patch remains relatively unchanged, then at the
very least this function may need to be broken up into multiple lines, as it
presently exceeds the soft cap of 100 characters per line.
Something like this should barely skirt under the limit:
"""
thread_count_ptr = xe_hwconfig_lookup_value(fd, INTEL_HWCONFIG_NUM_THREADS_PER_EU,
&thread_count_len);
"""
Though, the white space may need to be fixed when copying over to
the IGT suite proper.
-Jonathan Cavitt
> + igt_assert(thread_count_ptr);
> + thread_count = *thread_count_ptr;
> +
> igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0);
> igt_assert_neq(query.size, 0);
>
> @@ -1178,8 +1184,9 @@ static int query_attention_bitmask_size(int fd, int gt)
>
> free(any_dss);
> free(topology);
> + free(thread_count_ptr);
>
> - return eus * threads / 8;
> + return eus * DIV_ROUND_UP(thread_count, 8);
> }
>
> static struct drm_xe_eudebug_event_exec_queue *
> --
> 2.34.1
>
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
>
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
>
>
More information about the igt-dev
mailing list