summaryrefslogtreecommitdiff
path: root/lib/igt_psr.h
AgeCommit message (Collapse)Author
2019-04-15tests/fbcon_fbt: Add and user psr_long_wait_update()José Roberto de Souza
When fbcon is enabled, PSR will be active between cursor blinks so what it should really use to test PSR is psr_wait_entry(), so a new feature callback was added. But the fbcon cursor blinks at 5hz what give us 200ms between each screen update what make psr_wait_update() prone to fail the test because it timed out before a blink could happen, so here adding and using psr_long_wait_update() that have a longer timeout. v3: - 3 previous patches squashed in this one (Maarten) - Back to !feature->wait_until_enabled() to test feature state when all CRTCS are disabled(Dhinakaran) Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinkaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@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-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-14tests/psr: Share the code check if sink supports PSRJosé Roberto de Souza
The same code checking if sink supports PSR was spread into 3 tests, better move it to lib and reuse. v2: splitted previous patch into this one and the next one(Dhinakaran) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> 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-14lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use itJosé Roberto de Souza
So every function reading i915_edp_psr_status can allocate a buffer long enough. 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>
2018-09-28tests/psr: Wait for PSR exitDhinakaran Pandiyan
PSR appears to not exit immediately after the test commits a page flip, give some leeway for PSR to idle. Let's set the timeout at 40 ms with a 5 ms interval between each status read. Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-20lib/igt_psr: Give a explicit parameter name to functions that expect debugfs fdJosé Roberto de Souza
Let's rename to debugfs_fd all the parameters of the functions that expect debugfs fd to avoid call one those functions with the wrong file descriptor. Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2018-08-30lib/psr: Add support for toggling edp psr through debugfs, v5.Maarten Lankhorst
It's harmful to write to enable_psr at runtime, and the patch that allows us to change i915_edp_psr_debug with the panel running will require us to abandon the module parameter. Hence the userspace change needs to be put in IGT first before we can change it at kernel time. Toggling it to debugfs will mean we can skip a modeset when changing our feature set. Changes since v1: - Rebase with the previous patches dropped. Changes since v2: - Rebase on top of new api in i915_edp_psr_debug. Changes since v3: - Enable IRQ debugging for extra logging. - Force PSR1 mode. (dhnkrn) - Move PSR enable/disable functions to lib/igt_psr. (dhnkrn) Changes since v4: - Redisable irqs right away when debugfs api doesn't work. (dhnkrn) - Use hex everywhere. (dhnkrn) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Fix -ENODEV explanation in has_psr_debugfs (dhnkrn)] Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2018-07-17tests/psr: Move PSR state test functions to libDhinakaran Pandiyan
kms_frontbuffer_tracking and kms_psr test PSR in different ways, let' fix that by creating common library functions. v2: Include the new file in meson.build v3: Leave --no-psr intact (Rodrigo) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>