]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/tests/pci: Check dma_mask_size, va_bits and vm_max_level
authorGustavo Sousa <gustavo.sousa@intel.com>
Mon, 20 Oct 2025 23:45:57 +0000 (20:45 -0300)
committerGustavo Sousa <gustavo.sousa@intel.com>
Wed, 22 Oct 2025 12:49:29 +0000 (09:49 -0300)
Members dma_mask_size, va_bits and vm_max_level of struct xe_device_desc
are all expected to be non-zero.  Add checks for that in
check_platform_desc().

Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20251020-xe-kunit-dma_mask_size-va_bits-vm_max_level-v2-2-27b03971bc7e@intel.com
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
drivers/gpu/drm/xe/tests/xe_pci_test.c

index 4ba2fb93c9ded31df5563aae8fea8baca6ab4eab..4d10a7e2b5707bcd37610baf5716c51504834b10 100644 (file)
@@ -50,8 +50,15 @@ static void check_platform_desc(struct kunit *test)
        const struct xe_device_desc *desc =
                (const struct xe_device_desc *)pci->driver_data;
 
+       KUNIT_EXPECT_GT(test, desc->dma_mask_size, 0);
+
        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);
+
+       KUNIT_EXPECT_GT(test, desc->va_bits, 0);
+       KUNIT_EXPECT_LE(test, desc->va_bits, 64);
+
+       KUNIT_EXPECT_GT(test, desc->vm_max_level, 0);
 }
 
 static struct kunit_case xe_pci_tests[] = {