All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2] Add support for forcing a specific driver
@ 2018-08-22 10:20 ` Petri Latvala
  0 siblings, 0 replies; 6+ messages in thread
From: Petri Latvala @ 2018-08-22 10:20 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Rodrigo Siqueira

This commit adds a new option for forcing the use of a specific driver
indicated via an environment variable.

v2 (Petri):
 - Use an environment variable instead of command line
 - Refactor the loop in __open_device
 - Don't try to load kernel modules

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: gustavo@padovan.org
---

Did the changes I suggested myself to see what else is lurking
there. I'm still unsure whether using IGT_FORCE_DRIVER=something
should still accept opening e.g. an i915 device with DRIVER_INTEL,
currently this does. Both ways have their merits.

I was able to test vkms with this patch, revealing some amount of
intelisms still lurking.


 lib/drmtest.c  | 35 +++++++++++++++++++++++++++++++++++
 lib/drmtest.h  |  2 ++
 lib/igt_core.c |  5 +++++
 3 files changed, 42 insertions(+)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index fae6f86f..e8308b0d 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -146,6 +146,31 @@ static bool has_known_intel_chipset(int fd)
 	return true;
 }
 
+static char _forced_driver[5] = "";
+
+/**
+ * __set_forced_driver:
+ * @name: name of driver to forcibly use
+ *
+ * Set the name of a driver to use when calling #drm_open_driver with
+ * the #DRIVER_ANY flag.
+ */
+void __set_forced_driver(const char *name)
+{
+	if (!name)
+		igt_warn("No driver specified, keep default behaviour");
+
+	strncpy(_forced_driver, name, 4);
+}
+
+static const char *forced_driver(void)
+{
+	if (_forced_driver[0])
+		return _forced_driver;
+
+	return NULL;
+}
+
 #define LOCAL_I915_EXEC_VEBOX	(4 << 0)
 /**
  * gem_quiescent_gpu:
@@ -229,6 +254,16 @@ static int __open_device(const char *base, int offset, unsigned int chipset)
 		if (fd == -1)
 			continue;
 
+		// Force options
+		if (chipset == DRIVER_ANY && forced_driver()) {
+			if (__is_device(fd, forced_driver())) {
+				igt_debug("Force option used: Using driver %s\n", forced_driver());
+				return fd;
+			}
+
+			continue;
+		}
+
 		if (chipset & DRIVER_INTEL && is_i915_device(fd) &&
 		    has_known_intel_chipset(fd))
 			return fd;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 949865ee..62f53ec3 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -51,6 +51,8 @@
  */
 #define DRIVER_ANY 	~(DRIVER_VGEM)
 
+void __set_forced_driver(const char *name);
+
 /**
  * ARRAY_SIZE:
  * @arr: static array
diff --git a/lib/igt_core.c b/lib/igt_core.c
index c52c0818..c17e53c5 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -646,6 +646,11 @@ static void common_init_env(void)
 	igt_frame_dump_path = getenv("IGT_FRAME_DUMP_PATH");
 
 	stderr_needs_sentinel = getenv("IGT_SENTINEL_ON_STDERR") != NULL;
+
+	env = getenv("IGT_FORCE_DRIVER");
+	if (env) {
+		__set_forced_driver(env);
+	}
 }
 
 static int common_init(int *argc, char **argv,
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] [PATCH i-g-t v2] Add support for forcing a specific driver
@ 2018-08-22 10:20 ` Petri Latvala
  0 siblings, 0 replies; 6+ messages in thread
From: Petri Latvala @ 2018-08-22 10:20 UTC (permalink / raw)
  To: igt-dev; +Cc: gustavo, intel-gfx, Rodrigo Siqueira

This commit adds a new option for forcing the use of a specific driver
indicated via an environment variable.

v2 (Petri):
 - Use an environment variable instead of command line
 - Refactor the loop in __open_device
 - Don't try to load kernel modules

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: gustavo@padovan.org
---

