summaryrefslogtreecommitdiff
path: root/lib/meson.build
AgeCommit message (Collapse)Author
2022-06-13lib/i915_crc: Introduce crc32 on gpu for DG2Zbigniew Kempczyński
Adding crc32 calculation on gpu gives us new possibility to verify data integrity without relying on trust cpu mapping is correct. Patch introduces calculating crc32 on DG2 only. On older gens ALU (MI_MATH) doesn't support bit-shifting instructions as well as multiply or divide. Emulating n-bit shifts cost hundred of instructions with predicated SRM (works on render engine only). Another limitation is lack of indexed load / store. On DG2 we can use WPARID and CS_MI_ADDRESS_OFFSET to achieve indexed operation on memory. Due to performance reasons (cpu crc32 calculation even on WC memory is still much faster than on gpu, also depends on calculated object memory region) calculation will complete in reasonable of time only for few MiB. v2: - use registers relative to engine to allow run on all engines (Chris) - use predication instead of memory access to get better performance (Chris) - add location where crc32 implementation comes from (Petri) v4: - use common crc32 table from igt_crc - add docs v5: - change BIT(n) to informative macros (Zbigniew) Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2022-06-13lib/igt_crc: Introduce common place for crc tables and functionsZbigniew Kempczyński
Add crc32 table for on-cpu crc calculation function. Other tables and algorithms should be added here allowing reuse tables for in-gpu crc calculation. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-06-01tests/amdgpu: refactoring and update amd_basic testsVitaly Prosyak
1. Create auxiliary directory amdgpu into igt-gpu-tools/lib Put all helpers and reusable functions into this directory using the following assumptions: - group memory alloc/free functions into separate file amd_memory.c and h. - group command submissions helper functions for GFX, COMPUTE and SDMA into separate file amd_command_submission.c and h. - for compute put nop command submission into separate file amd_compute.c and h. - for graphics put command submission into separate file amd_gfx.c and h. - for fence put command submission into separate file amd_fence.c and h. 2. Simplify implementation and reduce the number of local variables and allocations. 3. The file igt-gpu-tools/tests/amdgpu/amd_basic.c has only functions responsible for single sub test: - amdgpu_memory_alloc - amdgpu_userptr_test - amdgpu_command_submission_gfx - amdgpu_command_submission_compute - amdgpu_command_submission_multi_fence - amdgpu_command_submission_sdma - amdgpu_semaphore_test 4. No helper functions into amd_basic.c file. 5. Updated command submissions for secure buffer. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Reviewed-by: Christian Koenig <christian.koenig@amd.com> Reviewed-by: Alexander Deucher <alexander.deucher@amd.com>
2022-05-31igt: Promote/rename OS helpersRob Clark
Promote intel_os.c helpers to igt_os.c, so that I can re-use them for some additional msm tests. Just big churny rename, no functional change. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-04-05lib: Helper library for parsing i915 fdinfo outputTvrtko Ursulin
Tests and intel_gpu_top will share common code for parsing this file. v2: * Fix key-value parsing if valid key line ends with ':'. * Return number of drm keys found. * Add DRM_CLIENT_FDINFO_MAX_ENGINES. (Umesh) * Always zero terminate read buffer. (Umesh) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
2022-03-11lib/i915_blt: Add library for blitterZbigniew Kempczyński
Blitter commands became complicated thus manual bitshifting is error prone and hard debugable - XY_BLOCK_COPY_BLT is the best example - in extended version (for DG2+) it takes 20 dwords of command data. To avoid mistakes and dozens of arguments for command library provides input data in more structured form. Currently supported commands: - XY_BLOCK_COPY_BLT: a) TGL/DG1 uses shorter version of command which doesn't support compression b) DG2+ command is extended and supports compression - XY_CTRL_SURF_COPY_BLT - XY_FAST_COPY_BLT Source, destination and batchbuffer are provided to blitter functions as objects (structs). This increases readability and allows use same object in many functions. Only drawback of such attitude is some fields used in one function may be ignored in another. As an example is blt_copy_object which contains a lot of information about gem object. In block-copy all of data are used but in fast-copy only some of them (fast-copy doesn't support compression). v2-v3: address review comments (Kamil) Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2022-03-11lib/i915: Introduce library intel_mocsApoorva Singh
Add new library intel_mocs for mocs settings. v2: make definitions and struct private (Kamil) Signed-off-by: Apoorva Singh <apoorva1.singh@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Arjun Melkaveri <arjun.melkaveri@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2022-01-18lib/store: Refactor common store code into helper functionJohn Harrison
A lot of tests use almost identical code for creating a batch buffer which does a single write to memory and another is about to be added. Instead, move the most generic version into a common helper function. Unfortunately, the other instances are all subtly different enough to make it not so trivial to try to use the helper. It could be done but it is unclear if it is worth the effort at this point. This patch proves the concept, if people like it enough then it can be extended. v2: Fix up object address vs store offset confusion (with help from Zbigniew K). v3: Cope with >32bit store_offset (review feedback from Matthew Brost). Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-12-07igt: Split out I/O helpersRob Clark
Split the readN()/writeN() helpers out into an igt_io module, so they can be re-used by tests. Signed-off-by: Rob Clark <robdclark@chromium.org>
2021-11-02lib/meson.build: Fix underscorify callPetri Latvala
f.underscorify() is correct, f.underscorify(f) is an error that later meson versions don't like at all. Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/107 Fixes: 588555f77909 ("lib/i915: Extract helpers for determining scheduler capabilities") Cc: Arkadiusz Hiler <arek@hiler.eu> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2021-09-09msm: Add helper libraryRob Clark
Handle some of the boilerplate for tests. v2: fix comment, drop unnecessary drm_open_driver_render() error handling, docs fixes, drop igt_msm_pipe_get_param() (for now), handle NULL in destructors Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-06-10lib: Add an intel_ctx wrapper struct and helpers (v6)Jason Ekstrand
We're trying to clean up some of our technical debt in the i915 API. In particular, context mutability and unnecessary getparam(). There's quite a bit of the introspection stuff that's not used by any userspace other than IGT. Most drivers don't care about fetching the set of engines, for instance, because they don't forget about what set of engines they asked for int the first place. Unfortunately, IGT relies heavily on context introspection for just about everything when it comes to multi-engine testing. It also likes to use ctx0 as temporary storage for whatever the current test config is. While effective at keeping IGC simple in some ways, this means we're making heavy use of context mutability. Also, passing data around with in tests isn't really what contexts are for. This patch adds a new intel_ctx_t struct which wraps a context and remembers the full context configuration. This will provide similar ease-of-use without having use ctx0 as temporary storage. v2 (Jason Ekstrand): - Make all intel_ctx_t's const v3 (Jason Ekstrand): - Fix up the docs so they build properly v4 (Jason Ekstrand): - Add an intel_ctx_create_for_engine helper v5 (Zbigniew Kempczyński): - Use SPDX license identifiers - Document default context semantics v6 (Ashutosh Dixit): - Fix SPDX in intel_ctx.h - Fix a typo in a comment v6 (Jason Ekstrand): - Add documentation about num_engines to intel_ctx_cfg_t Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-05-27lib/i915/intel_memory_region: Add new memory region libAndrzej Turko
With an introduction of Local Memory concept we should be able to allocate object in specific memory region. This patch implements helper functions that allow this, both for querying what the device supports and hooking into gem_create_ext to select the placements. Co-authored-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Co-authored-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Signed-off-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-05-21lib/i915/perf: have python scripts a custom_target inputLionel Landwerlin
That way when changing the scripts, the generated files are regenerated. This change makes python3 an explicit hard dependency, but that was already the case for lib/i915/perf. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
2021-04-13lib/intel_allocator: Add intel_allocator coreZbigniew Kempczyński
For discrete gens we have to cease of using relocations when batch buffers are submitted to GPU. On cards which have ppgtt we can use softpin establishing addresses on our own. We added simple allocator (taken from Mesa; works on lists) and random allocator to exercise batches with different addresses. All of that works for single VM (context) so we have to add additional layer (intel_allocator) to support multiprocessing / multithreading. For main IGT process (also for threads created in it) intel_allocator resolves addresses "locally", just by mutexing access to global allocator data (ctx/vm map). When fork() is in use children cannot establish addresses on they own and have to contact to the thread spawned within main IGT process. Currently SysV IPC message queue was chosen as a communication channel between children and allocator thread. Child calls same functions as main IGT process, only communication path will be chosen instead of acquiring addresses locally. v2: Add intel_allocator_open_full() to allow user pass vm range. Add strategy: NONE, LOW_TO_HIGH, HIGH_TO_LOW passed to allocator backend. v3: Child is now able to use allocator directly as standalone. It only need to call intel_allocator_init() to reinitialize appropriate structures. v4: Add pseudo allocator - INTEL_ALLOCATOR_RELOC which just increments offsets to avoid unnecessary conditional code. v5: Alter allocator core according to igt_map changes. v6: Add internal version __intel_allocator_alloc() to return ALLOC_INVALID_ADDRESS without assertion. v7: Add libatomic for linking libigt library. It is required on some archs, like mips. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-04-13lib/igt_map: Adopt Mesa hash tableDominik Grzegorzek
The _search function has been changed to return a pointer to the stored data instead of the entry struct. The _search_entry function, which acts as the original search has been added. Additionally _remove function has an optional delete_function param, to make it more usable. For more information, see: http://cgit.freedesktop.org/~anholt/hash_table/tree/README Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-03-26lib: Introduce the igt_nouveau libraryLyude Paul
This introduces the igt_nouveau library, which enables support for tiling formats on nouveau, along with accelerated clears for allocated bos in VRAM using the dma-copy engine present on Nvidia hardware since Tesla. Typically the latter would be handled by the kernel automatically, which is the long-term plan for nouveau, but since the kernel doesn't yet support that we implement this in igt in order to fulfill the expectation that most of igt has in which newly allocated fbs are expected to be zero-filled by default. The dma-copy engine is capable of fast blitting, and is also able to perform tiling/untiling at the same time. This is worth mentioning because unlike many of the other drivers supported in igt, we go out of our way to avoid using mmap() in order to perform CPU rendering wherever possible. Instead of mmap()ing an fb that we want to draw to on the CPU (whether it be for converting formats, or just normal rendering), we instead use dma-copy to blit linear/tiled fbs over to linear system memory which we mmap() instead. This is primarily because while mmap() is typically painfully slow for vram, it's even slower on nouveau due to the current lack of dynamic reclocking in our driver. Furthermore, using the dma-copy engine for copying things over to system ram is also dramatically faster than using igt's memcpy wc helpers even when no tiling is involved. Such speed improvements are both quite nice, but also very necessary for certain tests like kms_plane that are rather sensitive when it comes to slow rendering with drivers. This doesn't mean we won't want to provide a way of using mmap() for rendering in the future however, as at least basic testing of mmap() is certainly something we eventually want for nouveau. However, I think the best way for us to do this in the future will be to adapt the igt_draw API to work with nouveau so we can explicitly request using mmap() in tests which need it. Finally, this code also adds a hard dependency on libdrm support for nouveau tests. The main reason for this is currently there are no real applications that use nouveau's ioctls directly (mesa for instance, uses libdrm as well) and also that nouveau's ioctls are currently a bit complicated to use by hand. This will likely be temporary however, as Ben Skeggs is planning on revamping a lot of nouveau's APIs to simplify them and make libdrm support for nouveau obsolete in the future. Note that we take care to make sure that users can still disable libdrm support for nouveau if needed, with the only caveat being that any tests using igt_nouveau will be disabled, along with any tiling support for nvidia-specific tiling formats. This should enable igt tests which test tiling formats to run on nouveau, and fix some seemingly random test failures as a result of not having zero-filled buffers in a few other tests like kms_cursor_crc. Changes since v1: * Remove leftover rebase detritus in drm_fourcc.h Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Martin Peres <martin.peres@mupuf.org> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Jeremy Cline <jcline@redhat.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-03-02meson: Allow source location to be configurableRichard Purdie
Hardcoding a build source path inside a binary when cross compiling isn't appropriate and breaks build reproducibility. Allow the srcdir to be specified by an optional configuration option to meson which can be used to override with the correct path. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-02-18lib/i915/perf: add ADL supportLionel Landwerlin
Yet another file. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
2021-01-11lib/i915: Split gem_create.c from ioctl_wrappers.cAndrzej Turko
In preparation for a variation on the exisiting GEM_CREATE API, split the ioctl from out of the large ioctl_wrappers.c Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2021-01-08lib: Process kernel taintsChris Wilson
A small library routine to read '/proc/sys/kernel/taints' and check for a fatal condition. This is currently used by the runner, but is also useful for some tests. v2,3: function docs Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-11-30tools/intel_gpu_top: Add generation info in headerZbigniew Kempczyński
In multi device world we may want to see generation of device we're tracking counters. Add pretty name of the device to be more verbose. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2020-09-16lib/rendercopy_bufmgr: remove rendercopy_bufmgrZbigniew Kempczyński
Remove transitional rendercopy_bufmgr, we don't need it anymore. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-15lib/i915/perf: rework perf counters equationsLionel Landwerlin
Working with an offset means we can have the PERFCNT snapshots stored at an offset in the existing accumulator rather than having a specific accumulator just for them. This isn't really useful for IGT because it only looks at the OA buffer where those registers aren't stored, but it is useful for perf queries in Mesa. This bumps the version of the i915_perf library to reflect the API change (see perf.h). v2: Also bump so version Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-09-04lib/i915/perf: Add DG1 metricsLionel Landwerlin
New XML files for DG1. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
2020-09-04lib/i915/perf: Add Rocketlake metricsLionel Landwerlin
New XML files for RKL. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
2020-09-03lib/i915/perf: break TGL metrics in 2Lionel Landwerlin
Programming for GT1s & GT2s appear to be different. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
2020-09-03lib/i915_perf: drop dependency on libigtLionel Landwerlin
There is no need for it, we just depend on libigt_chipset. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
2020-07-15tests/i915/gem_huc_copy: Enable a HuC copy testSally Qi
This test case loads the HuC copy firmware to copy the content of the source buffer to the destination buffer. v2: (Tony Ye) * Restructured some functions and files. * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel always copy 4K bytes from src buffer to dst buffer. v3: (Feng Qi, Antonio Argenziano, Tony Ye) * Restructured some functions as igt requested, exclude libdrm function call. * Remove huc function wrappers * Random initialize source input buffer v4: (Robert Fosha) * Fix autotools build failure. v5: (Feng Qi, Tony Ye) * Released all bo buffer after huc copying. * Restructured huc_copy() function. v6: (Feng Qi) * Fixed the function of huc enabling and status check * Added huc_copy to fast feedback testlist v7: (Tony Ye, Feng Qi, Robert Fosha, Chris Wilson, Michal Wajdeczko) * Check error with HUC_STATUS ioctl instead of debugfs v8: (Antonio Argenziano) * Remove unnecessary variable. * Add huc_load subtest. * Move failure checks out of igt_fixture. * get_huc_status() returns errno and then status as a parameter v9: (Antonio Argenziano) * Remove huc_load subtest - to be added later. v10: * Rebase * Remove huc_load subtest from fast-feedback.testlist. Signed-off-by: Feng Qi <feng.qi@intel.com> Signed-off-by: Tony Ye <tony.ye@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2020-06-22lib/core: Print thread:tid with igt_log for non-main threadsArkadiusz Hiler
So that we know what's the source of messages. igt_thread.c is created to facilitate more threading-related functionality that will come in the following patch. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-08lib/igt_device_scan: Make igt_device_scan independent from igt_coreAyaz A Siddiqui
igt_device_scan can now be used as a separate library which only depends glib and libudev - some IGT internals are being stubbed in this case. v2: (mostly) sort includes (Lucas) Cc: Lucas De Marchi <lucas.de.marchi@gmail.com> Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-05-08lib/params: add igt_params.c for module parameter accessJani Nikula
We have generic helpers for sysfs access in igt_sysfs.c, but we also have a number of module parameter access specific helpers scattered here and there. Start gathering the latter into a file of its own. For i915, the long-term goal is to migrate from module parameters to device specific debugfs parameters. With all igt module param access centralized in one place, we can make the transition much easier. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-05-07lib/i915: Split igt_require_gem() into i915/Chris Wilson
igt_require_gem() is a pecularity of i915/, move it out of the core. Similar opportunistic move of gem_reopen_driver() and gem_quiescent_gpu(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-04-02lib/i915/perf: break generated code in separate filesLionel Landwerlin
Initially all the generated code was per generation. Eventually we grouped it into a single file to reuse as much as possible equation code (this reduce binary size by a factor). So many equations are just the same from generation to generation. But this generated file is 200k lines long... This change puts all the equations into a single file, so that we reuse as much code as possible, and then breaks down the metric sets & register configurations into per generation files. v2: Split registers away from the metric set descriptions v3: Fix automake Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2020-02-19lib/i915-perf: add i915 perf data readerLionel Landwerlin
This library allows reading a file recorded by i915-perf-recorder. v2: Pick required libdrm dependency Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-02-19tools: add i915 perf recorder toolLionel Landwerlin
A tool recording i915-perf data along with device description & timestamp correlation points for mapping data to CPU tracepoints. The format is mostly described in perf_data.h. v2: Autotools support Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-02-19lib: Add i915_perf libraryLionel Landwerlin
This library contains the database of performance metrics for each supported generation as well as its associated programming. It also allow for the user to get human readable data out of HW generated data. v2: Switch a few python scripts to python3 v3: Fix some python2-ism s/lkf/ehl/ Autotools support v4: set soversion on i915_perf.so Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-02-06lib/vec: Add igt_vecVille Syrjälä
Add a small std::vector lookalike which grows as needed. v2: Reorganize things into igt_vec_grow() (Chris) Trust that memmove(..., 0) works (Chris) Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2020-01-23lib/igt_collection: Adding combinatorics facilityZbigniew Kempczyński
Dynamic tests gives us new method to create tests depending on the hardware/software capabilities. To check coverage some tests require verification over some set of objects/data. To make life easier with combinatorics this patch introduces igt_collection. Currently it supports iterating over set to get subsets, combinations, variations with and without repetitions. Code has some limitation (set/subset cannot be larger than 16 elements, what is enough for most cases). Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-01-17lib/rendercopy_bufmgr: Add rendercopy buffer managerZbigniew Kempczyński
This is middle layer between render copy tests and buffer operations (buf_ops). Render copy tests uses libdrm so adding wrapper to independent buf_ops was necessary. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-01-17lib/intel_bufops: Introduce buffer operationsZbigniew Kempczyński
Different GENs supports different tile surfaces. Older GENs have HW fences to allow X / Y surface tiling / detiling. Newer GENs have to tile / detile such surface in software. To make test developer life easier this code adds buffer operations (short buf_ops) to use appropriate functions allowing copying linear buffer to BO and from BO to linear buffer regardless GPU generation and tiling/swizzling within BO. For GENs having fences support preference is to use them if they are available (X / Y tiling is probed on buf_ops initialization). Note: on Gen2 code supports only HW tiling at the moment. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-12-09lib: Add vebox copy supportImre Deak
To produce surfaces that are compressed using the media compression format we need to use one of the media engines. The simplest way for this is to use the vebox engine's tiling convert command, so add support for this. v2: - Rebase on latest igt. (Mika) Cc: Mika Kahola <mika.kahola@intel.com> Cc: Brian Welty <brian.welty@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2019-12-04Introduce device selection APIZbigniew Kempczyński
The new device selection API based on scanning DRM subsystem using udev. It provides a set of functions for enumerating and filtering available graphic cards to get the corresponding /dev/dri nodes. For details check the top level documentation in igt_device_scan.c To be used in lsgpu tool and internally by drm_open_driver*() functions (see the following patches). v2 (Arek): * drop most of the glib code in favor of igt_list and plain C * make sysfs paths handling non-special - introduce sys: filter * drop multiple filter_* structs in favor of just two: - filter_class for defining filters types (e.g. sys:) - filter for "filter instance" - the data provided by the user * promote many macros to real functions for type safety * rename devs->devs to devs->all * rename devs->view to devs->filtered * don't expose "chip" (e.g. DRIVER_ANY) as it's unreadable as int * update docs to reflect those changes * move open functions that open igt_device_card to this patch * remove platform filter class for now * use only a single filter v3 (Arek): * fix some memory leaks and setting to NULL after free() (Zbigniew) * fix even more missing free() (Petri) * use the new igt_list API * fix null pointer dereference on filter->class Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-11-20lib: Remove igt_gvtArkadiusz Hiler
Not used since 8781fd89a63e ("igt: Remove gvt_basic"). Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-11-14lib/rendercopy: Add AUX page table supportImre Deak
On GEN12+ the AUX CCS surfaces required by the render and media compression must be specified by a 3 level page table directory, which translates the main surface graphics address to the AUX CCS surface graphics address. For this purpose add support for creating a GEM buffer to translate the linear surface address range to the linear AUX surface address range. The buffers containing the main surface must be pinned down, since the directory table entry indices depend on the surface address, and they must be 64kB aligned. The page table can be relocated OTOH, so allow that and emit the required relocation entries. v2: - Make level variables to be 0 based (l1..l3 -> level=0..2). - Add missing drm_intel_bo_set_softpin_offset() stub to fix build on non-Intel archs. - Fix missing offsets in reloc entries of already bound objects. (Chris) - Randomize pin offsets, to try to avoid eviction. (Chris) - Remove redundant MI_NOOPS around MI_LOAD_REGISTER_MEM - Stop using explicit reloc cache domains, as these don't make sense on GEN12 anyway. (Chris) - Fix missing autotools support. (Chris) - s/igt_aux_pgtable/intel_aux_pgtable/, since the functionality is Intel specific. (Chris) v3: - Make sure all objects with an AUX surface are pinned. v4: - s/MI_LOAD_REGISTER_MEM/MI_LOAD_REGISTER_MEM_GEN8/ (Chris) - Fix using buf->bo->size instead of buf->size when finding a free range for a pinned obj. - Fix alignment of the reserved space start for a pinned obj. - Move gen12_emit_aux_pgtable_state() to its logical spot. v5: - Fix reloc emit call, passing a relative instead of absolute target offset. (Chris) - Fix off-by-one error when generating a random offset for pinned objs. Cc: Mika Kahola <mika.kahola@intel.com> Cc: Brian Welty <brian.welty@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-11-12lib/igt_list: Update, clean-up and document igt_listArkadiusz Hiler
Our list was something between Wayland and Linux Kernel list implementations, right in the uncanny valley. On top of that it falsely claimed that it's a straight copy from the Wayland project. Let's make our impl more akin to the kernel one to ease the cognitive dissonance for the developers working on all those projects. This patch: * mimics the current kernel list interface * separates IGT helpers in the source files * adds brief explanation and code example for igt-doc * introduces igt_list.c as static inlines are not visible in the docs v2: mimic the kernel instead of wayland (Chris) - _head suffix for the sentinel/link struct - _entry_ in iterator names that go over the elements v3: I forgot to merge this in time and there was another call site that had to be converted in gem_spin_batch.c Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-10-15lib: Generalise rapl interfaceChris Wilson
We can use our existing rapl interface that monitors gpu power, to also sample the other rapl domains such as package, cores and ram. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Andi Shyti <andi.shyti@intel.com> Reviewed-by: Andi Shyti <andi.shyti@intel.com>
2019-08-14lib/igt_infoframe: new librarySimon Ser
This commit introduces a new igt_infoframe library, used to parse InfoFrames. For now only audio InfoFrames are supported. Support for AVI and other types of InfoFrames is planned (and will come with the matching tests). Unlike igt_edid, InfoFrames are parsed into a higher-level user-friendly struct. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-04lib/igt_eld: introduce an ELD librarySimon Ser
There are two reasons why I want to introduce this library: - I want to use it from the Chamelium tests for DisplayPort - I want to expand it to also check that audio parameters parsed by ALSA are correct (formats, sampling rates, sample sizes and so on) Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-04i915: Add gem_vm_createChris Wilson
Exercise basic creation and swapping between new address spaces. v2: Check isolation that the same vm_id on different fd are indeed different VM. v3: Cross-over check with CREATE_EXT_SETPARAM Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>