summaryrefslogtreecommitdiff
path: root/tests/prime_vgem.c
AgeCommit message (Collapse)Author
2019-05-09tests/prime_vgem/basic-fence-flip: Probe display resolutionTvrtko Ursulin
Some displays might not support hardcoded 1024x768. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109294 Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2019-04-04prime_vgem: Downgrade the severity of a single missed vblank on flippingChris Wilson
Not displaying the flip on the next vblank is bad, but not the end of the world -- so long as that is only a temporary glitch. Give the vblank a few more frames to complete, and warn instead of failing if it takes more than one vblank interval to flip. v2: Bump the warning to >1 missed flip, to spare us the noise. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-04-02prime_vgem: Replace nanosleep with igt_waitchildren_timeoutChris Wilson
We want to use a child in order to detect an uninterruptable sleep (a potential bug we might hit), but we can use igt_waitchildren_timeout() to replace our risky self-signaling + nanosleep. v2: Remove the now redundant signal() setup. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103182 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-10-01igt/prime_vgem: Skip flip if no displayChris Wilson
We try flipping a vgem surface onto a i915 scanout. However, if there is no display we want to disable the kms interface, including the addfb ioctl. On such systems the call to kms_addfb will naturally fail and the test cannot be run. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-09-25lib/kms: Pass the number of planes explicitly to __kms_addfb()Ville Syrjälä
Currently __kms_addfb() assumes that only the first plane can be at offset 0. I don't particularly like such assumptions so let's just pass in the number of planes explicitly. We'll also require offsets[] to be passed in always. Nothing really to gain by making it optional. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/kms: Pass strides[] to __kms_addfbVille Syrjälä
Make __kms_addfb() usable with planar formats by passing in the stride for each plane. v2: Handle strides[1] for planar formats in kms_available_modes_crc Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-08-08igt/prime_vgem: Ask the shrinker to purge a vgem bo from inside i915Chris Wilson
Link a vgem dmabuf into an i915 bo and then ask the i915 shrinker to purge/invalidate its pages. This should establish the lockdep link from the fs_reclaim shrinker section to whatever locks are used to acquire/release dmabuf mappings; if any are required ofc. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@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-02-01lib/fb: Add support for creating planar framebuffers, v3.Maarten Lankhorst
Add support to create planar framebuffers, but don't add formats that support them yet. This first requires conversion to the RGB24 format. Changes since v1: - Don't crash in igt_create_bo_with_dimensions(). Changes since v2: - Zero offsets for dumb fb too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> [mlankhorst: Change memset(4 * ..) to memset(ARRAY_SIZE(format->plane_bpp) * ..)]
2017-10-18tests: Clean up igt_skip_on_simulation() usesArkadiusz Hiler
General update to reflect current state of things. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2017-09-21igt/prime_vgem: Split out the fine-grain coherency checkChris Wilson
We don't expect every machine to be able to pass the WC/GTT coherency check, see kernel commit 3b5724d702ef24ee41ca008a1fab1cf94f3d31b5 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Aug 18 17:16:49 2016 +0100 drm/i915: Wait for writes through the GTT to land before reading back If we quickly switch from writing through the GTT to a read of the physical page directly with the CPU (e.g. performing relocations through the GTT and then running the command parser), we can observe that the writes are not visible to the CPU. It is not a coherency problem, as extensive investigations with clflush have demonstrated, but a mere timing issue - we have to wait for the GTT to complete it's write before we start our read from the CPU. The issue can be illustrated in userspace with: gtt = gem_mmap__gtt(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE); cpu = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE); gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); for (i = 0; i < OBJECT_SIZE / 64; i++) { int x = 16*i + (i%16); gtt[x] = i; clflush(&cpu[x], sizeof(cpu[x])); assert(cpu[x] == i); } Experimenting with that shows that this behaviour is indeed limited to recent Atom-class hardware. so split out the interleave coherency check from the basic interopability check. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-07-06Revert "igt: Remove default from the engine list"Chris Wilson
This reverts commit d7a0b61450797a3d6644c65aebf75c2a90da1a15.
2017-07-06igt: Remove default from the engine listTvrtko Ursulin
Default is not an engine but an ABI alias for RCS. Remove it from the engine list to eliminate redundant subtests and test passes. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Acked-by: Daniel Vetter <daniel.vetter@intel.com>
2017-05-18lib: Refactor testing for ability to use MI_STORE_DATA_IMMChris Wilson
Rather than have the code in multiple locations, put a copy in lib/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-22igt: Start marking up GEM tests that require an alive GPU to functionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-21igt/prime_vgem: Initialise pfd for both parent/childChris Wilson
commit 4337091f6af6 moved the initialisation of the pollfd into the child, forgetting that it was also used in the parent as a sanity check. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97885 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-01igt/prime_vgem: Simplify inter-process flip checksChris Wilson
Avoid having both the child and parent do the same "did the flip" happen check with each looking for the same event on the same fd. The problem being that the child may fall asleep and by the time it wakes up to do its check, the parent has already eaten the event. So leave the checking that the flip does occur to the parent. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-30prime_vgem: Fix fence flippingChris Wilson
On the move to doing front/back flips, I managed to completely break the test by forgetting to pass the fence to be signaled. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-23igt/prime_vgem: Test both front/back flipChris Wilson
Check that we neither stall nor flip too early given active front/back buffers. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-23igt/prime_vgem: Detect when the call to pageflip blocksChris Wilson
Identify whether it is the nonblockling page-flip request that blocks or the event is fired too early. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-23igt/prime_vgem: Perform connector probe on startupChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-22Revert "tests/prime_vgem: Remove BAT sub-tests that cause intermittent fails."Chris Wilson
This reverts commit 5188745c4b531d09508cf0897fb90a3634299283.
2016-07-25tests/prime_vgem: Remove BAT sub-tests that cause intermittent fails.Marius Vlad
The following tests are causing problems in CI: prime_vgem@basic-fence-flip, fails intermittently on a HSW and SKL prime_vgem@basic-fence-wait-default, fails on all platforms since it was added prime_vgem@basic-sync-default, fails on all platforms since it was added, and it sometimes hangs BYT machine prime_vgem@basic-busy-default, fails on all platforms since it was added prime_vgem@basic-wait-default, fails on all platforms since it was added, and it sometimes hangs BYT machine Add a flag to enable them when they get stable enough. Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-07-19igt/prime_vgem: Test set-domain on foriegn dma-bufsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-19igt/prime_vgem: Replace arbitray delay with backchat from childChris Wilson
Wait until the child tells us they are running (and have verified the initial buffer state) before modifing the vgem buffer and then signaling the child. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-19igt/prime_vgem/fence-read: Insert a delayChris Wilson
Ensure that the child does need to sleep before the vgem is written. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-18igt/prime_vgem: Check for fence wait before gem_read()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-15igt/vgem_slow/nohang: Test fence autotimeoutChris Wilson
To protect the kernel against unscrupulous fence users, fences should automatically signal after a timeout. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-12vgem: Add basic dma-buf fence interopChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-21igt/prime_vgem: Speed up implicit fence failureChris Wilson
Close the batch before asserting so that we don't have to wait for a hang after a failure. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-20igt/prime_vgem: Insert a WCB flush between distinct mmappingsChris Wilson
Since we use distinct WC addresses for the same page, we need to flush the WCB after the write in order to see it from the other mmaping. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-20igt/prime_vgem: Add a tight coherency check between vgem/gtt mmapChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-20benchmarks: Add vgem mmap speed testChris Wilson
Primarily to check that we have the WC read/write disparity. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-18igt: Add basic exercise of vGEMChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>