summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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>
2019-02-05igt: fb: Reduce tile size alignment for non intel platformsMaxime Ripard
Aligning the width on 64 pixels only make sense on intel platforms, make sure to add a check against this. 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: Add subsampling parameters to the formatsMaxime Ripard
In order to improve the YUV support, let's add the horizontal and vertical subsampling parameters to the IGT formats. 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-05tests/gem_media_vme: Shut down half of subslices to avoid gpu hang on ICLTony Ye
On Icelake we need to turn off subslices not containing the VME block or the VME kernel will hang. v2: (Tvrtko Ursulin) * Remove libdrm usage for setting context param. * Cleanup bitmask operation. * Only apply the workaround for ICL. v3: (Tvrtko Ursulin) * Added hang detector. (Chris Wilson) v4: (Tvrtko Ursulin) * Rebase for hang detector moved to previous patch. * Tidy curly braces. v5: (Tvrtko Ursulin) * Whitespace tidy. (Joonas) Signed-off-by: Tony Ye <tony.ye@intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Tony Ye <tony.ye@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2019-02-05tests/gem_media_vme: Simple test to exercise the VME blockTony Ye
Simple test which exercises the VME fixed function block. v2: (Tvrtko Ursulin) * Small cleanups like copyright date, tabs, remove unused bits. v3: (Tony Ye) * Added curbe data entry for dst surface. * Read the dst surface after the VME kernel being executed. v4: (Tony Ye) * Added the media_vme.gxa kernel source code and compile instructions. v5: (Tvrtko Ursulin) * Added hang detector. v6: (Tvrtko Ursulin) * Replace gem_read with gem_sync. (Chris Wilson) Signed-off-by: Tony Ye <tony.ye@intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Tony Ye <tony.ye@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2019-02-04lib: sync i915_pciids.h with kernelRodrigo Vivi
Add more PCI Device IDs for Coffee Lake and Ice Lake. Align with kernel commits: 5e0f5a58b167 ("drm/i915/cfl: Adding another PCI Device ID.") 03ca3cf8e9aa ("drm/i915/icl: Adding few more device IDs for Ice Lake") Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-02-01debugfs: Fix writing an extra zero out of bounds in igt_crc_to_string_extended()Maarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2019-02-01lib/igt_kms: Clear all non-atomic properties in legacy/universal commit ↵Maarten Lankhorst
correctly. We used to add them all 1 by 1, but we really only care about not handling a few. Only skip unsetting all atomic properties, instead of handling it through a whitelist. This fixes kms_busy, which was updating the VRR hint, even though we already unset it in the legacy path. Cc: Nicholas Kazlauskas <nkazlaus@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Leo Li <sunpeng.li@amd.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109490 Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
2019-02-01tests/kms_frontbuffer_tracking: Fix skips when PSR is not available.Maarten Lankhorst
Use psr.can_test to determine we can disable PSR, and not skip because PSR is unavailable. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-02-01lib/psr: Do not use out of bound enum for psr_set.Maarten Lankhorst
Using an undefined int not in the enum is undefined. Use -1 and change mode to an integer. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-30lib: Skip unused fork helpersChris Wilson
Skip trying to stop unused fork helpers to avoid the various asserts that they were running and didn't die early. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109468 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-01-29automake: Remove VC4/V3D build supportDaniel Vetter
Eric is using meson nowadays. v2: Fix up the test filter, meson lists now contain more than in the automake lists. Cc: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-01-29automake: Ditch all EXTRA_DIST directivesDaniel Vetter
We're not using automake to build tarballs anymore. Acked-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-01-28tests: Add variable refresh rate testsNicholas Kazlauskas
There are 3 tests for basic variable refresh rate functionality. The tests measure flipping at the average between the current mode refresh rate and the minimum supported variable refresh rate. It tests that VRR is enabled and that the difference between flip timestamps converges to the requested rate. It also tests this under both S3 and DPMS. Potential ideas for future tests: - Test behavior inside VRR range with a stepping test - Test behavior outside of VRR range - Multi-monitor (limited by no async pageflips in DRM atomic API) Cc: Harry Wentland <harry.wentland@amd.com> Cc: Leo Li <sunpeng.li@amd.com> Cc: Manasi Navare <manasi.d.navare@intel.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-01-28lib/igt_x86: Mock-use variable to silence static analysisPetri Latvala
x86_features_to_string() uses a repeatable pattern that increments a pointer for each feature string, leaving a dead assignment for the last one. Add a (void)line to the end just to silence static analysis. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-01-28lib/igt_kms: Aid static analyzer with the control flowPetri Latvala
If we first find n amount of ':' in a string, the amount is still n when we walk through it the second time. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-01-28igt_aux: Handle empty pm_test file gracefullyPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-01-24lib/igt_gt: Move assert with setting 'reset' parameter after IGT env checkKatarzyna Dec
We are trying to set reset parameter earlier than checking IGT env. Let's move it after checking IGT env to avoid setting reset parameter when hang injection is disabled. Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
2019-01-23lib/draw: Align mmap requests to page boundariesChris Wilson
Since we trust fb->size as either calculated by calc_fb_size() or the supplied by the user, it invariably isn't page aligned. The mmap routines and ioctls only deal in pages... Not sure if fb->size should be page aligned, but that may break some other drawing tests, so opt to just fix up the mmap requests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2019-01-23tests: drop openssl dependency in favor of glib sha1 implementationJani Nikula
We already depend on glib which has sha1, so we don't really need openssl just for sha1. The opensll dependency was added in commit caea9c5b3aa1 ("igt/gem_userptr: Check read-only mappings"). Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-01-22lib/psr: Add PSR2 support to the remaning psr functionsJosé Roberto de Souza
Add the mode parameter to psr_enable() and psr_sink_support() so PSR1 and PSR2 can be tested separated. For now all PSR tests will run only with PSR1 and the tests for PSR2 will come in the future. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-22lib/psr: Make psr_wait_entry and psr_wait_update aware of the PSR version testedJosé Roberto de Souza
This way we can test both PSR version separated. v4: Dropping psr_state_check() to psr_active_check() Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-22lib/psr: Rename psr_wait_exit to psr_wait_updateJosé Roberto de Souza
This is a initial preparation for PSR2 test support, as in PSR2 a update to screen could mean that PSR is still active and the screen will be update by a selective update this renamed is necessary. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-22lib/psr: Only care about DEEP_SLEEP state for PSR2José Roberto de Souza
To check if PSR is active it search for SRDENT for PSR1 and it was searching for SLEEP for PSR2 but it should really seach for DEEP_SLEEP as in this state display block is actualy saving a substancial amount of power. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-22lib/psr: Add support to new modified i915_edp_psr_status outputJosé Roberto de Souza
The kernel patch 'drm/i915: Refactor PSR status debugfs' changed the output of i915_edp_psr_status, so adding support to the new output here while keeping the support to the old one for a while. In psr_active() we were overdoing, we just need to check the source state to know if PSR is active and doing that we keep compability to old and new i915_edp_psr_status output. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-22lib: Include the size in the error message for mlockChris Wilson
Knowing how much we tried to allocate would be useful if one should need to debug why it failed. References: https://bugs.freedesktop.org/show_bug.cgi?id=109439 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-01-21lib/drmtest: Don't read from NULL in set_forced_driverPetri Latvala
The only caller so far never passes NULL so no effects today. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
2019-01-21lib/igt_core: Initialize fds in igt_system_quietPetri Latvala
This avoids calling close() with uninitialized ints if some dup() calls succeed and others don't. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>