[PATCH v2 4/7] drm/xe/tests: Convert xe_dma_buf live tests

Cavitt, Jonathan jonathan.cavitt at intel.com
Wed Jul 17 20:17:23 UTC 2024


-----Original Message-----
From: Intel-xe <intel-xe-bounces at lists.freedesktop.org> On Behalf Of Michal Wajdeczko
Sent: Wednesday, July 17, 2024 12:52 PM
To: intel-xe at lists.freedesktop.org
Cc: Wajdeczko, Michal <Michal.Wajdeczko at intel.com>
Subject: [PATCH v2 4/7] drm/xe/tests: Convert xe_dma_buf live tests
> 
> Convert xe_dma_buf live tests to parameterized style.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>

Just read this after the third patch.  I wonder if it wouldn't be better
to perform this parameterization on all unparameterized tests in the
same patch?  There's probably some benefit to keeping them
separate, just in case one set of tests needs to get reverted back to
the old style, though, so no blocks from me here.

Reviewed-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
-Jonathan Cavitt

> ---
>  drivers/gpu/drm/xe/tests/xe_dma_buf.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/tests/xe_dma_buf.c b/drivers/gpu/drm/xe/tests/xe_dma_buf.c
> index 4f9dc41e13de..c24c8509227e 100644
> --- a/drivers/gpu/drm/xe/tests/xe_dma_buf.c
> +++ b/drivers/gpu/drm/xe/tests/xe_dma_buf.c
> @@ -8,6 +8,7 @@
>  #include <kunit/test.h>
>  #include <kunit/visibility.h>
>  
> +#include "tests/xe_kunit_helpers.h"
>  #include "tests/xe_pci_test.h"
>  
>  #include "xe_pci.h"
> @@ -275,11 +276,13 @@ static int dma_buf_run_device(struct xe_device *xe)
>  
>  static void xe_dma_buf_kunit(struct kunit *test)
>  {
> -	xe_call_for_each_device(dma_buf_run_device);
> +	struct xe_device *xe = test->priv;
> +
> +	dma_buf_run_device(xe);
>  }
>  
>  static struct kunit_case xe_dma_buf_tests[] = {
> -	KUNIT_CASE(xe_dma_buf_kunit),
> +	KUNIT_CASE_PARAM(xe_dma_buf_kunit, xe_pci_live_device_gen_param),
>  	{}
>  };
>  
> @@ -287,5 +290,6 @@ VISIBLE_IF_KUNIT
>  struct kunit_suite xe_dma_buf_test_suite = {
>  	.name = "xe_dma_buf",
>  	.test_cases = xe_dma_buf_tests,
> +	.init = xe_kunit_helper_xe_device_live_test_init,
>  };
>  EXPORT_SYMBOL_IF_KUNIT(xe_dma_buf_test_suite);
> -- 
> 2.43.0
> 
> 


More information about the Intel-xe mailing list