[PATCH i-g-t v2 56/66] tests/xe_eudebug_online: Add reset-with-attention test
Piatkowski, Dominik Karol
dominik.karol.piatkowski at intel.com
Mon Aug 5 06:46:16 UTC 2024
With typo fixed:
Reviewed-by: Dominik Karol Piątkowski <dominik.karol.piatkowski at intel.com>
> -----Original Message-----
> From: Manszewski, Christoph <christoph.manszewski at intel.com>
> Sent: Tuesday, July 30, 2024 1:45 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Kempczynski, Zbigniew <zbigniew.kempczynski at intel.com>; Kamil
> Konieczny <kamil.konieczny at linux.intel.com>; Grzegorzek, Dominik
> <dominik.grzegorzek at intel.com>; Patelczyk, Maciej
> <maciej.patelczyk at intel.com>; Piatkowski, Dominik Karol
> <dominik.karol.piatkowski at intel.com>; Sikora, Pawel
> <pawel.sikora at intel.com>; Hajda, Andrzej <andrzej.hajda at intel.com>;
> Kolanupaka Naveena <kolanupaka.naveena at intel.com>; Kuoppala, Mika
> <mika.kuoppala at intel.com>; Mun, Gwan-gyeong <gwan-
> gyeong.mun at intel.com>
> Subject: [PATCH i-g-t v2 56/66] tests/xe_eudebug_online: Add reset-with-
> attention test
>
> From: Pawel Sikora <pawel.sikora at intel.com>
>
> This new test performs a GPU GT forced reset on the attention event raised.
> Then the test runs a new session with a workload to check if the GPU is usable.
>
> Signed-off-by: Pawel Sikora <pawel.sikora at intel.com>
> Cc: Christoph Manszewski <christoph.manszewski at intel.com>
> ---
> tests/intel/xe_eudebug_online.c | 58
> +++++++++++++++++++++++++++++++++
> 1 file changed, 58 insertions(+)
>
> diff --git a/tests/intel/xe_eudebug_online.c b/tests/intel/xe_eudebug_online.c
> index 0b92507f4..c101bde2f 100644
> --- a/tests/intel/xe_eudebug_online.c
> +++ b/tests/intel/xe_eudebug_online.c
> @@ -322,6 +322,25 @@ static void eu_attention_debug_trigger(struct
> xe_eudebug_debugger *d,
>
> }
>
> +static void eu_attention_reset_trigger(struct xe_eudebug_debugger *d,
> + struct drm_xe_eudebug_event *e)
> +{
> + struct drm_xe_eudebug_event_eu_attention *att = (void *) e;
> + uint32_t *ptr = (uint32_t *) att->bitmask;
> + struct online_debug_data *data = d->ptr;
> +
> + igt_debug("EVENT[%llu] eu-attenttion with reset; threads=%d "
Typo: attention
> + "client[%llu], exec_queue[%llu], lrc[%llu],
> bitmask_size[%d]\n",
> + att->base.seqno, count_set_bits(att->bitmask, att-
> >bitmask_size),
> + att->client_handle, att->exec_queue_handle,
> + att->lrc_handle, att->bitmask_size);
> +
> + for (uint32_t i = 0; i < att->bitmask_size/4; i += 2)
> + igt_debug("bitmask[%d] = 0x%08x%08x\n", i/2, ptr[i],
> ptr[i+1]);
> +
> + xe_force_gt_reset_async(d->master_fd, data->hwe.gt_id); }
> +
> static void copy_first_bit(uint8_t *dst, uint8_t *src, int size) {
> bool found = false;
> @@ -923,6 +942,42 @@ static void test_basic_online(int fd, struct
> drm_xe_engine_class_instance *hwe,
> online_debug_data_destroy(data);
> }
>
> +/**
> + * SUBTEST: reset-with-attention
> + * Description:
> + * Check whether GPU is usable after resetting with attention raised
> + * (stopped on breakpoint) by running the same workload again.
> + */
> +static void test_reset_with_attention_online(int fd, struct
> +drm_xe_engine_class_instance *hwe, int flags) {
> + struct xe_eudebug_session *s1, *s2;
> + struct online_debug_data *data;
> +
> + data = online_debug_data_create(hwe);
> + s1 = xe_eudebug_session_create(fd, run_online_client, flags, data);
> +
> + xe_eudebug_debugger_add_trigger(s1->d,
> DRM_XE_EUDEBUG_EVENT_EU_ATTENTION,
> + eu_attention_reset_trigger);
> + xe_eudebug_debugger_add_trigger(s1->d,
> DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE,
> + ufence_ack_trigger);
> +
> + xe_eudebug_session_run(s1);
> + xe_eudebug_session_destroy(s1);
> +
> + s2 = xe_eudebug_session_create(fd, run_online_client, flags, data);
> + xe_eudebug_debugger_add_trigger(s2->d,
> DRM_XE_EUDEBUG_EVENT_EU_ATTENTION,
> + eu_attention_resume_trigger);
> + xe_eudebug_debugger_add_trigger(s2->d,
> DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE,
> + ufence_ack_trigger);
> +
> + xe_eudebug_session_run(s2);
> +
> + online_session_check(s2, s2->flags);
> +
> + xe_eudebug_session_destroy(s2);
> + online_debug_data_destroy(data);
> +}
> +
> /**
> * SUBTEST: interrupt-all
> * Description:
> @@ -1162,6 +1217,9 @@ igt_main
> test_gt_render_or_compute("tdctl-parameters", fd, hwe)
> test_tdctl_parameters(fd, hwe, SHADER_LOOP);
>
> + test_gt_render_or_compute("reset-with-attention", fd, hwe)
> + test_reset_with_attention_online(fd, hwe,
> SHADER_BREAKPOINT);
> +
> igt_fixture {
> xe_eudebug_enable(fd, was_enabled);
>
> --
> 2.34.1
More information about the igt-dev
mailing list