summaryrefslogtreecommitdiff
path: root/lib/i915
AgeCommit message (Collapse)Author
2019-04-05lib: ioctl_wrappers: reach engines by index as wellAndi Shyti
With the new engine query method engines are reachable through an index and context they are combined with. The 'gem_has_ring()' becomes 'gem_context_has_engine()' that requires the index that the engine is mapped within the driver. The function has been moved from lib/ioctl_wappers to lib/i915/gem_context where it is more appropriate. The previous 'gem_has_ring()' function becomes a wrapper to the new 'gem_context_has_engine()'. Signed-off-by: Andi Shyti <andi.shyti@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-03-26lib/i915: Improve gem_context error messagesChris Wilson
Avoid embedding the DRM_IOCTL() macro into the error message as it is unreadable, and instead always wrap the ioctl with a self-descriptive helper. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-03-16lib/i915: Pretty print HW semaphoresChris Wilson
Include whether the scheduler is using HW semaphore assistance in our pretty debug strings, and make the caps known for requires. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-02-26lib/i915: Move mmap IOCTLs wrappers into separate fileAntonio Argenziano
Move all mmap flavours and support function to separate file in i915 folder. This helps with moving i915 specific functions away from common libraries. v2: - Autotools still exists. (Petri) - Include gem_mman.h directly. (Chris) v3: - Keep includes explicit. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-05tests/gem_media_vme: Simple test to exercise the VME blockTony Ye
Simple test which exercises the VME fixed function block. v2: (Tvrtko Ursulin) * Small cleanups like copyright date, tabs, remove unused bits. v3: (Tony Ye) * Added curbe data entry for dst surface. * Read the dst surface after the VME kernel being executed. v4: (Tony Ye) * Added the media_vme.gxa kernel source code and compile instructions. v5: (Tvrtko Ursulin) * Added hang detector. v6: (Tvrtko Ursulin) * Replace gem_read with gem_sync. (Chris Wilson) Signed-off-by: Tony Ye <tony.ye@intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Tony Ye <tony.ye@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2019-01-21lib/i915/gem_context: Help static analysis with execution flowPetri Latvala
If an igt_ioctl fails, errno is set to non-zero, and static analysis doesn't quite get it. Add an igt_assume() to help. v2: Braces on both branches of an if (Chris) Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-10-15libs: Add rendercopy support for GEN11Kalamarz, Lukasz
This patch introduces a render copy shader for GEN11. The plumbing is same as with GEN9, so we can reuse it, extracting the common parts, and wrapping it in GEN-specific helpers. v2: Added gen11 shader source path next to its binary form Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-10-04lib/i915: Move shaders directoryKatarzyna Dec
In shaders/ directory we got Intel specific information. As igt is a project for more vendors, let's move this directory to lib/i915. v2: Changed shaders directory path in library files comments. Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Kalamarz Lukasz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-13lib/gt: Make use of dummyload library to create recursive batchAntonio Argenziano
An hanging batch is nothing more than a spinning batch that never gets stopped, so re-use the routines implemented in dummyload.c. v2: Let caller decide spin loop size v3: Only use loose loops for hangs (Chris) v4: No requires v5: Free the spinner v6: Chamelium exists. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> #v3 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-05-31lib: Double check ring measurementChris Wilson
Check twice for the signal interrupting the execbuf, because the real world is messy. References: https://bugs.freedesktop.org/show_bug.cgi?id=106695 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-05-31lib: Align ring measurement to timerChris Wilson
After hitting the SIGINT from execbuf, wait until the next timer signal before trying again. This aligns the start of the ioctl to the timer, hopefully maximising the amount of time we have for processing before the next signal -- trying to prevent the case where we are scheduled out in the middle of processing and so hit the timer signal too early. References: https://bugs.freedesktop.org/show_bug.cgi?id=106695 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-05-31lib: Assert that we do manage to submit at least one batch when measuringChris Wilson
As we measure the ring size, we never expect to find we can not submit no batches at all. Assert against the unexpected. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-04-03tests/gem_eio: Never re-use contexts which were in the middle of GPU resetTvrtko Ursulin
Contexts executing when reset triggers are potentialy corrupt so trying to use them from a subsequent test (like the default context) can hang the GPU or even the driver. Workaround that by always creating a dedicated context which will be running when GPU reset happens. v2: * Export and use gem_reopen_device so the test works on old gens as well. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-22igt/gem_measure_ring_size_inflight: Measure smallest inflight ring sizeAntonio Argenziano
Some tests measure the render's ring size but are actually meant to measure the smallest across all engines. This patch adds measuring the smallest size in gem_measure_ring_size_inflight() given the appropriate parameter. v2: - Only expose high level API. (Chris) v3: - Use ALL_ENGINES macro. Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-22lib: Run gem_test_engine() in an isolated contextChris Wilson
Ignore the shennigans of the test surrounding the library call to gem_test_engine() and focus on answering the query of whether the engine exists and is operational. 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> Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-03-20igt: Replace 'all-engines' magic numbers with macroAntonio Argenziano
In interfaces where a parameter allow to select an engine, we usually use '-1' or '~0u' to select all engines. This patch replaces magic numbers with a named constant. Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-07Bump measure_ring_size() timer intervalChris Wilson
It appears that waiting for a 100us period whereby we are unable to submit another batch and proclaim the ring full, may have the false positive where the scheduler intervenes and we are signalled twice before having slept on ring space. Increasing the interval reduces the likelihood of the scheduler stealing the cpu from us, but does not eliminate it. Fortuitously it appears to be a rare false positive. For the library routine, we can fork a RT process but that seems a bit overkill! References: https://bugs.freedesktop.org/show_bug.cgi?id=105343 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-02-23lib/igt_gt: add intel_measure_ring_sizeDaniele Ceraolo Spurio
The logic to measure the ring size is replicated almost identically in several tests. Adding it as a common function will make the code cleaner. The tests are updated in follow up patches. v2: - Move into a new file: 'gem_ring'. (Chris) v3: - Rename ring measure function. (Chris) Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-07lib: Move __gem_context_create to common ioctl wrapper library.Antonio Argenziano
This patch adds a context creation ioctl wrapper that returns the error for the caller to consume. Multiple tests that implemented this already, have been changed to use the new library function. v2: - Add gem_require_contexts() to check for contexts support (Chris) v3: - Add gem_has_contexts to check for contexts support and change gem_require_contexts to skip if contests support is not available. (Chris) v4: - Cosmetic changes and use lib function in gem_ctx_create where possible. (Michal) v5: - Use gem_contexts_require() in tests and fixtures. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-15lib: Provide a library function to test nop executionChris Wilson
Sometimes a test wants to verify that an engine, or all of them, are functional by executing a nop batch. Provide a common routine to submit an empty batch then test whether the driver is wedged. Reported-by: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2017-12-08lib/i915: Update detection of GuC submissionChris Wilson
Recently the kernel has switched to using a combined i915.enable_guc rather than multiple i915.enable_guc_submission parameters. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
2017-11-21lib: Use drm-uapi/i915_drm.h instead of local defines.Eric Anholt
The MMAP_V2 is replaced by just using MMAP, since the official header has the updated struct. The gem_create_v2 and gem_get_aperture are left as is, because they seem to not be reflected in the UABI header! Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-11-17lib/i915: Prepare for the loss of i915.enable_execlists parameterChris Wilson
If we can't find the enable_execlists parameter, presume that the switch is forced by the kernel and enabled for all hw supporting execlists. We don't have a GETPARAM or ENGINE_INFO to query the internal details. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2017-11-12lib/i915: Query semaphore status using GETPARAMChris Wilson
Wherever possible we want to use existing ioctls rather than poking the volatile modparams, in this case we already provide I915_PARAM_HAS_SEMAPHORES so we have no excuse to peek i915.semaphores. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-10-24lib/i915: Add a query for when the guc is enabled.Chris Wilson
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>
2017-10-19lib/i915: Move submission related helpers to lib/i915/gem_submissionMichał Winiarski
Since I accidentally broke the build for some, by putting the pretty printer for submission inside ifdef HAVE_PROCPS, it's time to move the whole thing into lib/i915 while fixing this mistake. Let's also rename the pretty printer and add a doc to it as well as the section. Fixes: f6dfe556659f ("lib: Extract helpers for determining submission method") Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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>