diff mbox series

[i-g-t,v3,09/11] tests/i915/module_load: update for discrete

Message ID 20210730085348.2326899-9-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series [i-g-t,v3,01/11] lib/i915/gem_mman: add FIXED mmap mode | expand

Commit Message

Matthew Auld July 30, 2021, 8:53 a.m. UTC
The set_caching ioctl is gone for discrete, and now just returns
-ENODEV. Update the gem_sanitycheck to account for that. After this we
should be back to just having the breakage caused by missing reloc
support for the reload testcase.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ramalingam C <ramalingam.c@intel.com>
---
 tests/i915/i915_module_load.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Dixit, Ashutosh Aug. 2, 2021, 6:25 a.m. UTC | #1
On Fri, 30 Jul 2021 01:53:46 -0700, Matthew Auld wrote:
>
> The set_caching ioctl is gone for discrete, and now just returns
> -ENODEV. Update the gem_sanitycheck to account for that. After this we
> should be back to just having the breakage caused by missing reloc
> support for the reload testcase.
>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ramalingam C <ramalingam.c@intel.com>
> ---
>  tests/i915/i915_module_load.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/tests/i915/i915_module_load.c b/tests/i915/i915_module_load.c
> index 98ceb5d8..4b42fe3e 100644
> --- a/tests/i915/i915_module_load.c
> +++ b/tests/i915/i915_module_load.c
> @@ -172,17 +172,22 @@ static void gem_sanitycheck(void)
>  {
>	struct drm_i915_gem_caching args = {};
>	int i915 = __drm_open_driver(DRIVER_INTEL);
> +	int expected;

If we want to reduce a couple of line of code this is:

int expected = gem_has_lmem(i915) ? -ENODEV : -ENOENT;

Otherwise this is:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

>	int err;
>
> +	expected = -ENOENT;
> +	if (gem_has_lmem(i915))
> +		expected = -ENODEV;
> +
>	err = 0;
>	if (ioctl(i915, DRM_IOCTL_I915_GEM_SET_CACHING, &args))
>		err = -errno;
> -	if (err == -ENOENT)
> +	if (err == expected)
>		store_all(i915);
>	errno = 0;
>
>	close(i915);
> -	igt_assert_eq(err, -ENOENT);
> +	igt_assert_eq(err, expected);
>  }
>
>  static void
> --
> 2.26.3
>
diff mbox series

Patch

diff --git a/tests/i915/i915_module_load.c b/tests/i915/i915_module_load.c
index 98ceb5d8..4b42fe3e 100644
--- a/tests/i915/i915_module_load.c
+++ b/tests/i915/i915_module_load.c
@@ -172,17 +172,22 @@  static void gem_sanitycheck(void)
 {
 	struct drm_i915_gem_caching args = {};
 	int i915 = __drm_open_driver(DRIVER_INTEL);
+	int expected;
 	int err;
 
+	expected = -ENOENT;
+	if (gem_has_lmem(i915))
+		expected = -ENODEV;
+
 	err = 0;
 	if (ioctl(i915, DRM_IOCTL_I915_GEM_SET_CACHING, &args))
 		err = -errno;
-	if (err == -ENOENT)
+	if (err == expected)
 		store_all(i915);
 	errno = 0;
 
 	close(i915);
-	igt_assert_eq(err, -ENOENT);
+	igt_assert_eq(err, expected);
 }
 
 static void