summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-05-09lib/aux: Call setgroups() in igt_drop_root() before setgid()Lyude Paul
While igt isn't really security sensitive, forgetting to call setgroups() before calling setgid() causes rpmlint on Fedora to complain: igt-gpu-tools.x86_64: E: missing-call-to-setgroups-before-setuid /usr/lib64/libigt.so.0 ... missing-call-to-setgroups-before-setuid: This executable is calling setuid and setgid without setgroups or initgroups. There is a high probability this means it didn't relinquish all groups, and this would be a potential security issue to be fixed. Seek POS36-C on the web for details about the problem. Since it's likely other package maintainers for other distros will have to deal with similar issues eventually, and I can't see any harm in it, let's do the right thing and call setgroups() first. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-09lib/aux: Use igt_assert_eq() in igt_drop_root()Lyude Paul
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-09drmtest: Properly handle virtio-gpu's namingPetri Latvala
Instead of listing virtio-gpu with both spellings in the modules array, properly use its driver name for opening and module name for loading. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-05-09lib/igt_edid: fix detailed pixel timing analog/digitalSimon Ser
The generated EDIDs were wrongly indicating that they support analog sync. Fixup the detailed timings flags to advertise digital sync instead. Currently the Linux kernel seems to ignore this completely. However I'd prefer to fix this anyway to make sure we don't run into issues if an EDID consumer actually cares about it. The header definitions for EDID_PT_* values has been re-organized to make it clearer in which situations the flags are relevant. Changes from v1 to v2: - Fix misleading commit message - Revert the "misc" → "features" rename - Re-organize EDID_PT_* definitions to make them clearer Changes from v2 to v3: - Include review changelog in commit message - Fix "Fixes:" tag to conform to the kernel style - Re-order EDID_PT_* definitions to sort by descending bitshift Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Fixes: a2fd0489c87a ("lib/igt_edid: new library for generating EDIDs")
2019-05-07lib/igt_core: Just use igt_can_fail() in __igt_run_subtest()Lyude Paul
That's what it's there for. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07meson: Add .so versioningLyude Paul
While I'm pretty confident that no one cares to use libigt.so or lib_aubdump.so anywhere outside of igt, many distributions including Fedora and Debian strongly suggest that packages have some sort of so versioning, even if it's just '0'. So, let's fulfill that minimum requirement to make this easier to package. Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07meson: Don't redefine gettid if the C library provides itLyude Paul
glibc 2.30+ will actually include a definition for gettid() that makes it so that users don't have to manually define a wrapper for it themselves with syscall(). We don't currently check for this, and as a result will end up redefining gettid() on the latest versions of glibc, causing the build to fail: FAILED: lib/76b5a35@@igt-igt_kmod_c@sta/igt_kmod.c.o In file included from /usr/include/unistd.h:1170, from ../../mnt/vol/lib/igt_core.h:43, from ../../mnt/vol/lib/igt_kmod.c:28: /usr/include/bits/unistd_ext.h:34:28: error: macro "gettid" passed 1 arguments, but takes just 0 34 | extern __pid_t gettid (void) __THROW; | ^ In file included from ../../mnt/vol/lib/igt_kmod.c:27: ../../mnt/vol/lib/igt_aux.h:40: note: macro "gettid" defined here 40 | #define gettid() syscall(__NR_gettid) | [36/771] Compiling C object 'lib/76b5a35@@igt-igt_kms_c@sta/igt_kms.c.o'. ninja: build stopped: subcommand failed. So, fix this by by adding some meson checks to define HAVE_GETTID whenever the host defines its own gettid(), and avoid redefining gettid() when HAVE_GETTID is defined. This fixes build igt-gpu-tools for me on Fedora Rawhide Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07lib/aux: Typecast gettid() as pid_tLyude Paul
Partly, for correctness. But mostly because not typecasting properly causes the gettid() macro provided by newer glibc to be typed as pid_t (aka int), while ours is typed as long. Causing annoying warnings: [158/846] Compiling C object 'tests/59830eb@@drm_import_export@exe/drm_import_export.c.o'. In file included from ../../mnt/vol/lib/drmtest.h:39, from ../../mnt/vol/lib/igt.h:27, from ../../mnt/vol/tests/drm_import_export.c:27: ../../mnt/vol/tests/drm_import_export.c: In function ‘test_thread’: ../../mnt/vol/tests/drm_import_export.c:123:12: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘__pid_t’ {aka ‘int’} [-Wformat=] 123 | igt_debug("start %ld\n", gettid()); | ^~~~~~~~~~~~~ ~~~~~~~~ | | | __pid_t {aka int} ../../mnt/vol/lib/igt_core.h:875:64: note: in definition of macro ‘igt_debug’ 875 | #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f) | ^ ../../mnt/vol/tests/drm_import_export.c:123:21: note: format string is defined here 123 | igt_debug("start %ld\n", gettid()); | ~~^ | | | long int | %d So, typecast gettid() as pid_t and update all of our callers accordingly Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07Use gettid() wrapper everywhereLyude Paul
Currently we have multiple different parts of IGT that define their own wrapper around the gettid() syscall (or just call it directly with no wrapper). Additionally, add the appropriate #includes for igt_aux.h to make sure syscall() is available. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07lib/tests: Fix test failures with meson 0.50.0Lyude Paul
Since meson 0.50.0, unit tests which return the GNU standard return code 99 will fail, regardless of whether or not should_fail:true is passed to test(). Unfortunately, our standard error code (IGT_EXIT_FAILURE) is also 99. So, fix this by changing our standard error code to 98. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-04-29lib/igt_audio: fix filemode not specified in open(O_CREAT)Simon Ser
open(3) takes va_args after the flags and O_CREAT will read the first one. If we don't provide one, this is undefined behaviour. (Someone reported it broke the build for them) Signed-off-by: Simon Ser <simon.ser@intel.com> Fixes: 311baff151f9 ("tests/kms_chamelium: add dp-audio test") Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-29lib/rendercopy: Configure MOCS more consistentlyVille Syrjälä
Unify the MOCS to be more consistently across the platforms. Currently gen8+ are specifyig UC whereas earlier platforms generally use PTE. Let's make everyone more or less specify L3+PTE. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-29lib/rendercopy: Add fp16 support for gen4+Ville Syrjälä
Allow copying between fp16 surfaces. We'll use the FLOAT surface format since that's all the display supports currently. Hopefully the hardware gives us a 1:1 copy, at least if the input doesn't contain crazy infs/nans etc. We could choose UNORM instead but that won't work for eventually exposing fp16+ccs. Although we do need to replace the simple bpp value with a more specific format type to get 10bpc+ccs working as well. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-29lib/igt_fb: Fix 32bit integer overflow in the shadow buffer size calculationVille Syrjälä
16k*16k*16 == 1<<32, so 32bits isn't enough for the result when we start to have big framebuffers. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-29lib/igt_fb: Fix the cairo shadow buffer strideVille Syrjälä
We're currently overallocating the shadow buffer stride by a factor of 8. This didn't go down so well when I tried to use a 16kx16k float framebuffer. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Fixes: b0033d9310c1 ("lib/color_encoding: Prepare support for HDR modes, v2.") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-26lib: consolidate duplicated define of vfs_file_max(void)Caz Yokoyama
Remove it from intel_os.c and gem_exec_reuse.c and globally define in igt_aux.c. v3: update comment in the code and commit message. Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-04-26lib: Add Cometlake platform definitionPetri Latvala
Commit a794f28f01f2 ("lib: sync with the newer i915_pciids.h from the Kernel") added CML PCI IDs but did not update intel_device_info.c Signed-off-by: Petri Latvala <petri.latvala@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110514 Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: José Roberto de Souza <jose.souza@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-04-25autotools: fix audio and chamelium buildsSimon Ser
The commit introducing Chamelium audio tests and removing old audio tests doesn't update autotools files. This patch fixes it. Signed-off-by: Simon Ser <simon.ser@intel.com> Fixes: 311baff151f90c1db6f57ee9515216b4f9da5db7 Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-04-25tests/kms_chamelium: run audio test with multiple sampling ratesSimon Ser
The audio test is now run multiple times with a variety of playback sampling rates. We now query the capture audio format from the Chamelium XML-RPC API instead of hardcoding it. One limitation is that we need to start sending an audio signal before being able to query the capture audio format. However we need the capture sample rate to decide which frequencies we generate. For now we use the playback rate and check that it's the same as the capture rate. Another limitation is that the DP receiver reports an unknown sampling rate during the 44.1KHz test. In this case we assume the capture rate is the same as the playback rate. We'll fail later anyway if this assumption is incorrect since we check the signal we receive. Chameleon bug: https://crbug.com/950913 Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-25tests/kms_chamelium: test audio channels are not mixed upSimon Ser
Send a different signal to each channel and make sure captured audio channels are not swapped or mixed up. The Chamelium device has a bug and already swaps the left and right channels. For this reason, clients need to retrieve the Chamelium channel mapping and accomodate for this. See https://crbug.com/950922 for a discussion about this. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-25tests/kms_chamelium: test we receive a signal from both audio channelsSimon Ser
This commit updates the audio test to make sure we receive a signal from both audio channels. However this commit doesn't check that left and right channels are not swapped. Such a check requires some more work (because the Chamelium device does swap left and right channels) and will be implemented in a future commit. This commit adds a new channel argument to audio_signal_add_frequency, to add a frequency to a single channel only. Some light refactoring has been performed: a proper audio_signal_fini function has been introduced and size_t in now used when it should be. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-25lib/igt_alsa: use variables to improve readabilitySimon Ser
Most people don't have "remember what the last two parameters of snd_pcm_set_params are" in their lifegoals list. Use variables so that it's clearer what those are. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-25lib/igt_{alsa, audio}: improve loggingSimon Ser
- Print matched audio devices - Print min/max values when alsa_test_configuration fails - Print debug log line when skipping a frequency Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-25tests/kms_chamelium: capture audio data in real-timeSimon Ser
Before this patch, the audio test first sends an audio signal for 2s, and then checks whether the captured signal matches. This patch makes it so we send and check the signal in parallel. Thus we can stop the test as soon as we receive the correct signal. This saves ~2s per audio test. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-25tests/kms_chamelium: add dp-audio testSimon Ser
This new test ensures DisplayPort audio works by using the Chamelium. It enables the DisplayPort output and sends an audio signal containing a set of frequencies we choose to all HDMI/DisplayPort audio devices. It starts recording audio on the Chamelium device and uses the stream server to retrieve captured audio pages. It then checks that the capture audio signal contains the frequencies we sent, and only those, by computing a FFT. A new library has been added to libigt to communicate with the stream server. It implements a simple custom TCP protocol. In case the test fails, a WAV file with the captured data is saved on disk. Right now the test has a few limitations: - Only the first channel is checked - IGT only generates audio with a single sampling rate (48 KHz) - Audio data is not captured in real-time These limitations will be lifted in future patches. PulseAudio must not run during the tests since ALSA is used directly. To ensure this, edit /etc/pulse/client.conf and add `autospawn=no`. Then run `pulseaudio --kill`. This commit deletes the existing audio tests. They weren't run and required an exotic configuration (HDMI audio splitter, dummy HDMI sink and a line-in port on the DUT). This patch also changes lib/igt_audio to use uint16_t instead of short. The rationale is: - The standard says a short is at least 16 bit wide, but a short can be larger (in practice it won't happen, but better use types correctly) - It makes it clearer that the audio format is S16_LE, since "16" is in the type name. This patch depends on the following Chameleon bugs: - https://crbug.com/948060 - https://crbug.com/950857 Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-24lib/igt_halffloat: fix compilation with ClangSimon Ser
The source file contains a special code-path for Clang, however this path fails to compile: ../lib/igt_halffloat.c:227:7: error: conflicting types for 'igt_half_to_float' float igt_half_to_float(const uint16_t *h, float *f, unsigned int num) ^ ../lib/igt_halffloat.h:26:6: note: previous declaration is here void igt_half_to_float(const uint16_t *h, float *f, unsigned int num); ^ 1 error generated. This commit fixes this mismatch. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-04-24lib/igt_dummyload: Clarify batch mappingMika Kuoppala
Use spin->condition to mark the spot we have saved for manipulating the looping condition. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-24lib/igt_dummyload: Introduce igt_spin_resetMika Kuoppala
Libify resetting a spin for reuse. v2: use also in perf_pmu v3: s/cmd_spin/cmd_precondition v4: remove early return for !spin (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-18lib/igt_fb: Add support for fp16 formats through conversionKevin Strasser
Follow design of P01x conversion to support tests needing pixel data in fp16 (half float 64 bpp). rfc2: - Convert whole rows of pixels if possible (Maarten) - Treat rgbx like rgba, let hardware ignore alpha (Maarten) Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-18lib: Add halffloat implementationKevin Strasser
Probe for and make an API available for tests to use f16c intrinsics to generate needed fp16 pixel data. Also import a pure c fp32 <-> fp16 conversion implementation from Mesa 18.3.4, which will act as a fallback when f16c is unavailable. rfc2: - Change API to reduce number of function calls (Maarten) v1: - Move pragma so AVX code isn't emitted for fallbacks (Ville) - Change edx to ecx (Ville) Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-18lib/igt_fb: Fix blitter limit checksVille Syrjälä
The earlier approach of checking the higher tiled stride limit has backfired. All out blits are between tiled and linear, but we only ever check this for the tiled fb. Thus we are taking the blitter path even though the linear fb exceeds the blitter limits. So let's just check the limits as if we are operating on linear fbs. And let's toss in some width/height checks, and let's do the checks for all the color planes as well. v2: Reword the comment a bit to hopefully make it legible (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-18lib/igt_fb: Nuke redundant rendercopy cairo surface variantVille Syrjälä
The blit and rendercopy implementations are now identical. Kill one. v2: s/__blit/__gpu/ (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-18lib/intel_batchbuffer: Make blitter asserts more usefulVille Syrjälä
Use igt_assert_lt/lte for the blitter coord/stride asserts so that we can see what the offending value was. gcc likes to optimize the values away so gdb often doesn't help as much as one would like. v2: Remove the duplicate CHECK_RANGE() definitions (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-18lib/igt_fb: Unref the renderecopy scratch bosVille Syrjälä
We're currently leaking all the temporary bos we construct for rendercopy. That doesn't go so well when trying to test with 1GiB framebuffers. v2: Add fini_buf() (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-18lib/igt_dummyload: Get rid of 'batch' on spinner accessorsMika Kuoppala
There is no guarantee that spinners are and will be implemented using batches. As we have igt_spin_t, manipulate it through igt_spin_* functions consistently and hide the batch nature. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-18lib/igt_dummyload: libify checks for spin batch activationMika Kuoppala
Instead of opencoding the poll into the spinner, use a helper to check if spinner has started. v2: use zero as presumed offset (Chris) v3: cleanup the relocs (Chris) v4: leave the domains to zero, avoid relocation (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-17lib/igt_edid: new library for generating EDIDsSimon Ser
For the purposes of testing different EDID features, we need to generate more and more complex EDID blobs (e.g. with audio support). However currently IGT uses a macro-based system to generate EDIDs. This doesn't scale well and is pretty inflexible. This commit introduces a new little library to generate EDIDs. For now it can't do more than the old macro. Future commits will extend the API. The structures are mostly based on the Linux kernel code (drm_edid.h). Setters have been added for convenience. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-04-16lib/igt_fb: Don't leak the bufmgr and batch for converted surfacesVille Syrjälä
Remember to free the bufmgr and batch after the convert surface is destroyed. We'll do that by sucking the relevant code into free_linear_mapping(), and for the sake of symmetry we'll move the setup code into setup_linear_mapping(). Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2019-04-16lib/igt_fb: Don't use blitter for large buffersVille Syrjälä
The blitter stride is limited to <32k. Fall back to gtt mmap or rendercopy if we're about to exceed that. Not quite sure why we're not just using gtt mmap for Y tiling always. But let's keep it like that for now. v2: Use rendercopy as the fallback for Yf v3: Deal with gen4+ tiled stride correctly (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-16lib/intel_reg: fix shift undefined behaviourSimon Ser
1<<31 (same as 2<<30) is undefined behaviour in C. When compiling with GCC and UBSan, it gives this error: ../tools/intel_reg_decode.c: In function ‘ivb_debug_port’: ../tools/intel_reg_decode.c:398:3: error: case label does not reduce to an integer constant case PORT_DBG_DRRS_HW_STATE_HIGH: ^~~~ This happens because 1<<31 isn't representable as a signed int. Instead, use an unsigned int. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-04-15tests/fbcon_fbt: Add and user psr_long_wait_update()José Roberto de Souza
When fbcon is enabled, PSR will be active between cursor blinks so what it should really use to test PSR is psr_wait_entry(), so a new feature callback was added. But the fbcon cursor blinks at 5hz what give us 200ms between each screen update what make psr_wait_update() prone to fail the test because it timed out before a blink could happen, so here adding and using psr_long_wait_update() that have a longer timeout. v3: - 3 previous patches squashed in this one (Maarten) - Back to !feature->wait_until_enabled() to test feature state when all CRTCS are disabled(Dhinakaran) Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinkaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-15tests/fbcon_fbt: Enable cursor blinkingJosé Roberto de Souza
If cursor blinking is disabled no screen updates will happen and fbcon_fbt subtests will fail, so lets enable cursor blink while running this test and restore to the previous value when exiting it. v4: - renaming restore fd (Dhinakaran) - saving previous value as char (Dhinakaran) - skipping test if not able to open cursor blink file (Dhinakaran) Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-10lib: Reset errno to 0 after isattyArkadiusz Hiler
Since igt_assert family of functions logs last errno we get a lot of those: "Last errno: 25, Inappropriate ioctl for device" isatty() seems to be the biggest offender in that area, so this patch should limit amount of confusing messages significantly. Cc: Martin Peres <martin.peres@linux.intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-04-10lib/igt_fb: Create AMD YUV buffers with AMD GEM IOCTLNicholas Kazlauskas
The kmstest_dumb_create API isn't suitable for creating multi-planar buffers since it tries to calculate the size based on the first plane's pitch only. AMDGPU requires that the luma pitch be aligned to 256 for YUV buffers which results in crashes on kms_plane@pixel-format-pipe-*-planes tests when using kmstest_dumb_create since the buffer returned is smaller than needed (16384 size returned, 24576 size required). Create and map the buffer with the correct size by using the AMD helpers introduced by this patch: igt_amd_create_bo and igt_amd_mmap_bo. Cc: Harry Wentland <harry.wentland@amd.com> Cc: Leo Li <sunpeng.li@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com>
2019-04-09lib: Use nr_open not file-max for setting fd rlimitChris Wilson
Petri pointed out that the maximum allowed number of files per process is nr_open, not the system cap of file-max. Suggested-by: Petri Latvala <petri.latvala@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110351 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-04-05lib: add igt_allow_unlimited_files()Lucas De Marchi
Share the implementation to tweak the maximum number of open files. The version in tests/i915/gem_exec_reuse.c was a little bit different, but I don't think it needs to be because it would still return a failure if any of the calls to setrlimit() fail. So I'm using the other one. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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-04-05lib/igt_gt: remove unnecessary argumentAndi Shyti
__for_each_engine_class_instance(fd, e) doesn't need and doesn't use the fd argument. Remove it. Signed-off-by: Andi Shyti <andi.shyti@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-04-05lib/igt_kms: Be more verbose about failure in kmstest_wait_for_pageflipArkadiusz Hiler
First, we set errno to 0 before doing select() to avoid random pollution of the assert message with things like: "Last errno: 25, Inappropriate ioctl for device" Second, we log explicitly if we exceeded the timeout (ret == 0). Third, if we fail the select() we log that with some explanation. Cc: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-04-04lib/rendercopy: Assert that buffer dimensions/stride are acceptableVille Syrjälä
Sprinkle some asserts into rendercopy to make sure we don't try to exceed the render engine surface size/stride limitations. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>