summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-02-26lib/igt_chamelium: Split frames dump logic and rework surroundingsPaul Kocialkowski
The frame dump logic is the same for all comparison helpers, so split it to a dedicated function and adapt helpers using it to avoid duplicating operations. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_chamelium: Fixup resources liberation in comparison helpersPaul Kocialkowski
This fixes a bunch of occurrences of memory not being properly liberated after its use in helpers revolving around frame/CRC comparison. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_kms: Add helpers to count and iterate planes from outputPaul Kocialkowski
With helpers to count and iterate among planes of a given type from the pipe in place, we can use them with the current pipe for the output to make it possible for tests to use them (the pipe struct is not currently easily exposed to tests and exposing it adds unnecessary complexity). Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_kms: Add helpers to count and iterate planes from pipePaul Kocialkowski
This introduces helpers that allow counting how many planes of a given type are present from a pipe and getting the n-th plane of a given type. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Support converting to VC4 modifiers in igt_fb_convertPaul Kocialkowski
This pipes-in support for the VC4 modifiers that we have conversion helpers for. A new temporary linear framebuffer is introduced, that is either freed later or copied to the destination framebuffer pointer. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-26lib/igt_fb: Pass the modifier to igt_fb_convert helpersPaul Kocialkowski
The modifier is part of how a frame is represented, so add it as an extra argument so that it can be specified when converting framebuffers. For now, only a linear modifier is supported. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-26lib/igt_vc4: Add helpers for converting linear to SAND-tiled buffersPaul Kocialkowski
In order to test buffers with SAND tiling, it is useful to convert linear buffers to SAND tiling mode. Introduce helpers to assist in that direction, one that calculates the memory offset in the SAND-tiled buffer for a given pixel position and one that makes use of the latter for framebuffer conversion. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Acked-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_vc4: Add helpers for converting linear to T-tiled RGB buffersPaul Kocialkowski
In order to integrate testing of T-tiled buffers, the easiest path is to generate patterns (with the already-existing functions) in linear buffers and convert them to T-tiled subsequently. Add helpers to do that conversion, with a first helper that returns the memory offset for a given position in a T-tiled buffer and a second helper that uses it for converting between framebuffers. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Acked-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Add a helper to fill-in the available DRM formatsPaul Kocialkowski
Introduce a helper to allocate and fill-in a list of available DRM formats, which is useful for picking one at random in tests. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Add a helper to retreive the plane bpp for a given formatPaul Kocialkowski
The format bpp for a given plane is stored in the static format_desc structure and is not accessible to tests, which is inconvenient to get the minimum stride for a format when testing various strides. Add a simple helper to expose the information. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Add a stride-provisioned fashion of igt_fb_convertPaul Kocialkowski
The current implementation of igt_fb_convert does not allow passing the destination stride, which is something we want to change for tests. Add a new fashion of this function that allocates the desintation buffer with a given stride. Since the current function does the same thing with an unspecified stride (set to zero, which will be filled later), make it call our new fashion with the stride set to zero to avoid duplication. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Allow interpreting the tile height as a stride equivalentPaul Kocialkowski
The VC4 SAND tiling modes are disposed in columns that follow each other in memory. The column height defines the number of fixed-width lines from the beginning of one column to the other, which may be greater than the display height. In this case, the extra lines are used as padding and the column height becomes a height-based stride equivalent. Support this when calculating the plane size by using the tile height directly if it is greater than the plane height. This works better than alignment for non-power-of-two cases (no space is wasted) and it is equivalent to alignment for power-of-two tile heights. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Add support for VC4 SAND tiling modesPaul Kocialkowski
This introduces support for the VC4 SAND tiling modes, that take a specific parameter indicating their column height. This parameter acts as a height-based stride equivalent, that shall be equal or greater than the displayed height. The parameter is extracted and returned as tile height so that enough memory can be reserved for column heights containing extra padding. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-26lib/igt_fb: Add support for allocating T-tiled VC4 buffersPaul Kocialkowski
This introduces the required bits for allocating buffers with a T-tiled disposition, that is specific to the VC4. It includes calculating the top-tile width and creating a buffer object with the VC4-specific helper. The tiling flag is set to the buffer object so that this can be reused for GPU tests if needed later. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Refactor create_bo_for_fb to prepare for VC4 supportPaul Kocialkowski
The current create_bo_for_fb uses a device-specific BO instead of dumb allocation when dumb allocation is not appropriate and the driver is Intel. Then, it will assert that the parameters are appropriate for dumb allocation. The conditions related to tiling, size and stride are sufficient for needing a device-specific BO and they are not specific to Intel. However, a device-specific BO for YUV is only needed for Intel. Change the conditions accordingly and set a device_bo variable. This variable allows making fb->size calculation common between the device-specific and dumb paths. Use the variable after that and distinguish between the device types for allocating and error out if it's not supported. This makes the extra checks that dumb allocation is valid redundant, since these cases will always fall under device-specific allocation and potentially error out then. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-26lib/igt_fb: Add checks on i915 for i915-specific tiled buffer allocationPaul Kocialkowski
The code path for allocating tiled buffers has a few i915-specific bits without checks for the i915 driver. Add these missing checks. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-26lib: drmtest: Add helpers to check and require the VC4 driverPaul Kocialkowski
In order to add support for features specific to the VC4 driver, add helpers for checking and requiring the driver like it's done for the i915 driver. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
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-21lib: Only require we have i915.reset module parameter for allow-hangChris Wilson
To control hang detection, we manipulate the i915.reset module parameter. However, to be nice we should SKIP if we cannot modify the parameter as opposed to outright FAILing. References: https://bugs.freedesktop.org/show_bug.cgi?id=108891 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-02-21lib: disallow fixtures/subtest groups in simple testsDaniel Vetter
They don't work, see igt_can_fail(). We already check for test_with_subtests in igt_subtest. Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-21lib/tests: Use ARRAY_SIZEDaniel Vetter
Except in igt_simulation.c where we use tricks and intentionally only want part of the array in some cases. Suggested-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-20lib/tests: Add testcase for nonexisting subtest nameDaniel Vetter
While at it, convert the existing testcase for invalid subtest names to a positive one. This is the only thing the invalid subtest checking for all tests did cover, which wasn't covered through some other checks already. Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-20lib/tests: Convert no_exit tests into positive testsDaniel Vetter
This way we can make sure they die with an assert, which is what we want. Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-20lib/tests: add internal_assert_wexited/wsignaledDaniel Vetter
And convert everything over. igt_segfault needed a bit of care to differentiate between a real death-by-signal and igt_exit mapping a child process signal death to an exit code. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-02-20lib/tests: Add header for common helpersDaniel Vetter
Start with internal_assert, more will follow. While at it, use internal_assert everywhere (except where we check exit status, those will get dedicated assert checks). Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-20lib/crc: Reset fifo underrun reporting for every crc captureDaniel Vetter
We have tons of issues with crc mismatches, but often by that time there was already a fifo underrun, which disables further fifo underrun reporting. Reset fifo underrun reporting before we capture a crc so that it's easier to figure out why the crc mismatch happened. Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-19lib: Restore the i915.reset modparam before cleaning upChris Wilson
We force a reset on test exit so that we can rapidly cleanup after a naughty test, it is not unknown for us to leave a queue of hanging batches around. However, if we have also fiddled with the i915.reset parameter in the meantime, this can leave the kernel unable to fulfil our request (and those naughty batches continue to disrupt testing). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-02-15lib: Drop IGT_EXIT_TIMEOUTDaniel Vetter
We use the timeout status for when the runner had to kill a testcase, which indicates a more sever issue than an operation failing that we expected to complete within seconds. Since it's unused, drop it. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib: Drop igt_child_doneDaniel Vetter
Added in commit 054eb1abecd1cce2e4ee0516f3ff8a67a35dca22 Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Date: Thu Mar 30 14:32:29 2017 +0100 benchmarks/gem_wsim: Command submission workload simulator but since then the only user was lost. Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib: Make sure we leak no child processesDaniel Vetter
There's a lot more ways to leak children than igt_fork, some even handrolled. So check for that. Also have a nice littel testcase for that too. v2: Don't hang if there's a leaked child process (Chris). Has the added benefit that my library unit test also gets faster! v3: Rebase. Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15tests/i915_missed_irq: Don't leave the hang detector hangingDaniel Vetter
Spotted by my new "are there any child processes left?" check in igt_exit - we need to put all the igt_require before we start any real test logic. v2: Rebase. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib: Don't leak children in igt_waitchildren_timeoutDaniel Vetter
Instead of cleaning up the mess in igt_exit make sure we don't even let it out of the container. See also commit 754876378d6c9b2775e8c07b4d16f9878c55949f Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Feb 26 22:11:10 2016 +0000 igt/gem_sync: Enforce a timeout of 20s which added this helper. To make sure that everyone follows the rules, add an assert. We're keeping the cleanup code as a failsafe, and because it speeds up the testcase I'm following up with. v2: Chris pointed out that my original patch did nothing. Which I didn't catch because my testcase was also broken. Unfortunately this means we need to open code part of the waiting. v3: The 2nd __igt_waitchildren() isn't necessary, __igt_waitchildren recovers from EINTR already and keeps waiting (Chris Wilson). v4: Change the timeout signal vs waitchildren logic to be race-free (Chris). This changes the exit code for a timeout from IGT_EXIT_FAILURE to SIGKILL + 128. v5: Clarify the docs (Chris). Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib/tests: make sure igt_skip in igt_fork is forbiddenDaniel Vetter
Another corner case to check. v2: Rebase. Note that we still have the SIG + 128 exit code, that's how igt_waitchildren forwards child death to the parent's exit code. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib/tests: Check that igt_assert forwards correctly through igt_forkDaniel Vetter
Note that without the igt_waitchildren nothing at all gets forwarded, maybe we should check for left-behind children somewhere on subtest exit. v2: Drop NIH exit status handling (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@intel.com>
2019-02-15lib/tests: Drop NIH exit status handlingDaniel Vetter
Spotted by 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@intel.com>
2019-02-13test: Add PSR2 selective update testsJosé Roberto de Souza
This tests checks if hardware is able to do selective update when screen changes. PSR2 don't trigger interruptions and the 'PSR2 SU status' register is not kept loaded all the times, so it is necessary keep polling PSR status debugfs until those values are loaded. Also from DEEP_SLEEP state HW will not do a seletive update, as most of the memory/context is lost in deep sleep state hardware will need to exit PSR mode then wait a configured number of frames to activate PSR again to then start doing seletive updates, that is why just one screen change is not enough to pass this tests. When a selective update happens and the values are loaded and read from debugfs it is compared with the expected value of seletive update blocks, if matches the polling is stopped and the test passed otherwise it will wait until it reachs a maximum number o screen changes to fail the test. v2: Using new SU blocks debugfs output v3: - removed the timerfd to fail the test, now failing based in a maximum number of screen changes - removing thread to read debugfs, read from main thread is enough - improved commit message v4: - getting cairo context for frontbuffer test in prepare() - droppoing poll(), using blocking timerfd instead v5: - Doing a modeset before trying to enable PSR2 v6: - doing atomic commits to fix(legacy commit is taking more time in recent kernels causing us to miss the SU when reading debugfs) and speedup test - fixed code to skip test when PSR2 is not possile Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Tested-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-02-13lib/igt_fb: Add support for P01x formats, v5.Maarten Lankhorst
The P01x formats are planar 16 bits per component, with the unused lower bits set to 0. This means they can all be converted the same way. Only the range is slightly different, and this is handled in the color_encoding implementation. This requires cairo 1.17.2 and pixman 0.36. This works but doesn't give extra precision. For more than 8 bits precision a few more patches are required to pixman, pending review: https://lists.freedesktop.org/archives/pixman/2019-January/004815.html https://lists.freedesktop.org/archives/pixman/2019-January/004809.html Once those are merged, we will require the next pixman release for better precision. Changes since v1: - Add fallback color definitions when compiling on cairo version < 1.17.2. - Skip when FB creation fails on HDR formats, instead of failing. Changes since v2: - Complain slightly harder when pixman/cairo are out of date. - Create a fb with alpha when converting to pixman formats with alpha. - Oops, s/pixman_format_code_t/cairo_format_t/ Changes since v3: - Rebase on top of upstream YUV changes. Changes since v4: - Rebase again. - Use drm_fourcc.h from drm-misc-next. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> #v4
2019-02-13lib/color_encoding: Prepare support for HDR modes, v2.Maarten Lankhorst
We're starting to add support for 10, 12 and 16-bits formats that all have different values for the Y offset and range. Some 10 bits formats go from [0...1023], others go to [0...1023] shifted left by 6. To accomodate all formats add a struct definition for all various formats, this can be extended further when we add new formats. Changes since v1: - Rebase on top of added yuv changes. - Add commit description (swatish) - Add missing newline. (swatish) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> #v1
2019-02-11lib/tests: Drop automake supportDaniel Vetter
Really not needed if we check this with meson. Acked-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-11igt: fb: Add a bunch of new YUV formatsMaxime Ripard
Thanks to the previous reworks, we can now add new YUV formats pretty easily. This patch adds support for the NV12, NV16, NV21, NV61, YUV420, YVU420, YUV422 and YVU422 formats. Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-11igt: fb: Rework YUV i915 allocation pathMaxime Ripard
We only need to allocate a buffer using the GEM API when we're in the condition that we currently test, and that we're running on i915. All the other cases can be handled by a fallback to a dumb buffer allocation. Let's simplify the code a bit to reflect that. Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Deepak Rawat <drawat@vmware.com>
2019-02-11igt: fb: Clear YUV dumb buffersMaxime Ripard
YUV dumb buffers, just like i915 GEM buffers also need to be cleared once allocated. Make sure it happens. Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-11igt: fb: Don't pass the stride when allocating a dumb, multi-planar bufferMaxime Ripard
The dumb buffer allocation API only considers a single plane, and even though allocating multi-planar buffers through it is allowed, the stride it gives back is the the width times the bpp passed as an argument. That doesn't work in our case, since the bpp is going to be the one we give as an argument, but split over three planes so the stride doesn't match anymore. A proper fix for this would be to have a better dumb buffer allocation API, but for the time being, let's do it that way. Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-11igt: fb: Account for all planes bppMaxime Ripard
When allocating a dumb buffer for a format with multiple plane, we need to account for all plane's bpp in order to allocate the proper size. Let's add all the planes bpp and use the result to allocate our buffer. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-11igt: fb: Add size checks and recalculation before dumb allocationMaxime Ripard
Since we want to use the dumb buffers to store frames in formats with multiple planes, we need to add checks for unsupported corner cases, and we need to calculate the offsets and sizes of each planes. Let's use calc_fb_size for that. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-11igt: fb: Refactor dumb buffer allocation pathMaxime Ripard
The else condition is not needed, since all the other conditions return when they are done. Move the KMS dumb buffer allocation outside of the outer else condition, this will also allow to ease later changes. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-05lib/igt_kms: Don't reset VRR_ENABLED on every commitNicholas Kazlauskas
If the VRR tests failed then there was a chance that VRR could be left enabled when exiting the test so the VRR_ENABLED property was reset to 0 whenever the pipe was reset. However, in doing so the pipe's state was considered changed even if VRR_ENABLED was already 0. This causes the pipe to be added to commits where it previously wasn't. Other tests with properties that can persist for failures (like color management) don't bother resetting the properties - so this patch changes VRR_ENABLED to work the same. Cc: Harry Wentland <harry.wentland@amd.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109490 Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-02-05lib/igt_fb: Fix merge of preliminary patches for clearing YUVPaul Kocialkowski
Preliminary patches for the YUV testing series were broken without subsequent patches that fix them when moving things around. The argument provided to clear_yuv_buffer should be the framebuffer, not the DRM file descriptor (fb vs fd). Also, an assert was added to clear_yuv_buffer to ensure that it's only called for YUV formats, which has to be reflected in the calling function. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-05igt: fb: Move i915 YUV buffer clearing code to a functionMaxime Ripard
The YUV buffer allocation path for the i915 driver also has some code to clear a YUV buffer. As that is going to be useful for all the other drivers, let's move it to a separate function. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-05igt: fb: generic YUV convertion functionMaxime Ripard
The current way we work when we want to support a new YUV format to IGT, we also need to add new function to convert to and from XRGB8888. This doesn't really scale however, and creates a lot of code to maintain. In order to work around this, create a generic function to convert to RGB and one to convert from RGB. The only thing that is needed now is to add new parameters, and that's it. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Acked-by: Lyude Paul <lyude@redhat.com>