summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-25build: provide include for missing syscallsLucas De Marchi
Add directory with README file to allow missing syscalls to be defined. The syscalls themselves will be provided in follow up patches. v2: add support to autotools Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-25igt/drv_module_reload: Revamp fault-injectionChris Wilson
The current method of checking for a failed module load is flawed, as we only report the error on probing it is not being reported back by modprobe. So we have to dig inside the module_parameters while the module is still loaded to discover the error. v2: Expect i915.inject_load_failure to be zero on success v3: Do a full i915 unload to ensure fbdev is unbound in cases where it managed to bind itself before failure injection. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2018-07-25tests/kms_panel_fitting: Do not use scaling on gen7 and gen8, v2.Maarten Lankhorst
Except for ivy bridge, those platforms don't support scaling the sprite planes, so we fail with -ERANGE. Do the same as we do for gen9 pipe C, and do not attempt to scale the sprite plane. It will fail, and the kernel will no longer hide the failure from us. Changes since v1: - Extend from haswell to all of gen7/gen8 (except IVB). Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106606 Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-24igt/gem_exec_schedule: Trim deep runtimeChris Wilson
Time the runtime for emitting deep dependency tree, while keeping it full of umpteen thousand requests. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106707 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-24lib: Don't assert all KMS drivers support edid_overrideChris Wilson
edid_override is a i915.ko debugfs feature; just skip any kms test that depends on being able to override the edid. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107337 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-20lib/rendercopy: Fix lack of const throughout gen4 rendercopyChris Wilson
The gen4 code was pushed without being fixed up for the constification of igt_render_copyfunc_t ../lib/intel_batchbuffer.c: In function ‘igt_get_render_copyfunc’: ../lib/intel_batchbuffer.c:837:8: warning: assignment to ‘igt_render_copyfunc_t’ {aka ‘void (*)(struct intel_batchbuffer *, struct _drm_intel_context *, const struct igt_buf *, unsigned int, unsigned int, unsigned int, unsigned int, const struct igt_buf *, unsigned int, unsigned int)’} from incompatible pointer type ‘void (*)(struct intel_batchbuffer *, drm_intel_context *, struct igt_buf *, unsigned int, unsigned int, unsigned int, unsigned int, struct igt_buf *, unsigned int, unsigned int)’ {aka ‘void (*)(struct intel_batchbuffer *, struct _drm_intel_context *, struct igt_buf *, unsigned int, unsigned int, unsigned int, unsigned int, struct igt_buf *, unsigned int, unsigned int)’} [-Wincompatible-pointer-types] copy = gen4_render_copyfunc; Fixes: 61370b2d43db ("lib/rendercopy: Add gen4/5 rendercopy") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-20igt/gem_mmap_gtt: Check for known incoherency before testingChris Wilson
We test map_gtt coherency (whether or not a write via the mmap_gtt is immediately visible in the backing storage to a read via mmap_cpu) but we know that several platforms are inherently incorrect and require some form of hammer to workaround internal delays. These platforms break our ABI guarantees and so we report the change in ABI via a driver getparam. If we know the platform doesn't meet the ABI guarantee, skip the test. If it is meant to work, test! Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100587 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-07-19tests/psr: Add a few PSR tests to fastfeedback test list for some coverageDhinakaran Pandiyan
PSR tests are primarily executed on shards machines that do not have the required panels, the only test in fastfeedback does not do much. So add these tests to provide some meaningful coverage. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Martin Peres <martin.peres@linux.intel.com>
2018-07-19lib: Move trash_bos to their only userChris Wilson
Only pm_rpm still uses the igt_trash_aperture() and so we can remove it from the lib and in the process convert it over from the legacy libdrm_intel. 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>
2018-07-19trace.pl: Basic preemption supportTvrtko Ursulin
Just forget about earlier request_in events. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-19trace.pl: Fix incomplete request handlingTvrtko Ursulin
Incomplete requests (no notify, no context complete) have to be corrected by looking at the engine timeline, and not the sorted-by-start-time view as was previously used. Per-engine timelines are generated on demand and cached for later use. v2: Find end of current context on the engine timeline instead of just using the next request for adjusting the incomplete start time. v3: Improve scaling with large datasets by only walking each engine timeline once and some caching. (John Harrison) v4: * Fix logic fail from v3. * Refactor the code a bit to separate the stages better. * Do not account batches with unknown duration in avg stats. * Handle two user interrupts with the same seqno. * Handle user interrupt arriving after request_out. v5: * Update for class:instance. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: John Harrison <John.C.Harrison@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-19trace.pl: Improved key/coloursJohn Harrison
Improve the timeline legend to show actual context colours. v2: (Tvrtko Ursulin) * Commit msg. * Tweak layout for more compactness and more readability. v3: * Limit number of shown contexts in the legend. (John Harrison) v4: * Unbreak legend display with small context counts. (John Harrison) Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-19trace.pl: Improve context colouring for large context id'sTvrtko Ursulin
John reports that on a long runnning systems the huge disparity between kernel context and user context id's causes all interesting colours to be clustered too close together. Fix this by assigning colours to seen contexts instead of basing purely on context id's. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Suggested-by: John Harrison <John.C.Harrison@Intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-19trace.pl: Improve readability of graphical timeline representationTvrtko Ursulin
We add stripes for different stages of request execution so it is easier to follow one context in the multi-colour mode. Vertical stripe pattern indicates pipeline "blockages" - requests waiting for dependencies before they are runnable. Diagonal stripes indicate runnable requests waiting for GPU time. Horizontal strips are requests executing on the GPU. Also use this new multi-coloured mode from media-bench.pl. v2: John Harrison: * Mention media-bench.pl in the commit. * Fix HTML for single colour mode. v3: * Rebase. * Apply stripes to legacy colouring as well. v4: John Harrison: * Use per context colours for ctxsave and incomplete boxes. * Clearer timeline legend. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-19trace.pl: Improve time axis labelsTvrtko Ursulin
It is possible to customize the axis display so change it to display timestamps in seconds on the major axis (with six decimal spaces) and millisecond offsets on the minor axis. v2: * Give up on broken relative timestamps. v3: * Drop all date complications and just use micro seconds throughout. (John Harrison) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-18igt: Force eviction of test bo directlyChris Wilson
Currently we indirectly try to evict the test buffers by mmaping enough bo that should fill the aperture. However, this assumes that the kernel is trying to fill the aperture and does not use random replacement (which it does) or use small partials to avoid mmaping the whole object (which it does). Rather than assume, use the debugfs interface to force the eviction of the bound objects. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2018-07-18lib/gen6_render: Drop duplicated definitionsLukasz Kalamarz
Dropping duplicated definitions of registers,fields and shiftsm, which were implemented in gen4 and does not changed in gen6. v3: Rebase Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-18lib/rendercopy: Use gen4 definitions if applicableLukasz Kalamarz
Instead of using definitions duplicated in gen7_render header, we should use the oldest definition that is working with chosen gen. This patch reuse gen6 definitons if registers/fields/shifts that were introduced in other genX_render headers. v3: Rebase and checkpatch Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-18lib/rendercopy: Add gen4/5 rendercopyLukasz Kalamarz
Add rendercopy implementation for gen4/5. Basic structure copied from the gen6 implementation, and the gen4/5 specific bits were mostly lifted from sna. v2: Renamed registers definitions, which are GEN4 specific to include that prefix (Lukasz) v3: Rebase and checkpatch Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-18Update NEWS, bump version to 1.23.Arkadiusz Hiler
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-07-17tests/frontbuffer_tracking: Use the library functions to test PSR.Dhinakaran Pandiyan
kms_frontbuffer_tracking should test PSR the same way that kms_psr does. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-17tests/psr: Move PSR state test functions to libDhinakaran Pandiyan
kms_frontbuffer_tracking and kms_psr test PSR in different ways, let' fix that by creating common library functions. v2: Include the new file in meson.build v3: Leave --no-psr intact (Rodrigo) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-17tests/psr: Prepare for moving PSR state checking functions into libDhinakaran Pandiyan
Change the function arguments to not rely on test specific data as the following patches change kms_frontbuffer_tracking to reuse PSR functions. v2: Leave --no-psr intact (Rodrigo) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-17tests/sink_crc: Remove kms_sink_crc_basicDhinakaran Pandiyan
"drm/i915: Kill sink_crc for good" removes the kernel support for sink crc. References: https://patchwork.freedesktop.org/series/46039/ Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-17igt: Remove gvt_basicChris Wilson
This was always a placeholder for GVT stakeholders to provide some better tests. 2 years later and none have been put forward so stop wasting CI's time running a placeholder. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106989 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Zhi Wang <zhi.a.wang@intel.com> Acked-by: Martin Peres <martin.peres@linux.intel.com>
2018-07-17igt/kms_vblank: Check if hangs are allowedChris Wilson
Before running a hang test, check if we can inject a hang and expect recover to work. If we can't control a hang, skip the subtest. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-17tools/intel_dp_compliance: Use ARGB8888 format fbs for Gen 10Radhakrishna Sripada
According to Display WA #1172, to truly bypass the color data on Gen 10 use ARGB8888 instead of XRGB8888 to pass compliance. v2: Use ARGB8888 format only for video pattern fb, set per pixel alpha value to 0xff in fill_framebuffer.(Imre) v3: Set the aplha value for each pixel(Imre) Cc: Imre Deak <imre.deak@intel.com> Cc: Manasi Navare <manasi.d.navare@intel.com> Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com> Reviewed-by: Manasi Navare <manasi.d.navare@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com>
2018-07-16igt/gem_pwrite_snooped: Check for GEM before useChris Wilson
As we try to blit into the buffer to check CPU<->GPU snooping, we have to check we have a functional GPU first. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
2018-07-13tests/psr: Rename kms_psr_sink_crc.c to kms_psr.cDhinakaran Pandiyan
We don't use sink CRC anymore in this test. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-13tests/kms_psr_sink_crc: Test PSR source HW status before PSR entry.Dhinakaran Pandiyan
Wait for PSR HW status to show active before starting an PSR exit action. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-13tests/kms_psr_sink_crc: Do not test sink crcDhinakaran Pandiyan
eDP sink crc reads use vblank interrupts that cause PSR exit and therefore makes them unsuitable for PSR testing. Besides that, reading sink CRC via the AUX channel for testing when the HW also is most likely is going to be using AUX channel is a recipe for inconsistent test results. Thirdly, CRC's have been seen to be noisy/inconsistent across sinks. We tradeoff the ability to validate what the sink is displaying for correctness. We also make use of source PSR status register to check whether HW tracking triggered PSR exit upon an exit event. Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-13tests/frontbuffer_tracking: Do not test sink crcDhinakaran Pandiyan
eDP sink crc reads use vblank interrupts that cause PSR exit and therefore makes them unsuitable for PSR testing. Besides that, reading sink CRC via the AUX channel for testing when the HW also is most likely is going to be using AUX channel is a recipe for inconsistent test results. Thirdly, CRC's have been seen to be noisy or vary across sinks for the same driver and test code. We tradeoff the ability to validate what the sink is displaying for correctness. Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
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-07-13igt/gem_userptr: Check read-only mappingsChris Wilson
Setup a userptr object that only has a read-only mapping back to a file store (memfd). Then attempt to write into that mapping using the GPU and assert that those writes do not land (while also writing via a writable userptr mapping into the same memfd to verify that the GPU is working!) v2: Pull the random batch construction into a routine to avoid duplication. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-07-13tests/kms_flip: Print timevals as floatVille Syrjälä
Time intervals as produced by timersub() are normalized to have the tv_usec in the range 0-999999. That leads to very confusing looking debug output for negative interval. Eg. an interval of -0.1 seconds would be represented as tv_sec=-1, tv_usec=900000. Let's just convert the thing to a float seconds value and print that so that we'll get less confusing debug output. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-12igt/gem_unfence_active_buffers: Check GEM before useChris Wilson
As we want to make the buffers active on the GPU before removing their fence, an operational GPU (not wedged!) is required. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-12igt/gem_render_copy_redux: Check for GEM before useChris Wilson
As render copy wants to use the GPU, we should make sure it is not wedged first. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-12igt/gem_gpgpu_fill: Check for GEM before useChris Wilson
As we need GEM and the GPU to do a GPGPU fill, we should check that it is operable before using -- skipping rather than failing when the device is wedged. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-12igt/pm_rpm: Pass NULL to require no extra module optionsChris Wilson
We use options!=NULL to determine if we should require the module to be reloaded and fail if we find it already loaded. In pm_rpm, we are only ensuring the MSR module is loaded, and only want default options. Fixes: 4dc2ce0e ("lib/kmod: Fail if the module is already loaded") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2018-07-12trace.pl: Fix engine busy accounting in split modeTvrtko Ursulin
In split mode all requests have to be added up since they were previously re-arranged so there is no overlap. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: John Harrison <John.C.Harrison@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-12trace.pl: Put single context at single vertical slotTvrtko Ursulin
Turn off timeline stacking in favour of putting all the boxes belonging to a single context at the same vertical slot. Also remove the custom sorting function in favour of correctly assigning the subgroup id's and order which greatly speeds up the library operations. And finally remove the 'Toggle stacking' button which never worked. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-12trace.pl: Fix HTML timestamp generationTvrtko Ursulin
Now that we scale timestamps to get better timeline granularity, the hacky hand rolled micro-second time to HTML date conversion does no longer cut it. Use perl built-in gmtime to handle things properly. v2: Do not bother with the epoch since timeline times are relative to unknown system boot time. (John Harrison) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-12trace.pl: Fix no context colouring modeTvrtko Ursulin
Commit 87d2affc380da96ba66c258c5337c363fe8651ef ("trace.pl: Add support for colouring context execution"), due some dodgy attempts at patch splitting broke the legacy colouring mode. Fix it by passing in the request stage into the helper so all stages can be correctly coloured in both modes. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-07-12lib/igt_kms: simplify pipe <-> name conversionLucas De Marchi
Now that we can use _Static_assert() due to C11, make it future proof so we remember to update this if IGT_MAX_PIPES changes. Also reduce verbosity a little bit by calculating indexes instead of if/else chain. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-12lib/igt_core: fix check for running under gdbLucas De Marchi
Properly check for errors and rename the function since we are checking if we are running under gdb, not making it run under gdb. Previously we were passing uninitialized data to basename() due to not properly adding the nul termination. ==22293== Conditional jump or move depends on uninitialised value(s) ==22293== at 0x4C306D0: rindex (vg_replace_strmem.c:199) ==22293== by 0x4EC55DD: basename (in /usr/lib64/libc-2.27.so) ==22293== by 0x400744: running_under_gdb (in /tmp/a) There's another problem with this function that it doesn't detect when we are running gdb from a toolchain using a toolchain triplet, but that's left for another patch. v2: remove the fix for repeating the argument on readlink() since that landed in another patch Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-12build: bump c std to gnu11Lucas De Marchi
It's been a long time and all reasonable toolchains support gnu11 already. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-07-12tests/sw_sync: fix pthread start_routine declarationLucas De Marchi
pthread_create() expects a void *(*start_routine) (void *). Fix warning the following warning on gcc 8: ../tests/sw_sync.c:773:37: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type] pthread_create(&threads[i], NULL, (void * (*)(void *)) ^ Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-07-11Fix comparison that always evaluates to falseRodrigo Siqueira
This commit fix the GCC warning: warning: bitwise comparison always evaluates to false [-Wtautological-compare] } else if ((val & DPLLB_MODE_LVDS) == DPLLB_MODE_DAC_SERIAL) { The first comparison already checks DPLLB_MODE_LVDS, in this sense, the second 'if' condition always will be false. This commit changes the comparison to DPLLB_MODE_DAC_SERIAL. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-11Avoid truncate string in __igt_lsof_fdsRodrigo Siqueira
Note that 'proc_path' parameter in __igt_lsof_fds receives a string which was initialized with the size of PATH_MAX and the local variable 'path' has the same size, but it also have to append: '/', '\0', and the directory name. This situation caused the warning described below. warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Wformat-truncation=] snprintf(path, sizeof(path), "%s/%s", proc_path, d->d_name); note: ‘snprintf’ output between 2 and 4352 bytes into a destination of size 4096 [..] This commit fixes this problem by changing the string size passed by __igt_lsoft to __igt_lsof_fds. The max size for the string is strlen("/proc/%d/cwd")+1 where "%d" can be estimated with CEILING(LOG_10(INT_MAX)), in this sense, it is safe to define a path size of 30 characters. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-11Remove parameter aliases with another argumentRodrigo Siqueira
This commit fixes the following GCC warning: warning: passing argument 2 to restrict-qualified parameter aliases with argument 1 [-Wrestrict] return (readlink (buf, buf, sizeof (buf)) != -1 && This commit fixes the GCC warning by creating a second buffer only to keep the path. v2: make pathname smaller (A. Hiler) Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>