summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2015-10-14lib/kbl: Add Kabylake PCI IDsRodrigo Vivi
Also, following kernel definition Kabylake is Skylake. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-12Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()Ville Syrjälä
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Make gem_mmap__{cpu,gtt,wc}() assert on failureVille Syrjälä
Rename the current gem_mmap__{cpu,gtt,wc}() functions into __gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name that assert that the pointer is valid. Most callers will expect a valid pointer and shouldn't have to bother with failures. To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g' over the entire codebase. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09lib: Die if framebuffer GTT mapping failsVille Syrjälä
Cairo helpfully allocates a new buffer for us when cairo_image_surface_create_for_data() is called with a NULL ptr. That means if gem_mmap__gtt() fails, we get a totally silent failure and nothing ever drawn into the framebuffer. Very confusing. Put in an igt_assert() to make sure we managed to mmap something. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09lib: Document that gem_mmap__{cpu,gtt,wc} return NULL on failureVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09s/gem_mmap/gem_mmap__gtt/Ville Syrjälä
Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any point in having it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-08lib/igt_fb: don't forget to close parens on message printedPaulo Zanoni
Restore the anxiety levels back to the normal values. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-07lib/igt.cocci: De-opencode ioctlsDaniel Stone
Use do_ioctl and do_ioctl_err where possible. Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07lib/drmtest: Add do_ioctl_err to expect failureDaniel Stone
do_ioctl demands that the ioctl returns success; add a variant named do_ioctl_err, which expects the ioctl to fail, and demands a particular result. Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07lib/igt.cocci: Add greater-than to igt_assert_lt*Daniel Stone
Change m >= n patterns to igt_assert_lte(n, m), and ditto for strict greater-than. Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07lib/igt_core: Add igt_assert_fdDaniel Stone
Skip open-coding and assert that fds are valid. Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07lib/igt_core: Add igt_assert_neq_*() variantsDaniel Stone
Similar to igt_assert_eq_*(), add variants for non-equality of types other than int. Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-10-07lib/core: Fix docs for igt_assert_lt(e)Daniel Vetter
Logical negation is hard. v2: The second integer isn't plural (Daniel). Cc: "Morton, Derek J" <derek.j.morton@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-25lib: fix fopen mode in igt_debugfs_searchThomas Wood
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-24lib: add igt_debugfs_searchThomas Wood
Add igt_debugfs_search to search each line in a debugfs file for a specified substring. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-24lib/tests: explicitly raise SIGSEGVThomas Wood
Dereferencing a NULL pointer is undefined behaviour and may not always result in a segmentation fault. Explicitly raise the SIGSEGV signal to test handling of this signal. v2: include signal.h (Derek Morton) Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-17lib: allow wildcard matching when specifying subtestsThomas Wood
This allows multiple subtests to be specified using standard wildcard characters when using the --run-subtest command line option. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11lib: remove support for deprecated drm_open_any*() callsMicah Fedke
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11lib: adding drm_open_driver() interfaceMicah Fedke
The drm_open_driver*() functions replace the drm_open_any*() functions and provide the same utility, but in a way that is platform agnostic, not intel-specific. This opens the path for adopting intel-gpu-tools to non-intel platforms. This commit renames the calls and adds the chipset parameter which can be used to restrict the opening to a specific hardware family. For example, drm_open_driver(DRIVER_INTEL) will only return a valid fd if an intel GPU is found on the system, along with performing intel-specific initialization stuff like gem_quiescent_gpu(), et al. If OPEN_ANY_GPU is specified, the first available drm device of any type will be opened. Other hardware type flags may be added in the future. The drm_open_any*() calls are retained as aliases of drm_open_driver*(OPEN_ANY_GPU) but will be removed in a subsequent patch. Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11lib: don't use igt_warn in signal handlersThomas Wood
igt_wan and other log functions are not async-signal safe, so should not be used in signal handlers. Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08build: fix unused-result warningsThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08lib: various documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-25lib/gpgpu_fill.c: fix file permissionsThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: fix distcheck issuesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-14lib/igt_draw: break if we already wrote every pixelPaulo Zanoni
Due to the nature of accessing a tiled buffer in an untiled way, we used to loop through the whole buffer all the time. Add a small mechanism to just break in case we know we already wrote every pixel we should have written. On kms_frontbuffer_tracknig/fbc-2p-primscrn-pri-shrfb-draw-pwrite (with a 3200x1800 primary screen and a 1920x1080 secondary screen), I could reduce the runtime from ~7.53s to ~6.01s. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14lib/igt_draw: fix pwrite_tiled()Paulo Zanoni
Don't forget to flush in case we're in the last iteration of the loop. This fixes failures of kms_frontbuffer_tracking when used with --use-small-modes on eDP monitors. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14lib/igt_draw: add support for RGB565 and XRGB2101010Paulo Zanoni
We need to test those pixel formats on the FBC code, so let's make sure the drawing library works on them first. v2: Update the gtkdoc (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14lib/igt_core: use print("%s", #expr) instead of print(#expr)Paulo Zanoni
If I have a program with the following: igt_skip_on(i % 2 == 0); igt_skip_on_f(i % 2 == 0, "i:%d\n", i); igt_require(i % 2 == 0); igt_require_f(i % 2 == 0, "i:%d\n", i); then I'll get compiler error messages complaining about format conversions related to the '%' character used in the mod operation. So put the whole string as a %s argument to avoid interpreting '%' and any other possible chars. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14lib: Allow caller to use uint64_t sizes with intel_require_memory()Chris Wilson
Allow the caller to ask how many extra large objects can be created and still fit into memory. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-13lib/rendercopy_gen9: Setup Push constant pointer before sending BTP commandsArun Siluvery
From Gen9, by default push constant command is not committed to the shader unit untill the corresponding shader's BTP_* command is parsed. This is the behaviour when set shader is enabled. This patch updates the batch to follow this requirement otherwise it results in gpu hang. Set shader need to be disabled if legacy behaviour is required. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959 Cc: Ben Widawsky <benjamin.widawsky@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com> Tested-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13lib/rendercopy_gen9: WaBindlessSurfaceStateModifyEnableMika Kuoppala
Don't set the size of bindless surface state on rendercopy. And as of doing so, take into account the workaround for setting the command size. This was tried during hunting for https://bugs.freedesktop.org/show_bug.cgi?id=89959. But no impact was found. Cc: Arun Siluvery <arun.siluvery@linux.intel.com> Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13benckmarks/Android.mk: Fix building benchmarks for AndroidDerek Morton
The commit "benchmarks: Do not install to system-wide bin/" changed the benchmark file list from bin_PROGRAMS to benchmarks_PROGRAMS. However Android.mk was not updated, resulting in IGT failing to build for Android. This commit adds that change. It also adds LOCAL_MODULE_PATH to specify where the built benchmarks should be put. v2: I discovered that the existing definitions of LOCAL_MODULE_PATH were creating what should have been an invalid path. Not sure how it was ever working previously, but fixed now. Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-12lib/core: Add igt_reset_timeoutDaniel Vetter
Convenience wrapper suggested by Chris for igt_set_timeout(0, NULL). v2: While at it add an empty line in kms_flip to make set/reset_timeout a visual block. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12lib/core: Add optional reason for timeout failureDaniel Vetter
"Timed out" isn't a terribly informative message, allow users to set something more informative. Inspired by a request from Jesse. Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12tests/gem_ctx_param_basic: support NO_ZEROMAPDavid Weinehall
Signed-off-by: David Weinehall <david.weinehall@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-05lib: add igt_debugfs_read()Paulo Zanoni
A helpful function for when you want to read a whole debugfs file to a string and don't want to worry about opening and closing file descriptors and asserting buffer sizes. We've been using this already for kms_frontbuffer_tracking and kms_fbcon_fbt, so the only test with new code here is kms_fbc_crc. Also notice that for kms_fbc_crc we had to increase the buffer size since the file can sometimes be bigger than 64 bytes - depending on the reason why FBC is disabled. Of course, there are probably many other programs we can patch, but I'm not doing this now. v2: Add the macro to wrap sizeof() (Daniel). v3: Add documentation for the macro too (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-28igt/gem_streaming_writes: Bind into the GTT earlyChris Wilson
If we are using a streaming GGTT write into the source, we need to trigger an early fault in order to obtain a mappable offset. This is required when later we start reserving execbuf object top-down to try and avoid mappable space! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-22benchmarks: Benchmarkify gem_exec_nopChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-20lib/gpgpu_fill: Add SKL supportDominik Zeromski
SKL changed state base address command. Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20lib/gpgpu_fill: Add BDW supportDominik Zeromski
BDW changed structure of surface state and interface descriptors. Commands like state base address, gpgpu walker were extended. Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20lib: Move gpgpu_fill code to separate fileDominik Zeromski
The gpgpu fill utility functions are used in separate test so it's logical to keep them in separate file. This is similar to what media spin test did in the past. Functionally only gpgpu kernel changed. Send instruction payload size was reduced. Since offset is incremented by 0x10 bytes there is no point in using larger writes. Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com> [Thomas: Fix typo of gpgpu_fill.h in Makefile.sources] Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20lib: exit immediately if igt_fail is called in an exit handlerThomas Wood
Exit immediately if the test is already exiting and igt_fail is called. This can happen if an igt_assert fails in an exit handler. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91349 Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-19igt/stats: Fixup tests to compile after interface changesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-19lib: Allow storing floating point values in igt_statsChris Wilson
We don't always have precise integers with which to store, so allow degrading to double precision floating point based on available input. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-14configure: require libdrm >= 2.4.55Paulo Zanoni
And drop the now unnecessary universal plane definitions. The 2.4.55 version is already quite old, so we should be fine. Thanks to Thomas Wood for quickly spotting this. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@>
2015-07-02build: Don't use automake's conditional in a Makefile.sourcesDamien Lespiau
I just remembered that those Makefile.sources files where also included by the Android build system, so we can't use automake's conditionals in there. So, we want to use GNU make's one. Unfortunately, after all those years, GNU automake still doesn't do anything useful with GNU make's ifeq: lib/Makefile.sources:66: error: else without if automake will helpfully signal that the 'else' corresponding to the 'ifeq' doesn't have a corresponding 'if'. Well, yeah, thanks. Fortunately, we can work around this by cunningly inserting a space before 'ifeq', 'else' and 'endif' and fool automake's regex-based checks. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02build: Add an option to not use the git hash in versionDamien Lespiau
When developing, it's quite annoying that the version changes every commit, causing the library to be rebuild and every single binary re-linked. Add a config option to skip that. I remember Ville asking for this "feature" as well. v2: Option is now called --disable-git-hash (Thomas) Various spelling mistakes (Thomas) Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02build: Add DEBUG_FLAGS to tools and self-testsDamien Lespiau
Makes using GDB better on those binaries. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>