summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-10-17lib/i915: Extract context priority setparam to a helperMichał Winiarski
Another example of something that is used across different tests, and should be moved to lib. v2: Break the trend of expanding ioctl_wrappers Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-17lib/i915: Move context related helpers to lib/i915/gem_contextMichał Winiarski
We'd like to make ioctl_wrappers a bit thinner, and we plan to add new helpers in the following patch. Let's move context related helpers before adding more content. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-17lib/i915: Extract helpers for determining scheduler capabilitiesMichał Winiarski
Couple of tests are using either determining scheduler capabilities or pretty printing. Let's move those to helpers in lib. We can also keep the value obtained from getparam static. v2: Break the trend of expanding ioctl_wrappers Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-17lib: Extract helpers for determining submission methodMichał Winiarski
Couple of tests are using either determining submission method, or pretty printing. Let's move those to helpers in lib. v2: s/igt_show/gem_show Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-16lib/igt_gt: Allow non-default contexts to hang non-render ringsVinay Belgaumkar
This limitation does not exist in latest kernel. It was removed by this patch- commit f7978a0c581a8a840a28306f8da43e06e7fef3bf v2: Added commit id that removes the limitation(Chris Wilson) V3: Generic way to find if kernel supports this instead of hardcoding gens(Chris Wilson) v4: Optimize the if block (Daniele) v5: Use the same context instead of creating a dummy (Chris Wilson) v6: Changed comment structure and removed extra brackets, local var (Chris Wilson) v7: Removed some more extra brackets Cc: Michel Thierry <michel.thierry@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-16aux: Use IGT version of system() call to run rtcwakeImre Deak
The clone() system call has difficulty to make progress if interrupted frequently by the signal helper process. At least on an APL, like in the Bugzilla ticket below, this can introduce minutes of overhead to a single system() call (leading to a global CI timeout). To get rid of the overhead suspend the signal helper process for the duration of the system() call, which is provided already by igt_system(). Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103160 Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-16aux: Suspend signal helper for shell commandsImre Deak
The clone() system call with a larger executable (like /bin/sh) may have difficulty to make progress on some platforms if interrupted frequently. So suspend the signal helper process for the duration of the syscall. This is needed to solve an actual problem by the next patch. v2: - Clarify/fix code comments. (Chris) - Update igt_system_quiet() as well accordingly. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
2017-10-12meson: Make syncobj tests buildVille Syrjälä
Include igt_syncobj.c in libigt so that tests/syncobj_basic actually builds, and let's also build tests/syncobj_wait. v2: Also update lib_headers (Petri) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-10-10lib: Add some syncobj helpers (v2)Jason Ekstrand
[airlied: added some initial gtk-doc for the helper library.] Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-09lib/igt_kms: Don't assert on non-existent planeVille Syrjälä
Skip when a test can't find a plane by the index. Previously in commit 5426dc0a889a ("lib/kms: Skip rather than fail when a suitable plane can't be found") we added similar handling for tests trying to find a non-existent plane by type. Saves from every test with hardcoded plane numbers having to check the number of planes available. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-10-04lib/igt_kms: Disable crtc in legacy path when output is unsetMaarten Lankhorst
When the output is unset, but the fb is still valid we still have to perform a disable on the crtc. This ixes the following crash in kms_color (although previous commit does as well): (gdb) bt 0 igt_output_get_mode (output=output@entry=0x0) at igt_kms.c:2828 1 0x000055555556f0d5 in igt_primary_plane_commit_legacy(..) at igt_kms.c:2341 2 igt_plane_commit (fail_on_error=true, s=COMMIT_LEGACY, ..) at igt_kms.c:2394 3 igt_pipe_commit (fail_on_error=true, s=COMMIT_LEGACY, ..) at igt_kms.c:2435 4 do_display_commit (display=0x7fffffffe5d8, s=COMMIT_LEGACY, ..) at igt_kms.c:2667 5 0x000055555556f38e in igt_display_commit2 (display=<optimized out>, s=<optimized out>) at igt_kms.c:2777 6 0x000055555555ef84 in run_tests_for_pipe (data=.., p=PIPE_B) at kms_color.c:1053 7 0x000055555555f610 in __real_main1189 () at kms_color.c:1206 8 0x000055555555cbc7 in main (argc=<optimized out>, argv=<optimized out>) at kms_color.c:1189 Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-10-04Fix compilation on some distrosAusmus, James
Some distros (such as Gentoo) are removing the include of sys/sysmacros.h from sys/types.h. Explicitly include sysmacros.h in files where we use the minor() and major() functions. Signed-off-by: James Ausmus <james.ausmus@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-10-03lib: Fixup __gem_create() to be 64b safe.Chris Wilson
We want to create very large objects, larger than the 2G limit imposed by using ints. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviwed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2017-10-03meson: Fix build of igt_x86-using tests on non-x86 platforms.Eric Anholt
Just stub out the features return value, and return an empty string. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-10-03lib: Report the error from __gem_create()Chris Wilson
We have two style of ioctl wrappers. The principle interface does error checking on behalf of the caller (to avoid having lots of repetitious code in each test), and for the few cases where the error is important for the test, we also expose a double underscore version. Fix up __gem_create() to follow this pattern and report the negative error code returned by the kernel. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2017-10-03lib: Reduce dependency on glibPetri Latvala
In commit ebd6eb69f57b ("Make igtrc configuration common, with configurable suspend/resume delay") .igtrc handling was moved to igt_core from igt_chamelium. That made everything in IGT depend on GLIB by accident. In short, igt_core.h declared a variable of type GKeyFile*, requiring glib.h. Everything that tried to #include igt_core.h required glib.h to be available, by use of GLIB_CFLAGS. This "worked" so far because CAIRO_CFLAGS contained GLIB_CFLAGS. As the variable is only used by other stuff in lib/, stuff it in its own header file to leave igt_core.h without a dependency to glib.h. Also add a couple of missing #ifdef HAVE_GLIBs around. Reported-by: Felipe De Jesus Ruiz Garcia <felipe.de.jesus.ruiz.garcia@intel.com> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-03lib/igt_kms: Commit primary plane when a modeset is forced on a pipeMaarten Lankhorst
In between tests, some tests can do the following sequence: (pipe C configured with FB) igt_plane_set_fb(primary (pipe C), NULL); /* Clear rotation property first */ igt_display_commit2(display, COMMIT_UNIVERSAL); /* disable pipe */ igt_display_commit2(display, COMMIT_LEGACY); This would result in PIPE_C not being properly disabled, which will cause an error on the next mode. This can be seen when running the full kms_rotation_crc testcase without --subtest, it will fail on exhaust-fences because the bad-tiling subtest wasn't able to disable pipe C correctly. Testcase: kms_rotation_crc Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-10-03lib/igt_kms: Change output->pending_crtc_idx_mask to output->pending_pipeMaarten Lankhorst
igt_output_set_pipe with PIPE_ANY used to mean that we bind the output to any pipe, but this is now a deprecated alias for PIPE_NONE, and means the output will be unbound. Because of this it's better to change output->pending_crtc_idx_mask to an enum pipe, because only a single choice may be given for a pipe. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-10-02meson: Distribute meson build system filesPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-10-02lib: Handle intel_aub.h like the other stub filesPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-10-02lib: Remove media_fill.cPetri Latvala
media_fill.c has been unused from around 2014 when its contents moved to intel_batchbuffer.c. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-10-02tests: Stop looking at plane private membersMaarten Lankhorst
Most of these tests have no reason to look at those members, so try other ways of getting the information. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-09-29lib: Fix igt_sysfs_set_u32 return valueTvrtko Ursulin
Printf family functions return a number of bytes, not tokens, printed so the existing check (== 1) was wrong. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-28lib: Capture the error state on an unexpected hangChris Wilson
Dump debugfs/i915_error_state to the debug channel if we detect an ERROR uevent. This poses a few problems, not least that it is the auxiliary process doing the dumping (so the output may be interleaved with the test, but considering a hang occurred it is likely the test is blocked) and the average error state is around 60k, which may prove unwieldy! On the other hand, it may prove invaluable in debugging those impossible to reproduce bugs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-09-25igt_core: Rework igt_system()Petri Latvala
Instead of redirecting output to pipes and forking, redirect after forking to avoid having to carefully unredirect before logging anything. igt@tools_test@sysfs_l3_parity had a racy condition where it prints the output of intel_l3_parity prepended by [cmd], but that ended up being printed again prepended by [cmd] because output was redirected, causing outputs to appear multiple times. This patch fixes that. CC: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2017-09-22lib/igt_fb: Add igt_cairo_image_surface_create_from_png()Ville Syrjälä
Raw usage of cairo_image_surface_create_from_png() doesn't work since it doesn't know about IGT_DATADIR and IGT_SRCDIR. Let's extract the helper from igt_paint_image() that uses igt_fopen_data() + cairo_image_surface_create_from_png_stream() and call it igt_cairo_image_surface_create_from_png(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-09-21i915_pciids: Change a KBL pci id to GT2 from GT1.5Rodrigo Vivi
In sync with 41693fd52373 ("drm/i915/kbl: Change a KBL pci id to GT2 from GT1.5") "See Mesa commit 9c588ff" v2: s/DT/Mobile Cc: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2017-09-18meson: Fix IGT_GIT_SHA1 handlingVille Syrjälä
Tell meson about the dependency on version.h. Avoids the compiler falling over on account of IGT_GIT_SHA1 not being there. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-15meson: Install libigt.soJordan Justen
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-13lib/igt_kmod: Allow specifying libkmod config via environment variablesJoonas Lahtinen
Allow specifying the kernel module configuration via environment variables. This allows enumerating the subtests of the kselftest wrappers from sysroot directory. IGT_KMOD_CONFIG_PATHS="" \ IGT_KMOD_DIRNAME="/path/to/sysroot/lib/modules/X.Y.Z" \ tests/drm_mm --list-subtests Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-12tests: Add kms_atomic_interruptible test, v4.Maarten Lankhorst
This tests the various parts of atomic that I want to make interruptible. Running with --debug shows the stats from __igt_sigiter_continue, which can be used to make sure that we don't fall over. The default igt kms helpers use drmIoctl, which is not intercepted by igt_while_interruptible. Only igt_ioctl is. This means we have to call the ioctls manually here. Changes since v1: - Implement interruptible DPMS checking too. - Use igt_ioctl + igt_while_interruptible, instead of the signal helper shotgun. Changes since v2: - Bump whitespace to get rid of the weird double } at same indent. - Use more newlines in the call to the atomic ioctl. Changes since v3: - Fix copyright on year. (Adrinael) - Use do_ioctl instead of do_or_die(igt_ioctl) (ickle). - Add test description. (Adrinael) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1 Reviewed-by: Petri Latvala <petri.latvala@intel.com> [mlankhorst: Document sleep values (Adrinael)]
2017-09-08meson: igt_frame also needs pixmanDaniel Vetter
Oversight I noticed because I have the deps for chamelium on the other machine already. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08meson: Use static libs to handle IGT_LOG_DOMAIN.Eric Anholt
It means that compiler errors in the .c files take you to the source place in your editor, not a preprocessed temporary. v2: Add the library deps, fails linking otherwise. Signed-off-by: Eric Anholt <eric@anholt.net> (v1) Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08lib/ioctl_wrappers: make the valgrind wrapper always emit a statement:wDaniel Vetter
gcc complains otherwise about empty ; statements ... Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08meson: basic build system supportDaniel Vetter
Why? Because it's fast. Like really, really fast. Some data (from a snb laptop, so rather lower-powered): - Incremental build after $ touch lib/igt_core.c with meson: 0.6s It notices that the symbol list of the libigt.so hasn't changed and doesn't bother re-linking the almost 300 binaries we have. make -j 6 for the same scenario takes 44s. - Incremental build with nothing changed: make: 0.7s, meson: 0.2s This means stuff like --disable-git-hash is entirely pointless with meson, it's faster than a make ever can be (with 0.6s). - Reconfigure stage: ninja reconfigure 0.8s vs. ./configure 8.6s) - Running tests, after a full build: ninja test 6s vs. make check 24s - Full build (i.e. including ./autogen.sh respectively meson build), including tests, from a pristine git checkout. automake 2m49s vs. meson 44s. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Eric Anholt <eric@anholt.net> Cc: Daniel Stone <daniel@fooishbar.org> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-09-08lib/uwildmat: Use include pathsDaniel Vetter
meson runs gcc from where meson.build that includes those files is, which means we need to add the directory ourselves. For automake it doesn't matter, so let's just do it for simplicity. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-09-08lib: clean up header includesDaniel Vetter
Just a bit of OCD, I like it when connections within library modules are a bit more obvious. igt.h is ok for tests, but let's use individual include lines for libraries consistently. Also order standard includes before igt ones. v2: Rebase. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08lib: prefix frame_dump_pathDaniel Vetter
Just a bit of ocd for anything non-static. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08build: remove _GNU_SOURCE from source filesDaniel Vetter
We are, the build system takes care of that. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08build: use HAVE_LIBGEN_H consistentlyDaniel Vetter
Also, we are _GNU_SOURCE, so simplify the conditions accordingly. The next patch will remove _GNU_SOURCE everywhere else. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08build: Nuke #ifdef HAVE_CONFIG_H cargo-cultDaniel Vetter
We have it. Daniel Stone said the #ifdef HAVE_CONFIG_H comes from the X11 transition to the modular build, where in the imake -> modular build transition config.h wasn't universally available. Now we just make this a requirement (so yeah Android better generate one too). v2: Improve commit message a bit. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08build: Define _GNU_SOURCE in Makefile.amDaniel Vetter
In meson I want to just set this everywhere (no reason not to), and doing so will allow us to clean up a few things. But that means autofoo needs to follow suit. v2: Rebase. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-09-08lib/kms: Skip rather than fail when a suitable plane can't be foundVille Syrjälä
If the system doesn't have the plane the test wants, let's skip the test rather than fail it. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-08lib/kms: Fix the connector name strings to match what the kernel usesVille Syrjälä
We depend on kmstest_connector_type_str() matching the kernel. Fix up the cases where we differ currently. Also add the missing DPI "connector" type. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-08lib/sysfs: Fix fbcon rebindVille Syrjälä
"echo 1 > vtconN/bind" doesn't actually do anything. Looks like the only way to rebind fbcon is to unbind the current console. I suppose the failure to rebind might be a kernel bug, but I can't be bothered to decode the vt.c spaghetti so let's just try to handle this in igt. For simplicity let's assume the currently bound console is the dummy console and unbind that when we want to rebind fbcon. That works for me. With rebinding not working we can't really tell wich console is going to get bound anyway, so there's no way to make this code really robust, assuming we ever had more than these two console drivers involved. Additionally Daniel Vetter pointed out: "We select the dummy con in i915, to be able to kick out vgacon before we register fbdev. So should always be there." Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-07lib/dummyload: Use -1 for all enginesChris Wilson
Random change when it was copied broke the interface I am using, so bring it back into line with all the other stanzas to generate engine[]. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-07igt/gem_exec_schedule: Basic tests for preemptionChris Wilson
We queue N low priority hanging batches across the engines and check that our high priority write over takes them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-09-07igt/gem_exec_schedule: Exercise reordering with many priority levelsChris Wilson
Apply a little more stress to the scheduler. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-09-06igt/pm_rpm: Use libc 'ftw' rather than opencoding our own filetree walkChris Wilson
By using ftw, we avoid the issue of having to handle directory recursion ourselves and can focus on the test of checking the reading a sysfs/debugfs does not break runtime suspend. In the process, disregard errors when opening the individual files as they may fail for other reasons. v2: Bracket the file open/close with the wait_for_suspended() tests. Whilst the fd is open, it may be keeping the device awake, e.g. i915_forcewake_user. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Jari Tahvanainen <jari.tahvanainen@intel.com>
2017-09-06lib: Avoid actually throttling from igt_require_gem()Chris Wilson
igt_require_gem() checks whether we can use the i915 fd for submitting requests by detecting a wedged driver. It was intended to be used just after opening DRIVER_INTEL for a gem test to provide an early skip if the device was unusable. However, it is also used at the start of library functions like igt_spin_batch_new() which may be called after the test has setup some state, and importantly submitted some batches. igt_require_gem() has the risk of then waiting on those batches, unless we tell it to use a clean fd. v2: Chase the /proc/self/fd/$fd link Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>