summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2020-07-21lib/kms: Skip igt test cases for disabled display pipesMohammed Khajapasha1-3/+2
Skip igt test cases for disabled pipes. Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-21lib/igt_kms: Add igt_require_pipe() functionMohammed Khajapasha2-0/+30
Add igt_require_pipe() fn to check whether a pipe is enabled or not Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-21lib/igt_kms: Add support for display with non-contiguous pipesMohammed Khajapasha2-14/+68
Add support for non-contiguous pipe display by allocating upper bound pipes array for display. With non-contiguous pipes display, pipe mapping is always not same as crtc mapping, For i915 pipe is enum id of i915's crtc object and it is not equal to crtc offset of a pipe in mode config list. Hence allocating upper bound array for igt_pipe and reading pipe id using GET_PIPE_FROM_CRTC_ID ioctl. Example: With a non-contiguous pipes PIPE_A & PIPE_D are enabled, PIPE_C & PIPE_B disabled configuration, the pipe enum for PIPE_A & D will be '0' and '3' and crtc offsets are '0' & '1' in mode config list, to ordering crtcs in drm with enabled pipes allocating upper bound pipes array. v6: Updated commit description as per review comments <Hiler, Arkadiusz> Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-16lib/igt_fb: change comments with fd descriptionMelissa Wen1-2/+2
Generalize description of fd so as not restrict it to i915 driver Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-15tests/i915/gem_huc_copy: Enable a HuC copy testSally Qi6-0/+197
This test case loads the HuC copy firmware to copy the content of the source buffer to the destination buffer. v2: (Tony Ye) * Restructured some functions and files. * Defined the copy buffer size as 4K explicitly as the HuC Copy kernel always copy 4K bytes from src buffer to dst buffer. v3: (Feng Qi, Antonio Argenziano, Tony Ye) * Restructured some functions as igt requested, exclude libdrm function call. * Remove huc function wrappers * Random initialize source input buffer v4: (Robert Fosha) * Fix autotools build failure. v5: (Feng Qi, Tony Ye) * Released all bo buffer after huc copying. * Restructured huc_copy() function. v6: (Feng Qi) * Fixed the function of huc enabling and status check * Added huc_copy to fast feedback testlist v7: (Tony Ye, Feng Qi, Robert Fosha, Chris Wilson, Michal Wajdeczko) * Check error with HUC_STATUS ioctl instead of debugfs v8: (Antonio Argenziano) * Remove unnecessary variable. * Add huc_load subtest. * Move failure checks out of igt_fixture. * get_huc_status() returns errno and then status as a parameter v9: (Antonio Argenziano) * Remove huc_load subtest - to be added later. v10: * Rebase * Remove huc_load subtest from fast-feedback.testlist. Signed-off-by: Feng Qi <feng.qi@intel.com> Signed-off-by: Tony Ye <tony.ye@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2020-07-13lib/i915: Open primary sysfs for engine attributesChris Wilson1-0/+51
The engine attributes are only found on the primary sysfs node, not the render nodes. If we are passed in a render node, we need to find the corresponding primary node. We can do this by searching the character devices for a primary minor index for the same exact device. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-07-12lib/i915: Set NO_RELOC flag for spinnersChris Wilson1-4/+4
We write the addresses into the batch and fill in the presumed_offset and execobj.offset correctly, so we meet the no-relocation requirements and so can normally avoid relocations. In order to let the kernel know it can trust us, we should also set the I915_EXEC_NO_RELOC flags. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-07-08lib: Sync i915 PCI idsJosé Roberto de Souza1-0/+13
Two new patches landed in kernel adding new PCI ids: 123f62de419f ("drm/i915/rkl: Add RKL platform info and PCI ids") 52797a8e8529 ("drm/i915/ehl: Add new PCI ids") Cc: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2020-07-08lib/igt_chamelium: Wait for connectors after replugging them at exitImre Deak1-0/+5
Making sure all the plugged chamelium ports are connected at exit So the FB console restore modeset doesn't happen on a disconnected output, resulting in link training failures. Cc: Kunal Joshi <kunal1.joshi@intel.com> Cc: Lyude Paul <lyude@redhat.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Tested-by: Kunal Joshi <kunal1.joshi@intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Kunal Joshi <kunal1.joshi@intel.com>
2020-07-08lib/igt_chamelium: Duplicate the caller's drm_fdImre Deak1-1/+5
Take a copy of the caller's FD so that the Chamelium lib functions can access the DRM file regardless of when the caller closes its own FD. This is needed at least by the next patch. Cc: Lyude Paul <lyude@redhat.com> Cc: Kunal Joshi <kunal1.joshi@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Kunal Joshi <kunal1.joshi@intel.com>
2020-07-08lib/igt_chamelium: Sanitize the init error and deinit pathImre Deak1-3/+3
Always return NULL from init in case of an error, and reuse chamelium_deinit_rpc_only() for symmetry with init, instead of open-coding the same. Cc: Lyude Paul <lyude@redhat.com> Cc: Kunal Joshi <kunal1.joshi@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Kunal Joshi <kunal1.joshi@intel.com>
2020-07-07lib/igt_fb: remove extra parameters from igt_put_cairo_ctxMelissa Wen2-11/+9
The function igt_put_cairo_ctx currently requires three parameters, but only one of them is used in it. This patch removes the useless parameters, making the code more readable and cohesive. It also applies the change to all occurrences of the function in the code. Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-06lib/bufops: add surface array to cover ccs pgtableZbigniew Kempczyński5-69/+79
Rendercopy for gen12+ requires additional aux pgtable. Alter bufops and tests to use surface[] and ccs[] instead aux. This step is required to properly rewrite handling aux pgtable to use with intel_bb. 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-07-03lib/intel_bufops: Add new functions and intel_buf fieldsZbigniew Kempczyński2-10/+150
This is minor step toward removing libdrm from rendercopy. Lets add new functions and structure fields to verify we don't introduce regressions in already migrated code. Some utility functions - write buf/aux (ccs) to png were added. 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-07-03lib/intel_batchbuffer: Extend intel_bbZbigniew Kempczyński3-63/+550
As we're going toward removing libdrm from rendercopy tests some additional code in intel_bb is required. So add new functions and fix memory issues in the reset path. 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-07-03lib: Fix interface descriptor fillsMika Kuoppala1-0/+4
For gen8+ we need to increment the pointer for interface descriptor size amount. Otherwise the next indirect item introduced will overwrite our descriptor. Apparently this has not caused much havoc as interface descs has been the last item. Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-07-02i915/gem_exec_await: Update to use __for_each_engine_physicalChris Wilson1-1/+1
Use the more recent engine iterator so we access all physical engines. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-06-26lib: Use generic names for APIs that handle ueventsAnkit Nautiyal3-20/+20
The functions for handling uevents are named with "_hotplug" as suffix such as igt_watch_hotplug(). Earlier hotplug was the only uevent that was requested to be detected, but in fact, these APIs are generic and can be used for detecting other uevents too. Currently we have tests like kms_lease, kms_content_protection using the uevent handling infrastructure for detecting uevents other than hotplug. This patch renames the functions and replace the "_hotplug" suffix with "_uevents". v2: Rebase v3: Added changes in lib igt_chamelium.c, that was missed earlier. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Suggested-by: Ramalingam C <ramalingam.c@intel.com> Suggested-by: Hiler, Arkadiusz <arkadiusz.hiler@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-06-26lib/igt_kms: Add support for detecting connector eventsAnkit Nautiyal2-18/+55
Currently, the event_detect function checks the property val for "HOTPLUG" and "LEASE" both of which are set to '1' when these events are sent. This cannot be used for detecting connector events such as HDCP event as connector events are sent along with property to signify which property of which connector has changed. Connector ID and property id are provided along with "CONNECTOR" and "PROPERTY" as udev property-value pairs. Eg. for HDCP, the connector id of the connector whose hdcp status changed, and the property id of the ‘CONTENT_PROTECTION’ property are sent with uevent. This patch modifies the event_detect function to check multiple properties with different expected values. It also adds support to detect connector event for a given pair of connector and property ids. v2: Simplified the event_detect conditional statements. (Ram) Changed the api name for detecting connnector events. (Anshuman) Added check for "HOTPLUG" property value for connector events. v3: Used ARRAY_SIZE() instead of constants. (Ram) v4: Rebase Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-06-22igt/core: Disallow igt_require/skip in non-main threadsArkadiusz Hiler2-1/+36
Handling magic control blocks and longjmp() out of them in threads is hard. The test should state the requirements before it starts spinning threads. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-22lib/core: Handle asserts in threadsArkadiusz Hiler6-0/+263
Since IGT is using magic control blocks (igt_subtest et al.) asserts jump out the them using longjmp() causing a bunch of confusing messages and occasionally crashing the whole process. This is not the behavior we want :-) With this patch: 1. simple_main, dynamic and subtest each clears the thread failure state at the start 2. each of those blocks also asserts no thread failures at the end 3. igt_assert() in non-main thread prints out the error + stacktrace and marks that we have failed thread Issue: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/55 Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-22lib/core: Print thread:tid with igt_log for non-main threadsArkadiusz Hiler5-7/+103
So that we know what's the source of messages. igt_thread.c is created to facilitate more threading-related functionality that will come in the following patch. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-15scripts/generate_clear_kernel: Clean up header license/copyright.Rodrigo Vivi2-48/+4
SPDX header already states it is MIT, no need for duplication on the copyright notice. Reference: https://lists.freedesktop.org/archives/intel-gfx/2020-June/241548.html Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-12lib/i915: Fix GTT offset for 64bChris Wilson1-1/+3
Large GTT do not fit into the 32b local, use a 64b and limit to [2G-3G]! Fixes: 0421ebe98f0b ("lib/i915: Increase range for randomised location of dummyload") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-06-12lib/i915: Increase range for randomised location of dummyloadChris Wilson1-1/+3
Suggest a wider range of possible relocations to reduce the chance of colliding with a framebuffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-06-12tests/kms_psr2_su: Print errno while it fails to read debugfsGwan-gyeong Mun1-3/+12
This tests is being sporadically skipped in CI as it is not due "PSR sink not reliable: yes". This commit adds printing of debugfs ("tests/kms_psr2_su: Print debugfs when skipping test"), but it is not enough to track error cases. It adds printing of errorno while it fails to read debugfs. Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2020-06-10lib/drmtest: Don't write ffffffff to a numeric paramPetri Latvala1-1/+1
__cancel_work_at_exit writes -1 to param "reset", with the intention that it's "any available method". Hex values to numeric params should be prefixed with 0x to be parsed as a number. Use the convention of %u with -1 as is used elsewhere with the "reset" param. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-06-08python: Stop using cElementTreeArkadiusz Hiler1-1/+1
It got removed in Python 3.9 and ever since Python 3.3 it's: from xml.etree.ElementTree import * Link: https://docs.python.org/3.9/whatsnew/3.9.html#removed Issue: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/86#note_520308 Cc: Petri Latvala <petri.latvala@intel.com> Cc: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-08lib/igt_device_scan: Add extra helpers for intel_gpu_topAyaz A Siddiqui2-13/+74
Will be used in the next patch. 1. set_pci_slot_name(): stores PCI_SLOT_NAME from prop to device 2. igt_device_find_first_discrete_card(): try to find first discrete GPU 3. igt_devices_free(): Free device buffers created during scan Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-08lib/igt_device_scan: Make igt_device_scan independent from igt_coreAyaz A Siddiqui6-8/+86
igt_device_scan can now be used as a separate library which only depends glib and libudev - some IGT internals are being stubbed in this case. v2: (mostly) sort includes (Lucas) Cc: Lucas De Marchi <lucas.de.marchi@gmail.com> Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-08lib/igt_device_scan: Add missing Check for return value in scan_drm_devicesAyaz A Siddiqui1-1/+1
Return value of udev_enumerate_add_match_property() was not being checked in scan_drm_devices(). Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-06-06i915/i915_pm_sseu: remove libdrm dependencyZbigniew Kempczyński2-410/+67
Remove all "localized" functions in media spin and libdrm usage in the test. 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-06-06lib/intel_batchbuffer: add bb resetZbigniew Kempczyński2-15/+81
For some scenarios we want to keep previous objects and their offsets and recreate only batchbuffer object. To allow user do that add bb reset function which can or not purge collected objects from previous run. 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-06-06lib/intel_bufops: add fields for keeping offset and contextZbigniew Kempczyński2-3/+7
To avoid relocations when intel_buf is used we need to keep previous offset and context. Add addr structure with offset and ctx fields. 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-06-04lib/igt_core: Don't kill the world after a failed forkArkadiusz Hiler2-10/+15
If we fail to fork (e.g. due to restrictive limits) -1 gets written as PID of our child and we assert out. The cleanup that happens afterwards tries to kill all our children, which ends up in kill(-1, SIGKILL) which is not good. This patch makes sure of two things: * -1 doesn't get written down as our child * when we are killing children we make sure that pid > 0 Reported-by: Fei Yang <fei.yang@intel.com> Cc: Michael Hebenstreit <michael.hebenstreit@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Tested-by: Michael Hebenstreit <michael.hebenstreit@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-06-03i915: purge i915_gem_create_v2Matthew Auld2-73/+0
The gem_create_v2 uapi was never merged, which would have been a nice addition to allow userspace to utilise stolen memory. Since it can only get in the way at this point, let's just remove it. Signed-off-by: Matthew Auld <matthew.auld@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-06-02tests/kms_psr2_su: Print debugfs when skipping testJosé Roberto de Souza2-0/+14
This tests is being sporadically skipped in CI as it is not due "PSR sink not reliable: yes" lets print the i915_edp_psr_status to find out the reason. This can be reverted afterwards. Reference: https://gitlab.freedesktop.org/drm/intel/-/issues/1911 Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2020-06-02tests/kms_psr2_su: Read su blocks of frame 1 if frame 0 is 0José Roberto de Souza1-1/+9
Not sure why but in recent kernels + IGT when PSR status debugfs is read the frame already passed, so the su blocks is set in frame 1 and causing the test to fail for page flips. So here reading from frame 1 if frame 0 has 0 blocks, as this test always changes screen with the same number of su blocks it is not a issue. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/608 Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2020-06-01tests/kms_fbcon_fbt: When restoring fbcon always set mode to text modeJosé Roberto de Souza2-0/+12
If by some reason or tests, this tests is executed and VT mode is already in KD_GRAPHICS the call to kmstest_set_vt_graphics_mode() will set orig_vt_mode as KD_GRAPHICS and when it was calling kmstest_restore_vt_mode() it would set KD_GRAPHICS again not returning to fbcon and causing the test to fail. As it can be seen here: (kms_fbcon_fbt:11004) igt_kms-DEBUG: VT: graphics mode set (mode was 0x1)" https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_499/fi-ehl-1/igt@kms_fbcon_fbt@fbc.html So here adding a new function to alaways set mode the KD_TEXT when we want to restore to fbcon. Reviewed-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2020-06-01tests/gem_(gpgpu|media)_fill: remove the _v2 suffixZbigniew Kempczyński8-1541/+336
Remove libdrm functions and replace them with new ones after removing _v2 suffix introduced for transition state. 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-06-01lib/media_spin: localize pipeline functionsZbigniew Kempczyński1-1/+363
To allow remove "_v2" suffix in functions add this not-fully-clean step and localize names. Some additional requirement is needed to fulfill its needs (passing batchbuffer from the caller side). 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-06-01lib/kms_chamelium: Wait for the sink to reconnect after an FSM DPMS-offImre Deak1-15/+32
After Chamelium does an FSM signaling by deasserting its HPD, in response to which the test's FSM handler disables the output with a DPMS-off, we have to make sure that Chamelium has reasserted its HPD before we re-enable the output with DPMS-on (for instance to avoid link training errors, or enable the output in the wrong TypeC mode). To ensure this wait for the connector state to become asserted. On TypeC connectors with an enabled mode the IOM firmware will signal a connected state (via a connect hotplug interrupt delivered to the driver) in a deferred way only after the mode is disabled. So wait for the connected state after DPMS-off. Reported-and-tested-by: Kunal Joshi <kunal1.joshi@intel.com> Cc: Hiler Arkadiusz <arkadiusz.hiler@intel.com> Cc: Kunal Joshi <kunal1.joshi@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-05-26lib/i915: Restore hangcheck modparams between testsChris Wilson1-0/+8
The hangcheck/reset modparam has far reaching effects and disables functionality if switch off. This can surprise a few tests causing them to skip. References: https://gitlab.freedesktop.org/drm/intel/-/issues/1929 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-05-26i915/gem_exec_schedule: Fix measurement of ring size to use right engineChris Wilson2-0/+117
gem_ring_measure_inflight() uses the legacy ring idx, whereas gem_exec_schedule is using the new dynamic ctx->engine[] indices. Mismatch and hanging tests ensue. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-05-26lib: Randomise spinner location to reduce relocation riskChris Wilson1-8/+33
Randomise the position of the spinner to reduce the number of relocations we might require. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-05-26lib/media_fill: Migrate gen11 media pipeline creation to intel_bbZbigniew Kempczyński3-43/+49
Function is now libdrm-free, but mixes calls to replaced and "_v2" versions. This cleanup and old code removal will be addressed in the another commit. 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-05-26lib/gpu_cmds: Change gpu commands to use intel_bbZbigniew Kempczyński2-57/+76
As gem_media_vme uses mostly gen11 there's no need to add _v2 version and migrate from intel_batchbuffer to intel_bb to remove libdrm dependency. 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-05-22i915: Add gem_exec_endlessChris Wilson1-0/+1
Start our preparations for guaranteeing endless execution. First, we just want to estimate the direct userspace dispatch overhead of running an endless chain of batch buffers. The legacy binding process here will be replaced by async VM_BIND, but for the moment this suffices to construct the GTT as required for arbitrary indirect execution. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-05-21lib/intel_batchbuffer: Add new media fillfunc v2Zbigniew Kempczyński2-0/+27
Media fill function selection for "_v2" version. 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-05-21lib/media_fill: libdrm-free media pipeline creationZbigniew Kempczyński2-0/+196
Add libdrm-free pipeline creation functions for media fill for all gens (gen7+). Until all gpu_cmds code will be rewritten to use intel_bb we have to keep libdrm-version code intact. 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>