summaryrefslogtreecommitdiff
path: root/tests/kms_lease.c
AgeCommit message (Collapse)Author
2019-03-28tests/kms_lease: Check crtc used in atomic ioctlDaniel Vetter
We not only need to check that userspace is allowed to use the objects it's changing, but also the objects it's using as property values. The only ones relevant for leases are the CRTC_ID properties on connectors and planes. Current kernels fail this. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-03-28tests/kms_lease: Handle new errno from idr/xa double insertDaniel Vetter
The conversion from idr to xarray will change the errno for already inserted object ids from ENOSPC to EBUSY. Allow both. Cc: Matthew Wilcox <willy@infradead.org> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-03-28tests/kms_lease: Adjust to kernel errno changesDaniel Vetter
I dropped a superfluous check for negative object id (the kernel did a cast to s32, despite that object ids are always unsigned). Which changes the errno from EINVAL to ENOENT. Allow both. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-03-28tests/kms_lease: test implicit cursor plane usageDaniel Vetter
Figured I'll only test the SetCursor interface since in the kernel it's all the same anyway, it's just libdrm that splits it up. Current kernels fail this. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-03-28tests/kms_lease: test implicit primary plane usage in setcrtc ioctlDaniel Vetter
Again we need to make sure that a lease can't use planes it's not allowed to through legacy ioctls. SetCrtc is a bit more tricky, since we should still allow to shut down a CRTC, e.g. when we're allowed to use other planes on that CRTC. Current kernels fail this. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-03-28tests/kms_lease: test implicit primary plane usage in page_flip ioctlDaniel Vetter
We need to make sure that legacy ioctls don't operate on a lease if the lesse doesn't have access to the implicitly used primary plane. Current kernels fail this. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-03-01tests: Use igt_device_set/drop_masterDaniel Vetter
Suggested by Chris. v2: Use "" for local includes (Chris). Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-02-22tests/kms_lease: exercise ueventDaniel Vetter
And make sure we get the LEASE=1 value, indicating a lessee change. v2: Apparently netlink reading can leak EAGAIN out through udev_monitor_receive_device. No idea what's going on there, so let's wrap some duct tape around it. v3: Lyude reported that we might get a few udev events on startup of the test. Drain those first. v4: Use the igt hotplug library functions, they already take care of all the uevent special cases. Cc: Lyude Paul <lyude@redhat.com> Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-22tests/kms_lease: validate implicitly added planesDaniel Vetter
Without universal planes the kernel should auto-add the (in that case hidden) primary and cursor planes. Check this works and all the error handling is there for evil userspace. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-22tests/kms_lease: multimaster testcaseDaniel Vetter
Check that the 2nd master can only create leases while being active master, and that leases on the first master don't prevent lease creation for the 2nd master. Also check that a disappearing master does also invalidate all its leases. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-22tests/kms_lease: Test drop/set_master interactionsDaniel Vetter
- make sure leases change master status together with lessor - make sure lease can't change the master status Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-22tests/kms_lease: validate the possible_crtcs filteringDaniel Vetter
Makes sure the possible_crtcs logically match between master and lease, and that the values are correctly renumbered on the lease side. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-22tests/kms_release: invalid checks for revoke-lease ioctlDaniel Vetter
Found a few corner cases to validate. Put them into the existing testcase. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-22tests/kms_lease: invalid corner-cases for create-lease ioctlDaniel Vetter
Found a few things in the kernel that looks suspicious, separate patches on their way. I also reviewed coverage for list-lesses and get-lease, and coverage seems complete for these. v2: Bit of polish to address Lyude's comments. Cc: Lyude Paul <lyude@redhat.com> Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-02-22tests/kms_lease: Run on simulationDaniel Vetter
It's all kernel code that's being tested here, no reason not to run in simulated environments ... Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-02-22tests/kms_lease: Add invalid planes testsDaniel Vetter
Test gap because we're using universal planes by default. Fix that. Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-27tests: Use igt_display_requireDaniel Vetter
Remaining tests that have been overlooked and don't need any invasive changes to limit the skipping to only the relevant parts. v2: [A rebase gone wrong] v3: Move the misplaced hunk to the right patch (Antonio). v4: Rebase, kms_content_protection is new. v5: Rebase - need to adjust kms_lease.c too. Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> (v3) Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-By: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-08tests/kms_lease: improve the unleased_connector/crtc testsDaniel Vetter
We need to use raw ioctl since using the igt_kms library is fairly brittle against changes in the library. This fixes the last subtest failure due to the rebasing onto latest kernel and igt. Note that the revoke test doesn't have such a problem, because the igt library has been initialized when everything was still there. Hence we will never blow up in the library after the revoke happened. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-11-08tests/kms_lease|sequence: Make sure we're masterDaniel Vetter
Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-08tests/kms_lease: improve lease_get subtestDaniel Vetter
Again it failed to fill in the pad field. It also had the wrong assumptions about planes being included. Plus again add a bunch more paranoid checks. And make sure the primary plane is included, too. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-08tests/kms_lease: improve lesssee_list subtestsDaniel Vetter
It failed to clear the pad, which made me realize that it's missing a few paranoid checks. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-08tests/kms_lease: Adjsut to universal_planes uapi changesDaniel Vetter
We need to also ask for a plane when universal planes is enabled, which the igt_display library does by default. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-08tests/kms_lease: use interactive debug helpersDaniel Vetter
Much faster, since when not enabled they proceed right away. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-08tests/kms_lease: add tests for lease ioctls [v2]Keith Packard
Validate that the leasing API creates leases that allow access to a subset of the available resources and that lease revocation works. v2: from Dave Airlie <airlied@redhat.com> * Update ioctl numbers to latest proposed values. * Fix commit message * Add tests for get_lease and list_lessees v3: - Rebase - drop the get_driving_output test, that's already taken care of by the for_each_valid_output loop. Signed-off-by: Keith Packard <keithp@keithp.com> (v2) Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>