Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: Matt Roper <matthew.d.roper@intel.com>,
	Michal Wajdeczko <michal.wajdeczko@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH v2 1/2] drm/xe/tests/pci: Convert GT count check to general device check
Date: Mon, 20 Oct 2025 20:57:44 -0300	[thread overview]
Message-ID: <176100466430.3231.16362806979991981230@intel.com> (raw)
In-Reply-To: <20251020-xe-kunit-dma_mask_size-va_bits-vm_max_level-v2-1-27b03971bc7e@intel.com>

Quoting Gustavo Sousa (2025-10-20 20:45:56-03:00)
>We already have check_graphics_ip() and check_media_ip() as general
>functions to check the IP descriptors.  The check in
>check_platform_gt_count() is simple enough such that we can convert the
>function to a more general device check.  In an upcoming change, we will
>also add some checks for other members of struct xe_device_desc. As
>such, rename check_platform_gt_count() to check_platform_desc().
>
>While at it, use inline (unsigned int) casting of max_gt_per_tile to
>keep checks for each member localized; and use KUNIT_EXPECT_*() variants
>of the macros to allow multiple issues to be reported.
>
>v2:
>  - Use (int) instead of (unsigned int) casting. (Michal)

Whoops. It's actually the other way around.  I'll fix it when applying.

>  - Use KUNIT_EXPECT_*() instead of UNIT_ASSERT_*() macros. (Michal)
>
>Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
>---
> drivers/gpu/drm/xe/tests/xe_pci_test.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/tests/xe_pci_test.c b/drivers/gpu/drm/xe/tests/xe_pci_test.c
>index 37b344df2dc3..4ba2fb93c9de 100644
>--- a/drivers/gpu/drm/xe/tests/xe_pci_test.c
>+++ b/drivers/gpu/drm/xe/tests/xe_pci_test.c
>@@ -44,21 +44,20 @@ static void check_media_ip(struct kunit *test)
>         KUNIT_ASSERT_EQ(test, mask, 0);
> }
> 
>-static void check_platform_gt_count(struct kunit *test)
>+static void check_platform_desc(struct kunit *test)
> {
>         const struct pci_device_id *pci = test->param_value;
>         const struct xe_device_desc *desc =
>                 (const struct xe_device_desc *)pci->driver_data;
>-        int max_gt = desc->max_gt_per_tile;
> 
>-        KUNIT_ASSERT_GT(test, max_gt, 0);
>-        KUNIT_ASSERT_LE(test, max_gt, XE_MAX_GT_PER_TILE);
>+        KUNIT_EXPECT_GT(test, (unsigned int)desc->max_gt_per_tile, 0);
>+        KUNIT_EXPECT_LE(test, (unsigned int)desc->max_gt_per_tile, XE_MAX_GT_PER_TILE);
> }
> 
> static struct kunit_case xe_pci_tests[] = {
>         KUNIT_CASE_PARAM(check_graphics_ip, xe_pci_graphics_ip_gen_param),
>         KUNIT_CASE_PARAM(check_media_ip, xe_pci_media_ip_gen_param),
>-        KUNIT_CASE_PARAM(check_platform_gt_count, xe_pci_id_gen_param),
>+        KUNIT_CASE_PARAM(check_platform_desc, xe_pci_id_gen_param),
>         {}
> };
> 
>
>-- 
>2.51.0
>

  reply	other threads:[~2025-10-21  0:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20 23:45 [PATCH v2 0/2] drm/xe: Add kunit checks for dma_mask_size, va_bits and vm_max_level Gustavo Sousa
2025-10-20 23:45 ` [PATCH v2 1/2] drm/xe/tests/pci: Convert GT count check to general device check Gustavo Sousa
2025-10-20 23:57   ` Gustavo Sousa [this message]
2025-10-21  2:07     ` Lucas De Marchi
2025-10-22 13:31       ` Gustavo Sousa
2025-10-20 23:45 ` [PATCH v2 2/2] drm/xe/tests/pci: Check dma_mask_size, va_bits and vm_max_level Gustavo Sousa
2025-10-21  2:09   ` Lucas De Marchi
2025-10-21 12:52 ` ✓ CI.KUnit: success for drm/xe: Add kunit checks for dma_mask_size, va_bits and vm_max_level (rev2) Patchwork
2025-10-21 13:44 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-21 14:58 ` ✗ Xe.CI.Full: failure " Patchwork
2025-10-22 12:42   ` Gustavo Sousa
2025-10-22 13:32 ` [PATCH v2 0/2] drm/xe: Add kunit checks for dma_mask_size, va_bits and vm_max_level Gustavo Sousa

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=176100466430.3231.16362806979991981230@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@intel.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