Did the changes I suggested myself to see what else is lurking
there. I'm still unsure whether using IGT_FORCE_DRIVER=something
should still accept opening e.g. an i915 device with DRIVER_INTEL,
currently this does. Both ways have their merits.

I was able to test vkms with this patch, revealing some amount of
intelisms still lurking.


 lib/drmtest.c  | 35 +++++++++++++++++++++++++++++++++++
 lib/drmtest.h  |  2 ++
 lib/igt_core.c |  5 +++++
 3 files changed, 42 insertions(+)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index fae6f86f..e8308b0d 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -146,6 +146,31 @@ static bool has_known_intel_chipset(int fd)
 	return true;
 }
 
+static char _forced_driver[5] = "";
+
+/**
+ * __set_forced_driver:
+ * @name: name of driver to forcibly use
+ *
+ * Set the name of a driver to use when calling #drm_open_driver with
+ * the #DRIVER_ANY flag.
+ */
+void __set_forced_driver(const char *name)
+{
+	if (!name)
+		igt_warn("No driver specified, keep default behaviour");
+
+	strncpy(_forced_driver, name, 4);
+}
+
+static const char *forced_driver(void)
+{
+	if (_forced_driver[0])
+		return _forced_driver;
+
+	return NULL;
+}
+
 #define LOCAL_I915_EXEC_VEBOX	(4 << 0)
 /**
  * gem_quiescent_gpu:
@@ -229,6 +254,16 @@ static int __open_device(const char *base, int offset, unsigned int chipset)
 		if (fd == -1)
 			continue;
 
+		// Force options
+		if (chipset == DRIVER_ANY && forced_driver()) {
+			if (__is_device(fd, forced_driver())) {
+				igt_debug("Force option used: Using driver %s\n", forced_driver());
+				return fd;
+			}
+
+			continue;
+		}
+
 		if (chipset & DRIVER_INTEL && is_i915_device(fd) &&
 		    has_known_intel_chipset(fd))
 			return fd;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 949865ee..62f53ec3 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -51,6 +51,8 @@
  */
 #define DRIVER_ANY 	~(DRIVER_VGEM)
 
