Add support for forcing a specific driver
PATCH v3 1/1 Add support for forcing a specific driver
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
v3 (Petri):
- Rebase and adjust to the driver loading changes
--- lib/drmtest.c | 32 ++++++++++++++++++++++++++++++++ lib/drmtest.h | 2 ++ lib/igt_core.c | 5 +++++ 3 files changed, 39 insertions(+)
lib/drmtest.c +32 -0
@@ -123,6 +123,31 @@ static bool has_known_intel_chipset(int fd)return true; } +static char _forced_driver[16 ] ="" ; + +/** +* __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\n" ); + +strncpy (_forced_driver, name,sizeof (_forced_driver) -1 ); +} + +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:
@@ -212,6 +237,7 @@ static const struct module {static int open_device (const char *name,unsigned int chipset) { +const char *forced;char dev_name[16 ] ="" ;int chip =DRIVER_ANY ;int fd;
@@ -223,6 +249,12 @@ static int open_device(const char *name, unsigned int chipset)if (__get_drm_device_name (fd, dev_name,sizeof (dev_name) -1 ) ==-1 ) goto err; + forced =forced_driver (); +if (forced && chipset ==DRIVER_ANY && !strcmp (forced, dev_name)) { +igt_debug ("Force option used: Using driver %s\n" , dev_name); +return fd; + } +for (int start =0 , end =ARRAY_SIZE (modules) -1 ; start < end; ){int mid = start + (end - start) /2 ;int ret =strcmp (modules[mid].module, dev_name);
lib/drmtest.h +2 -0
@@ -52,6 +52,8 @@*/ #define DRIVER_ANY ~(DRIVER_VGEM) +void __set_forced_driver (const char *name); +/** * ARRAY_SIZE: * @arr: static array
lib/igt_core.c +5 -0
@@ -647,6 +647,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,
Signature · 6 lines
2.19.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for Add support for forcing a specific driver (rev2)
== Series Details ==
== Series Details ==
Series: Add support for forcing a specific driver (rev2)
URL : https://patchwork.freedesktop.org/series/48548/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5327 -> IGTPW_2166
====================================================
Summary
-------
**WARNING**
Minor unknown changes coming with IGTPW_2166 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_2166, 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/2/mbox/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_2166:
### IGT changes ###
#### Warnings ####
* igt@kms_busy@basic-flip-a:
- fi-kbl-7567u: SKIP -> PASS +2
Known issues
------------
Here are the changes found in IGTPW_2166 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_create@basic-files:
- fi-bsw-kefka: PASS -> FAIL [fdo#108656]
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: PASS -> INCOMPLETE [fdo#107718]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
- fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362] +1
#### Possible fixes ####
* igt@i915_selftest@live_hangcheck:
- fi-bwr-2160: DMESG-FAIL [fdo#108735] -> PASS
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
- fi-byt-clapper: FAIL [fdo#107362] -> PASS
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108656]: https://bugs.freedesktop.org/show_bug.cgi?id=108656
[fdo#108735]: https://bugs.freedesktop.org/show_bug.cgi?id=108735
Participating hosts (51 -> 46)
------------------------------
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600
Build changes
-------------
* IGT: IGT_4749 -> IGTPW_2166
CI_DRM_5327: 2c09c998f9503f26757bcfd16aca1f2317eca4f4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2166: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2166/
IGT_4749: 270da20849db4d170db09673c6b67712c90ec9fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2166/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Hi,
I tested the feature and everything worked as expected.
Thanks
Quoted 112 lines · Petri Latvala
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 modulesv3 (Petri):
- Rebase and adjust to the driver loading changesSigned-off-by Rodrigo Siqueira <[email protected]>Signed-off-by Petri Latvala <[email protected]>Cc Daniel Vetter <[email protected]>Cc Arkadiusz Hiler <[email protected]>Reviewed-by Daniel Vetter <[email protected]> #v2--- lib/drmtest.c | 32 ++++++++++++++++++++++++++++++++ lib/drmtest.h | 2 ++ lib/igt_core.c | 5 +++++ 3 files changed, 39 insertions(+)lib/drmtest.c +32
-0@@ -123,6 +123,31 @@ static bool has_known_intel_chipset(int fd)return true; } +static char _forced_driver[16 ] ="" ; + +/** +* __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\n" ); + +strncpy (_forced_driver, name,sizeof (_forced_driver) -1 ); +} + +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: @@ -212,6 +237,7 @@ static const struct module {static int open_device (const char *name,unsigned int chipset) { +const char *forced;char dev_name[16 ] ="" ;int chip =DRIVER_ANY ;int fd;@@ -223,6 +249,12 @@ static int open_device(const char *name, unsigned int chipset)if (__get_drm_device_name (fd, dev_name,sizeof (dev_name) -1 ) ==-1 ) goto err; + forced =forced_driver (); +if (forced && chipset ==DRIVER_ANY && !strcmp (forced, dev_name)) { +igt_debug ("Force option used: Using driver %s\n" , dev_name); +return fd; + } +for (int start =0 , end =ARRAY_SIZE (modules) -1 ; start < end; ){int mid = start + (end - start) /2 ;int ret =strcmp (modules[mid].module, dev_name);lib/drmtest.h +2
-0@@ -52,6 +52,8 @@*/ #define DRIVER_ANY ~(DRIVER_VGEM) +void __set_forced_driver (const char *name); +/** * ARRAY_SIZE: * @arr: static array lib/igt_core.c +5
-0@@ -647,6 +647,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,Signature · 1 line
2.19.1
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for Add support for forcing a specific driver (rev2)
In reply to Petri Latvala== Series Details ==
== Series Details ==
Series: Add support for forcing a specific driver (rev2)
URL : https://patchwork.freedesktop.org/series/48548/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5327_full -> IGTPW_2166_full
====================================================
Summary
-------
**WARNING**
Minor unknown changes coming with IGTPW_2166_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_2166_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/2/mbox/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_2166_full:
### IGT changes ###
#### Warnings ####
* igt@pm_rc6_residency@rc6-accuracy:
- shard-snb: PASS -> SKIP
Known issues
------------
Here are the changes found in IGTPW_2166_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_sync@basic-store-each:
- shard-snb: NOTRUN -> INCOMPLETE [fdo#105411]
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-apl: NOTRUN -> DMESG-WARN [fdo#107956] +1
* igt@kms_cursor_crc@cursor-256x256-random:
- shard-glk: PASS -> FAIL [fdo#103232] +4
* igt@kms_cursor_crc@cursor-64x64-dpms:
- shard-kbl: PASS -> FAIL [fdo#103232] +1
- shard-apl: PASS -> FAIL [fdo#103232]
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
- shard-glk: PASS -> FAIL [fdo#104873]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
- shard-kbl: PASS -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
- shard-glk: PASS -> FAIL [fdo#103167] +2
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
- shard-glk: PASS -> FAIL [fdo#108145]
- shard-kbl: PASS -> FAIL [fdo#108145]
- shard-apl: PASS -> FAIL [fdo#108145] * igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
- shard-apl: PASS -> FAIL [fdo#103166] +3
- shard-kbl: PASS -> FAIL [fdo#103166]
* igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
- shard-glk: PASS -> FAIL [fdo#103166] +3
* igt@kms_sysfs_edid_timing:
- shard-apl: NOTRUN -> FAIL [fdo#100047]
#### Possible fixes ####
* igt@gem_exec_fence@basic-await-default:
- shard-hsw: FAIL [fdo#108888] -> PASS
* igt@gem_userptr_blits@readonly-unsync:
- shard-apl: INCOMPLETE [fdo#103927] -> PASS
* igt@kms_color@pipe-b-ctm-max:
- shard-apl: FAIL [fdo#108147] -> PASS
* igt@kms_cursor_crc@cursor-128x42-onscreen:
- shard-glk: FAIL [fdo#103232] -> PASS +1
* igt@kms_cursor_crc@cursor-64x21-random:
- shard-apl: FAIL [fdo#103232] -> PASS +6
* igt@kms_cursor_crc@cursor-64x64-sliding:
- shard-kbl: FAIL [fdo#103232] -> PASS +1
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-glk: FAIL [fdo#105363] -> PASS
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
- shard-kbl: FAIL [fdo#103167] -> PASS +1
- shard-glk: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: FAIL [fdo#103167] -> PASS +4
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-pwrite:
- shard-snb: INCOMPLETE [fdo#105411] / [fdo#107469] -> SKIP
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-apl: FAIL [fdo#108948] -> PASS
* igt@kms_plane@plane-position-covered-pipe-a-planes:
- shard-kbl: FAIL [fdo#103166] -> PASS
* igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
- shard-glk: FAIL [fdo#108145] -> PASS +2
* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-glk: FAIL [fdo#103166] -> PASS +3
* igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
- shard-apl: FAIL [fdo#103166] -> PASS
* igt@kms_setmode@basic:
- shard-kbl: FAIL [fdo#99912] -> PASS
* igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
#### Warnings ####
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: DMESG-FAIL [fdo#108950] -> DMESG-WARN [fdo#105604]
[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105604]: https://bugs.freedesktop.org/show_bug.cgi?id=105604
[fdo#107469]: https://bugs.freedesktop.org/show_bug.cgi?id=107469
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108888]: https://bugs.freedesktop.org/show_bug.cgi?id=108888
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#108950]: https://bugs.freedesktop.org/show_bug.cgi?id=108950
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 5)
------------------------------
Missing (2): shard-skl shard-iclb
Build changes
-------------
* IGT: IGT_4749 -> IGTPW_2166
* Piglit: piglit_4509 -> None
CI_DRM_5327: 2c09c998f9503f26757bcfd16aca1f2317eca4f4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2166: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2166/
IGT_4749: 270da20849db4d170db09673c6b67712c90ec9fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2166/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev