summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-16tools/intel_residency: adopt intel_residency to use bufopsZbigniew Kempczyński1-6/+4
IGT draw functions remove libdrm dependency so migrate to new API. 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-16tests/perf: remove libdrm dependency for rendercopyZbigniew Kempczyński1-382/+293
Rendercopy now uses no-drm version so all users has to migrate to new interface. vx: it seems we've problem with GEM_MMAP_OFFSET mapping so for !llc platforms device mapping is used. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16lib/rendercopy_bufmgr: remove rendercopy_bufmgrZbigniew Kempczyński4-202/+0
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-16tests/gem_render_tiled_blits: remove libdrm dependencyZbigniew Kempczyński1-46/+43
Use intel_bb / intel_buf to remove libdrm dependency. 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-16tests/gem_render_linear_blits: remove libdrm dependencyZbigniew Kempczyński1-58/+32
Use intel_bb / intel_buf to remove libdrm dependency. 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-16tests/gem_render_copy_redux: remove libdrm dependencyZbigniew Kempczyński1-38/+29
Use intel_bb / intel_buf to remove libdrm dependency. 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-16tests/gem_render_copy: remove libdrm dependencyZbigniew Kempczyński1-190/+123
Use intel_bb / intel_buf to remove libdrm dependency. 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-16tests/gem_read_read_speed: remove libdrm dependencyZbigniew Kempczyński1-79/+82
Use intel_bb / intel_buf to remove libdrm dependency. 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-16tests/gem_stress: remove libdrm dependencyZbigniew Kempczyński1-115/+129
Use intel_bb / intel_buf to remove libdrm dependency. 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-16tests/gem_ppgtt: remove libdrm dependencyDominik Grzegorzek1-102/+80
Use intel_bb / intel_buf to remove libdrm dependency. 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16tests/gem_concurrent_all: remove libdrm dependencyDominik Grzegorzek1-216/+223
Use intel_bb / intel_buf to remove libdrm dependency. 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16tests/gem_caching|partial: adopt to batch flush function cleanupZbigniew Kempczyński2-8/+0
intel_bb API has been cleaned so flush generates also BBE and executes the batch. Remove redundant code to use flush properly. 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-16tests/kms_psr: remove libdrm dependencyDominik Grzegorzek1-59/+78
Use intel_bb / intel_buf to remove libdrm dependency. 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16tests/kms_fronbuffer_tracking: remove libdrm dependencyDominik Grzegorzek1-11/+9
Use intel_bb / intel_buf to remove libdrm dependency. 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16tests/kms_draw_crc: remove libdrm dependencyDominik Grzegorzek1-11/+9
Use intel_bb / intel_buf to remove libdrm dependency. 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16tests/kms_big_fb: remove libdrm dependencyZbigniew Kempczyński1-28/+41
Use intel_bb / intel_buf to remove libdrm dependency. 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-16lib/igt_fb: Removal of libdrm dependencyDominik Grzegorzek1-42/+57
Adopt to intel_bb/intel_buf for libdrm removal. 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-09-16lib/igt_draw: remove libdrm dependencyZbigniew Kempczyński2-84/+81
Change rendercopy to use intel_bb to remove libdrm dependency. Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@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-16tests/api_intel_bb: add render testsZbigniew Kempczyński2-7/+334
Check render / render-ccs tests works fine on all supported gens. 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-16lib/rendercopy: remove libdrm dependencyZbigniew Kempczyński13-2704/+2430
Use intel_bb as main batch implementation to remove libdrm dependency. Rewrite all pipelines to use intel_bb and update render|vebox_copy function prototypes. Note that this will introduce compile failures into the indiviual users until they are transitioned over to the new interface in the following patches. The process is completed with "lib/rendercopy_bufmgr: remove rendercopy_bufmgr." 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-16tests/api_intel_bb: test flags are cleared on bb resetZbigniew Kempczyński1-0/+83
Current intel_bb implementation keeps objects in the bb cache so subsequent executions pass these objects also to execbuf. Check flags are cleaned after reset. 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-16lib/intel_batchbuffer: address review comments (base64 dump)Zbigniew Kempczyński1-14/+8
Simplify base64 dump + add linelen. 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-16lib/intel_batchbuffer: fix intel_bb cacheZbigniew Kempczyński2-49/+127
When objects array is reallocated index tree contains invalid pointers and we got segmentation fault. Fix changes of the strategy of keeping objects - now we have two indexes - cache (all objects added previously to the bb) and current (contains objects added after soft bb reset). 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-16lib/intel_batchbuffer: use canonical addresses for 48bit ppgttZbigniew Kempczyński2-5/+76
For all EXEC_OBJECT_PINNED objects we need to be sure address passed must be in canonical form. Until IGT allocator will be written just limit 48 and 47 bit gtt tables to 46 bit only. We don't want to play with canonical addresses with 47-bit set to 1 (and then 63:48). 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-16lib/intel_batchbuffer: dump bb to base64Zbigniew Kempczyński2-0/+43
Code for dumping bb to log as base64 which can be used when something wrong happened. 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-16lib/intel_batchbuffer: add new functions to support rendercopyZbigniew Kempczyński2-46/+342
To cover rendercopy in dependent tests we need to add the following: 1. relocation in any handle Previously batchbuffer was the main target of relocations. As AUX table require relocations too add support for that in intel_bb 2. set/get default alignment Add default alignment for objects added to intel_bb (AUX tables use different alignment for different objects) 3. add intel_buf to intel_bb Save proposed address to intel_buf, clear flags on reset 4. add set/clear flag functions 5. unification of intel_bb_flush.*() functions 6. fixing indentation 7. change alignment constraints on gen3 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-16lib/intel_bufops: clarify buffer ownership rulesZbigniew Kempczyński2-7/+82
To avoid intel_buf handle leakage we need to clarify of buffer ownership rules. So we currently have: 1. intel_buf_init(), intel_buf_create() which create handle and take ownership of such handle. 2. intel_buf_init_using_handle(), intel_buf_create_using_handle() which take bo handle from the caller and doesn't take ownership. intel_buf_close()/intel_buf_destroy() will honour ownership and skip closing handle if buffer is not owned. To take/release buffer ownership intel_buf_set_ownership() can be used. 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-16lib/intel_bufops: add support for 64bit bppZbigniew Kempczyński1-1/+1
Previous assert checking was to narrow and it didn't support 64bpp. Some kms tests use 64bpp so extend the assert. 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-16lib/intel_bufops: change stride requirements for GrantsdaleZbigniew Kempczyński1-18/+15
Grantsdale requires 512 stride on Y tiling. v2: Remove redundant code for getting the stride Fix using not initialized buf->tiling field (reported by Dominik) 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-16lib/intel_bufops: change in hw/sw tiling detectionZbigniew Kempczyński1-8/+35
Not all swizzling can be handled by the software (bit17) so detect it properly during bufops creation time and disable if necessary. 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-16lib/intel_bufops: add mapping on cpu / deviceZbigniew Kempczyński2-16/+126
Simplify mapping intel_buf. To be extended with ref counting. Add intel_buf dump function for easy dump buffer to the file. Fixing returned type of bo size function. Idempotency selftest is now skipped for default buf_ops creation to avoid time consuming comparison of HW and SW tiled buffers (this can be the problem for forked tests). Additional function buf_ops_create_with_selftest() was added to allow perform verification step where it is required. Changing alignment from 4->2 (required for 16bpp render). 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-16tools: add support for msm_dp_compliance to IGTAbhinav Kumar4-0/+834
Add support for msm_dp_compliance to igt tools to validate video pattern DP compliance tests on MSM chipsets. changes in v2: - fix indentation in meson file Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-09-16tools: move terminal utility functions to a separate fileAbhinav Kumar5-48/+93
Move the terminal utility functions to a separate file so that other modules can use it as well. Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-09-16lib/igt_fb: move the CTS fill framebuffer to igt_fb libAbhinav Kumar3-60/+78
The function to fill the framebuffer with the CTS pattern is generic. Move it to the igt_fb layer so that it can be used by other modules. changes in v2: none Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-09-16lib/igt_kms: move some of the useful dump functions to igt_kmsAbhinav Kumar3-90/+115
Some of the functions inside the intel_dp_compliance are generic and can be used by other modules as well. Move these to the igt_kms lib. changes in v2: - add more documentation for the new APIs in the lib Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-09-16tools: rename intel_dp_compliance_hotplug to igt_dp_compliance_hotplugAbhinav Kumar5-12/+15
Rename intel_dp_compliance_hotplug to igt_dp_compliance_hotplug so that other modules can use the APIs. changes in v2: none Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-09-15lib/i915/perf: rework perf counters equationsLionel Landwerlin18-131/+126
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-14tests/device_reset: Work around for driver unbind issue with audioUma Shankar1-0/+11
Unbinding the i915 driver on some Haswell and Broadwell platforms with Azalia audio results in a kernel WARNING on "i915 raw-wakerefs=1 wakelocks=1 on cleanup". The issue can be worked around by manually enabling runtime power management for the conflicting audio adapter. Use that method but also display a warning to preserve visibility of the issue. Also tag the workaround with a FIXME comment. Suggested-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Signed-off-by: Uma Shankar <uma.shankar@intel.com> Reviewed-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
2020-09-14intel-ci: Add core_hotunplug@unbind-rebind to BAT scopeJanusz Krzysztofik1-0/+1
Unbinding and rebinding the driver to a device scenario is a subset of unloading and reloading the module and should give equally correct results. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-09-14intel-ci: Un-blocklist *bind* subtests of core_hotunplugJanusz Krzysztofik1-1/+1
Subtests which don't remove the device, only unbind the driver from it, seem relatively safe and harmless for CI. Remove them from the CI blocklist. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-09-14tests/core_hotunplug: Duplicate debug messages in dmesgJanusz Krzysztofik1-9/+15
The purpose of debug messages displayed by the test is to make identification of a subtest phase that fails more easy. Since issues exhibited by the test are mostly reported to dmesg, print those debug messages to /dev/kmsg as well. v2: Rebase on upstream. v3: Refresh. v4: Refresh. v5: Refresh. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: HSW/BDW audio issue workaroundJanusz Krzysztofik1-0/+15
Unbinding the i915 driver on some Haswell and Broadwell platforms with Azalia audio results in a kernel WARNING on "i915 raw-wakerefs=1 wakelocks=1 on cleanup". The issue can be worked around by manually enabling runtime power management for the conflicting audio adapter. Use that method but also display a warning to preserve visibility of the issue. Also tag the workaround with a FIXME comment. v2: Extend the scope of the workaround over Broadwell Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: Check health both before and after late closeJanusz Krzysztofik1-6/+20
In hot rebind / hot replug subtests, device health is now checked only at the end of the subtest, after late close. If something fails, we may be not able to identify the failing phase of the subtest easily. Run health checks also before late closing the device, right after hot rebind / replug. For still being able to perform late close while also handling cleanup of potential device close misses in health checks, we need to maintain two separate device file descriptors in our private data structure. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: Add 'lateclose before restore' variantsJanusz Krzysztofik1-12/+66
If a GPU gets wedged during driver rebind or device re-plug for some reason, current hotunbind/hotunplug test variants may time out before lateclose phase, resulting in incomplete CI reports. Add new test variants which close the device before restoring it. Also rename old variants to more adequate hotrebind/hotreplug-lateclose and perform health checks both before and after late close. v2: Rebase on upstream. v3: Refresh, - further rename hotunbind/hotunplug-lateclose to hotunbind-rebind and hotunplug-rescan respectively, then add two more variants under the old names which only exercise late close, leaving rebind / rescan to be cared of in the post-subtest recovery phase, - also update descriptions of unmodified subtests for consistency. v4: Refresh, - drop subtests with no health checks, adjust timeouts in successors, - perform health checks of hot restored devices also before late close, - in order to be able to safely run a health check while still keeping an unbound / unplugged device instance open, also preserve the open device fd, not only a close error, - adjust subtest descriptions. v5: Refresh, - split out pre-lateclose health checks and related changes, introduced in v4, to a separate patch. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: More thorough i915 healthcheck and recoveryJanusz Krzysztofik1-14/+101
The test now assumes the i915 driver is able to identify potential hardware or driver issues while rebinding to a device and indicate them by marking the GPU wedged. Should that assumption occur wrong, the health check phase of the test would happily succeed while potentially leaving the device in an unusable state. That would not only give us falsely positive test results but could also potentially affect subsequently run applications. Then, we should examine health of the exercised device more thoroughly and try harder to recover it from potentially detected stalls. We could use a gem_test_engine() library function which submits and asserts successful execution of a NOP batch on each physical engine. Unfortunately, on failure this function jumps out of an IGT test section it is called from, while we would like to continue with recovery steps, possibly not adding another level of test section group nesting. Moreover, the function opens the device again and doesn't close the extra file descriptor before the jump, while we care for being able to close the exercised device completely before running certain subtest operations. Then, reimplement the function locally with those issues fixed and use it as an i915 health check. Call it also on test startup so operations performed by the test are never blamed for driver or hardware issues which may potentially exist and be possible to detect on test start. Should the i915 GPU be found unresponsive by the health check called from a recovery section, try harder to recover it to a usable state with a global GPU reset. For still more effective detection of GPU hangs, use a hang detector provided by IGT library. However, replace the library signal handler with our own implementation that doesn't jump out of the current IGT test section on GPU hang so we are still able to perform the reset and retry. v2: Skip i915 health check if a GPU hang has been already detected by a previous health check run and not yet recovered with a GPU reset, - take care of stopping a hang detector instance possibly left running by a failed health check attempt. v3: Re-run i915 health check as a first setp of i915 recovery (use full GPU reset as a last resort), - prefix i915 health check debug messages with step indicators, - fix spelling error in a comment. v4: Unbind the driver from an unhealthy device before recovery, - drop caches on i915 health check completion. v5: Refresh on top of a new patch added to the series which already unbinds the driver form a device found unhealthy and runs health checks on test startup, - no need to drop caches from the i915 health check, it seems to do its job correctly without that. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: Also check health of render device nodeJanusz Krzysztofik1-11/+31
Failures of subsequent tests accessing the render device node have been observed on CI after late close of a hot rebound device. Extend our health check over the render node to detect that condition and start our recovery phase with unbinding the driver from the device found faulty. Also, check health of both device nodes before running any subtests. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: Explicitly ignore unused return valuesJanusz Krzysztofik1-3/+3
Some return values are not useful and can be ignored. Wrap those cases inside igt_ignore_warn(), not only to make sure compilers are happy but also to clearly document our decisions. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: Assert expected device presence/absenceJanusz Krzysztofik1-0/+14
Don't rely on successful write to sysfs control files, assert existence / non-existence of a respective device sysfs node as well. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: Process return values of sysfs operationsJanusz Krzysztofik1-4/+10
Return values of driver bind/unbind / device remove/recover sysfs operations are now ignored. Assert their correctness. v2: Add trailing newlines missing from igt_assert messages. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2020-09-14tests/core_hotunplug: Let the driver time out essential sysfs operationsJanusz Krzysztofik1-18/+20
The test now arms a timer before performing each driver unbind / rebind or device unplug / bus rescan sysfs operation. Then in case of issues we may prevent the driver from showing us if and how it can handle them. Don't arm the timer before sysfs operations which are essential for a subtest. v2: Refresh, - don't time out on hot driver rebind / hot device restore in *-lateclose variants, those operations haven't been covered by other subtests. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>