+void __set_forced_driver(const char *name);
+
 /**
  * ARRAY_SIZE:
  * @arr: static array
diff --git a/lib/igt_core.c b/lib/igt_core.c
index c52c0818..c17e53c5 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -646,6 +646,11 @@ static void common_init_env(void)
 	igt_frame_dump_path = getenv("IGT_FRAME_DUMP_PATH");
 
 	stderr_needs_sentinel = getenv("IGT_SENTINEL_ON_STDERR") != NULL;
+
+	env = getenv("IGT_FORCE_DRIVER");
+	if (env) {
+		__set_forced_driver(env);
+	}
 }
 
 static int common_init(int *argc, char **argv,
-- 
2.14.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Add support for forcing a specific driver
  2018-08-22 10:20 ` [igt-dev] " Petri Latvala
  (?)
@ 2018-08-22 10:51 ` Patchwork
  -1 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-08-22 10:51 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Add support for forcing a specific driver
URL   : https://patchwork.freedesktop.org/series/48548/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4693 -> IGTPW_1736 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/48548/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1736 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_coherency:
      fi-gdg-551:         PASS -> DMESG-FAIL (fdo#107164)

    igt@drv_selftest@live_hangcheck:
      fi-skl-guc:         PASS -> DMESG-FAIL (fdo#107174)

    igt@gem_exec_suspend@basic-s3:
      {fi-kbl-soraka}:    NOTRUN -> INCOMPLETE (fdo#107556)

    igt@kms_chamelium@dp-edid-read:
      fi-kbl-7500u:       PASS -> FAIL (fdo#103841)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      {fi-byt-clapper}:   PASS -> FAIL (fdo#103191, fdo#107362)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-bxt-dsi:         PASS -> INCOMPLETE (fdo#103927)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_hangcheck:
      fi-kbl-7560u:       DMESG-FAIL (fdo#106947, fdo#106560) -> PASS

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
      {fi-byt-clapper}:   FAIL (fdo#103191, fdo#107362) -> PASS

    igt@pm_rpm@basic-pci-d3-state:
      fi-skl-6600u:       FAIL -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
  fdo#107164 https://bugs.freedesktop.org/show_bug.cgi?id=107164
  fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556


== Participating hosts (53 -> 48) ==

  Additional (1): fi-kbl-soraka 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus 


== Build changes ==

    * IGT: IGT_4607 -> IGTPW_1736

  CI_DRM_4693: f22275363ffa04dbd719032810154e857110cd75 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1736: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1736/
  IGT_4607: 6e0b3e7a2d241af36f8c6b1cc335aa1db3532d29 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1736/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for Add support for forcing a specific driver
  2018-08-22 10:20 ` [igt-dev] " Petri Latvala
  (?)
  (?)
@ 2018-08-22 12:02 ` Patchwork
  -1 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-08-22 12:02 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: Add support for forcing a specific driver
URL   : https://patchwork.freedesktop.org/series/48548/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4607_full -> IGTPW_1736_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1736_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1736_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/48548/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1736_full:

  === IGT changes ===

    ==== Warnings ====

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
      shard-snb:          PASS -> SKIP

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS

    
== Known issues ==

  Here are the changes found in IGTPW_1736_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_await@wide-contexts:
      shard-apl:          PASS -> FAIL (fdo#100007)

    igt@gem_wait@write-busy-blt:
      shard-snb:          NOTRUN -> INCOMPLETE (fdo#105411)

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#105363)

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-snb:          PASS -> FAIL (fdo#107161)

    igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665, fdo#107556)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    igt@perf_pmu@rc6-runtime-pm-long:
      shard-glk:          NOTRUN -> FAIL (fdo#105010)

    
    ==== Possible fixes ====

    igt@drv_suspend@debugfs-reader:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS +1

    igt@drv_suspend@fence-restore-tiled2untiled:
      shard-kbl:          DMESG-WARN (fdo#103313) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#106023) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-wc:
      shard-glk:          FAIL (fdo#103167) -> PASS

    
  fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#105010 https://bugs.freedesktop.org/show_bug.cgi?id=105010
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#107161 https://bugs.freedesktop.org/show_bug.cgi?id=107161
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4607 -> IGTPW_1736
    * Linux: CI_DRM_4690 -> CI_DRM_4693

  CI_DRM_4690: 5b8042159e2b05425c098868ed6fac9518ee638d @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4693: f22275363ffa04dbd719032810154e857110cd75 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1736: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1736/
  IGT_4607: 6e0b3e7a2d241af36f8c6b1cc335aa1db3532d29 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1736/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] Add support for forcing a specific driver
  2018-08-22 10:20 ` [igt-dev] " Petri Latvala
@ 2018-12-17 15:47   ` Daniel Vetter
  -1 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2018-12-17 15:47 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev, gustavo, intel-gfx, Rodrigo Siqueira

On Wed, Aug 22, 2018 at 01:20:38PM +0300, Petri Latvala wrote:
> This commit adds a new option for forcing the use of a specific driver
> indicated via an environment variable.
> 
> v2 (Petri):
>  - Use an environment variable instead of command line
>  - Refactor the loop in __open_device
>  - Don't try to load kernel modules
> 
> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> Cc: gustavo@padovan.org
> ---
> 
> Did the changes I suggested myself to see what else is lurking
> there. I'm still unsure whether using IGT_FORCE_DRIVER=something
> should still accept opening e.g. an i915 device with DRIVER_INTEL,
> currently this does. Both ways have their merits.
> 
> I was able to test vkms with this patch, revealing some amount of
> intelisms still lurking.
> 
> 
>  lib/drmtest.c  | 35 +++++++++++++++++++++++++++++++++++
>  lib/drmtest.h  |  2 ++
>  lib/igt_core.c |  5 +++++
>  3 files changed, 42 insertions(+)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index fae6f86f..e8308b0d 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -146,6 +146,31 @@ static bool has_known_intel_chipset(int fd)
>  	return true;
>  }
>  
> +static char _forced_driver[5] = "";
> +
> +/**
> + * __set_forced_driver:
> + * @name: name of driver to forcibly use
> + *
> + * Set the name of a driver to use when calling #drm_open_driver with
> + * the #DRIVER_ANY flag.
> + */
> +void __set_forced_driver(const char *name)
> +{
> +	if (!name)
> +		igt_warn("No driver specified, keep default behaviour");
> +
> +	strncpy(_forced_driver, name, 4);
> +}
> +
> +static const char *forced_driver(void)
> +{
> +	if (_forced_driver[0])
> +		return _forced_driver;
> +
> +	return NULL;
> +}
> +
>  #define LOCAL_I915_EXEC_VEBOX	(4 << 0)
>  /**
>   * gem_quiescent_gpu:
> @@ -229,6 +254,16 @@ static int __open_device(const char *base, int offset, unsigned int chipset)
>  		if (fd == -1)
>  			continue;
>  
> +		// Force options

I'd drop that comment. With that

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I think what this tries to solve here, and what Chris tries to solve in
his other reply on

https://patchwork.freedesktop.org/patch/247451/

are different issues. We want something to run generic DRIVER_ANY tests on
a specific driver. That's somewhat orthogonal to selecting a specific
device imo, and I think we need both. We definitely don't want to move to
DRIVER_X from DRIVER_ANY for the generic kms tests. Maybe we should rename
DRIVER_ANY to DRIVER_KMS ... (and double-check it supports modesetting).
-Daniel

> +		if (chipset == DRIVER_ANY && forced_driver()) {
> +			if (__is_device(fd, forced_driver())) {
> +				igt_debug("Force option used: Using driver %s\n", forced_driver());
> +				return fd;
> +			}
> +
> +			continue;
> +		}
> +
>  		if (chipset & DRIVER_INTEL && is_i915_device(fd) &&
>  		    has_known_intel_chipset(fd))
>  			return fd;
> diff --git a/lib/drmtest.h b/lib/drmtest.h
> index 949865ee..62f53ec3 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -51,6 +51,8 @@
>   */
>  #define DRIVER_ANY 	~(DRIVER_VGEM)
>  
> +void __set_forced_driver(const char *name);
> +
>  /**
>   * ARRAY_SIZE:
>   * @arr: static array
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index c52c0818..c17e53c5 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -646,6 +646,11 @@ static void common_init_env(void)
>  	igt_frame_dump_path = getenv("IGT_FRAME_DUMP_PATH");
>  
>  	stderr_needs_sentinel = getenv("IGT_SENTINEL_ON_STDERR") != NULL;
> +
> +	env = getenv("IGT_FORCE_DRIVER");
> +	if (env) {
> +		__set_forced_driver(env);
> +	}
>  }
>  
>  static int common_init(int *argc, char **argv,
> -- 
> 2.14.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] Add support for forcing a specific driver
@ 2018-12-17 15:47   ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2018-12-17 15:47 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev, gustavo, intel-gfx, Rodrigo Siqueira

On Wed, Aug 22, 2018 at 01:20:38PM +0300, Petri Latvala wrote:
> This commit adds a new option for forcing the use of a specific driver
> indicated via an environment variable.
> 
> v2 (Petri):
>  - Use an environment variable instead of command line
>  - Refactor the loop in __open_device
>  - Don't try to load kernel modules
> 
> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> Cc: gustavo@padovan.org
> ---
> 
> Did the changes I suggested myself to see what else is lurking
> there. I'm still unsure whether using IGT_FORCE_DRIVER=something
> should still accept opening e.g. an i915 device with DRIVER_INTEL,
> currently this does. Both ways have their merits.
> 
> I was able to test vkms with this patch, revealing some amount of
> intelisms still lurking.
> 
> 
>  lib/drmtest.c  | 35 +++++++++++++++++++++++++++++++++++
>  lib/drmtest.h  |  2 ++
>  lib/igt_core.c |  5 +++++
>  3 files changed, 42 insertions(+)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index fae6f86f..e8308b0d 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -146,6 +146,31 @@ static bool has_known_intel_chipset(int fd)
>  	return true;
>  }
>  
> +static char _forced_driver[5] = "";
> +
> +/**
> + * __set_forced_driver:
> + * @name: name of driver to forcibly use
> + *
> + * Set the name of a driver to use when calling #drm_open_driver with
> + * the #DRIVER_ANY flag.
> + */
> +void __set_forced_driver(const char *name)
> +{
> +	if (!name)
> +		igt_warn("No driver specified, keep default behaviour");
> +
> +	strncpy(_forced_driver, name, 4);
> +}
> +
> +static const char *forced_driver(void)
> +{
> +	if (_forced_driver[0])
> +		return _forced_driver;
> +
> +	return NULL;
> +}
> +
>  #define LOCAL_I915_EXEC_VEBOX	(4 << 0)
>  /**
>   * gem_quiescent_gpu:
> @@ -229,6 +254,16 @@ static int __open_device(const char *base, int offset, unsigned int chipset)
>  		if (fd == -1)
>  			continue;
>  
> +		// Force options

I'd drop that comment. With that

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I think what this tries to solve here, and what Chris tries to solve in
his other reply on

https://patchwork.freedesktop.org/patch/247451/

are different issues. We want something to run generic DRIVER_ANY tests on
a specific driver. That's somewhat orthogonal to selecting a specific
device imo, and I think we need both. We definitely don't want to move to
DRIVER_X from DRIVER_ANY for the generic kms tests. Maybe we should rename
DRIVER_ANY to DRIVER_KMS ... (and double-check it supports modesetting).
-Daniel

> +		if (chipset == DRIVER_ANY && forced_driver()) {
> +			if (__is_device(fd, forced_driver())) {
> +				igt_debug("Force option used: Using driver %s\n", forced_driver());
> +				return fd;
> +			}
> +
> +			continue;
> +		}
> +
>  		if (chipset & DRIVER_INTEL && is_i915_device(fd) &&
>  		    has_known_intel_chipset(fd))
>  			return fd;
> diff --git a/lib/drmtest.h b/lib/drmtest.h
> index 949865ee..62f53ec3 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -51,6 +51,8 @@
>   */
>  #define DRIVER_ANY 	~(DRIVER_VGEM)
>  
> +void __set_forced_driver(const char *name);
> +
>  /**
>   * ARRAY_SIZE:
>   * @arr: static array
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index c52c0818..c17e53c5 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -646,6 +646,11 @@ static void common_init_env(void)
>  	igt_frame_dump_path = getenv("IGT_FRAME_DUMP_PATH");
>  
>  	stderr_needs_sentinel = getenv("IGT_SENTINEL_ON_STDERR") != NULL;
> +
> +	env = getenv("IGT_FORCE_DRIVER");
> +	if (env) {
> +		__set_forced_driver(env);
> +	}
>  }
>  
>  static int common_init(int *argc, char **argv,
> -- 
> 2.14.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-17 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 10:20 [PATCH i-g-t v2] Add support for forcing a specific driver Petri Latvala
2018-08-22 10:20 ` [igt-dev] " Petri Latvala
2018-08-22 10:51 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-08-22 12:02 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-12-17 15:47 ` [igt-dev] [PATCH i-g-t v2] " Daniel Vetter
2018-12-17 15:47   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.