summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
AgeCommit message (Collapse)Author
2017-06-16tests: Rename I915_MAX_PIPES to IGT_MAX_PIPESLeo (Sunpeng) Li
Name should not be driver-specific. Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-06-16tests: Increase value of I915_MAX_PIPES to 6Leo (Sunpeng) Li
Increasing max pipe count to 6 to support AMD GPU's. Since some tests' behavior depends on this value, small changes are made to remove this dependency: * kms_ccs: Early abort if wanted_pipe is out-of-bounds. * kms_concurrent: Check if pipe is within bounds first. * kms_pipe_color: Prevent skipping of subsequent tests by placing generated tests in a 'igt_subtest_group'. * kms_plane: Move pipe and plane index checking to subtest group level. v2: Change invalid pipe check on kmstest_pipe_name() to use I915_MAX_PIPE v3: Change tabs to spaces in 'enum pipe' Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Tested-by: Tomi Sarvela <tomi.p.sarvela@intel.com>
2017-06-14lib/igt_kms: Add igt_display_require_output(/on_pipe)Maarten Lankhorst
Most KMS users open code this. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-04-20lib/igt_kms: Add support for 4K and audio HDMI EDID injection.Abdiel Janulgue
Based on the initial work by Marius Vlad. v3: Bring back audio injection v4: Make a helper for 3d/4k/audio HDMI injection (Petri) Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2017-03-21Restore "lib: Open debugfs files for the given DRM device"Chris Wilson
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring commit 301ad44cdf1b868b1ab89096721da91fa8541fdc Author: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu Mar 2 10:37:11 2017 +0100 lib: Open debugfs files for the given DRM device with fixes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Revert "lib: Open debugfs files for the given DRM device"Tomeu Vizoso
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc. When a render-only device is opened and gem_quiescent_gpu is called, we need to use the debugfs dir for the master device instead. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2017-03-21lib: Open debugfs files for the given DRM deviceTomeu Vizoso
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-20lib/igt_kms: Do not refresh all outputs in igt_display_commitMaarten Lankhorst
Now that igt_output_set_pipe handles refreshing igt_output, we only have to be sure that there are no conflicting outputs in igt_display_commit. Reported-and-tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-03-13igt/kms_pipe_crc_basic: Tighten timings for CRC readbackChris Wilson
The number of vblanks that pass whilst we read back the CRCs is depended upon CPU scheduling -- we may take longer than expected and end up reading more CRCs. Align the start of the loop to a vblank. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100132 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-02lib/igt_kms: Add support for the OUT_FENCE_PTR propertyGustavo Padovan
Add support for the OUT_FENCE_PTR property to enable setting out fences for atomic commits. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02lib/igt_kms: Add support for the IN_FENCE_FD propertyRobert Foss
Add support for the IN_FENCE_FD property to enable setting in fences for atomic commits. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02lib/igt_kms: export properties namesGustavo Padovan
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-01-31lib/igt_kms: Remove code obsoleted by dyn n_planes implementationRobert Foss
Due to the dyn n_planes implementation some attributes and functions were made obsolete and cand be removed. However to keep all of the tests building the obsolete code is removed after all of the tests have been made compatible with the dyn n_planes changes. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-31lib/igt_kms: Implement dynamic plane count supportRobert Foss
In upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe. The simple fix for this would be to simply bump hardcoded value for number of frames per pipe. But a better solution would be to add support for dynamic number of planes per pipe to i-g-t. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-31lib/igt_kms: Rename kmstest properties nplanes and planeRobert Foss
Rename these properties to have them use the same naming convention as the igt_*_t structs. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-31lib/igt_kms: Avoid depencency on static plane countRobert Foss
Rework kmstest_crtc and kmstest_plane structs and their usage to not depend on a static plane count. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-31lib/igt_kms: Add index property to kmstest_plane structRobert Foss
Add an index property which helps accessing the corresponding igt_plane_t structure through the igt_*_get_plane() functions. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-26igt_kms: Add kmstest_set_connector_broadcast_rgb()Lyude
A simple helper that checks whether or not the given connector has the "Broadcast RGB" prop, and if so sets it to the given mode. Required for working with the Chamelium since the Chamelium EDIDs enable limited color ranges by default on i915 and break frame dump comparisons/CRCs. Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Lyude <lyude@redhat.com>
2017-01-26igt_kms: Add igt_output_from_connector()Lyude
A simple helper for getting the igt_output_t struct corresponding to the given DRM connector id. Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Lyude <lyude@redhat.com>
2017-01-26igt_kms: Add helpers for watching for sysfs hotplug eventsLyude
This adds some basic helpers for connecting to udev and watching for sysfs hotplug events. Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Lyude <lyude@redhat.com> Changes since v1: - Remove unused arg from documentation Changes since v2: - Make udev_monitor explicit so that we can use this for detecting FSMs from the Chamelium in rpc calls
2017-01-21Revert "lib/igt_kms: Add missing function declaration"Chris Wilson
This reverts commit ac1d818ba12f9893a7aa481a7c050e7833dbed34. Just one declaration of kms_pipe_to_index(). It was not missing after all.
2017-01-20lib/igt_kms: Add missing function declarationRobert Foss
Add missing declaration for kmstest_pipe_to_index to header. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-01-13tests/kms_plane_lowres: Plane visibility after atomic modesetsMika Kahola
Testcase for plane visibility after atomic modesets. The idea of the test is the following: - draw a blue screen with high resolution - enable a yellow plane, visible, in lower-left corner - set a new lower resolution mode (1024x768) that makes plane invisible - check from debugfs 'i915_display_info' that the plane is invisible - switch back to higher resolution mode - check from debugfs 'i915_display_info' that the plane is visible again - repeat number of iterations, default 64 v2: allow test to be run on non-Intel drivers (Daniel) moved test for plane visibility to as helper function (Daniel) moved get_vblank() function to be part of helper functions (Daniel) rename 'tiling' parameter as 'modifier' (Daniel) select a mode from a list so that the plane should be invisible. use default 1024x768 mode only as a fallback if decent mode has not been found (Daniel) add tiling MODE_NONE (Daniel) v3: draw as many overlay planes as the platform supports + cursor plane on top of each other on lower-left corner skip the test if i915_display_info file is not available test plane visibility with igt_assert_plane_visibility() function drop option for multiple test iterations (Daniel Vetter) v4: switch 'for_each_connected_output()' to 'for_each_valid_output_on_pipe()' skip Y and Yf tiling for generations older than 9 (Maarten) Cc: Daniel Stone <daniel@fooishbar.org> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
2017-01-10lib/igt_kms: Remove output->valid againMaarten Lankhorst
This time add an explicit variable force_reprobe, which is set to true on initial probe and might be set again (in a future patch) after a hpd event. Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-01-07Revert "lib/igt_kms: Remove output->valid"Chris Wilson
This reverts commit 20258f2353a266f8fe19e7392eb282e58dd87f6a. This completely breaks igt running on bare hardware where it is required that igt probes the connectors before use. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-01-05lib/igt_kms: Remove output->validMaarten Lankhorst
None of the tests depend on it any longer, so it's time to kill. :) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-12-13igt_kms: Dynamically allocate igt_display->pipesLyude
Many GPUs have more then 3 pipes available, so hard limiting this to I915_MAX_PIPES prevents us from using anything that relies on igt_display_init() on non-intel systems (since we end up writing out of bounds and seg faulting). Fix this by dynamically allocating igt_display->pipes using the number of pipes we've detected on the GPU. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-12-08igt_kms: Remove support for drivers with <1 drm_planeLyude
We've had support for universal planes since kernel version 3.15, so there's not really a good reason to try supporting drivers that lack plane support now. As well, the current has_universal_planes logic is broken anyway as it makes the assumption that having display planes always means we have both a primary plane and a cursor plane (this isn't true on radeon/amdgpu and nouveau). So, remove this, and just check for whether or not we have a cursor plane. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-23lib/kms: Force connector probing on first useChris Wilson
In order for igt to run completely standalone, it must coldplug connectors on first use by forcing the probe. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-27lib/igt_kms: Add some more documentation to some common kms functions.Maarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-07-26igt_kms: Add more apis for panel fitting test.Maarten Lankhorst
igt_output_set_scaling_mode is a simple way to update scaling mode, igt_display_(try_)commit_atomic will allow you to call drmAtomicCommit with custom flags, like TEST_ONLY, EVENT, NONBLOCKING or without ALLOW_MODESET. This is useful when you only want to do any of those things, for events it can be useful to set the user_data pointer too, so export that to users. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-07-26igt_kms: Add modeset support to atomic commits.Maarten Lankhorst
Add the correct properties, add pipe_changed and mode_changed and go! Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-07-26igt_kms: Remove pan members from igt_plane, v2.Maarten Lankhorst
They're duplicates with src_x/y, so just use those. Changes since v1: - Fix order of parameters in calls to igt_fb_set_position. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-07-26igt_kms: Handle atomic pipe properties better.Maarten Lankhorst
Move properties to the pipe, they don't belong in the output and make atomic commit use the pipes for crtc properties. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-07-26igt_kms: Change PIPE_ANY behavior to mean unassigned, v2.Maarten Lankhorst
None of the tests requires that a output bound to PIPE_ANY is assigned, so don't do it. Fix the display commit to iterate over crtc's instead oof outputs to properly disable pipes without outputs. This also means that output->valid is only set after connecting a output to a pipe, so no longer depend on it in for_each_connected_output and similar macros. New code should use PIPE_NONE to avoid confusion, PIPE_ANY is a deprecated alias, and will be removed. Changes since v1: - Split out the property changes. - Split out the commit changes. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-07-26igt_kms: Make PIPE_ANY a alias for PIPE_NONEMaarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-07-26igt_kms: Remove kmstest_connector_config.crtc_idxMaarten Lankhorst
This is the same as using config.pipe because the order of crtcs will never change. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-07-04Added function kmstest_get_vbl_flag() to igt_kms.Marius Vlad
This function formats a pipe_id into the format expected by DRM while processing DRM_IOCTL_WAIT_VBLANK. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-07-04lib/igt_kms: Add support for up to 10 planes.Robert Foss
Increase the number of planes supported to 10. kmstest_plane_name only previously supported 4 planes, this patch adds support for up to 10 planes. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-06-29Revert "igt_kms: Add modeset support for atomic style commits."Maarten Lankhorst
This reverts commit 4a1859781f154513f19cd6392e04f50dbe6c030a. This commit wasn't ready yet, should never have been committed.
2016-06-29igt_kms: Add modeset support for atomic style commits.Maarten Lankhorst
All pipes are now updated in the loop first, before connectors are read out. The mode_id and active crtc properties are added, and crtc_id for connectors. These are required to do a modeset, and the behavior during atomic commits is changed slightly too. A lot of code will do the following: - Init. - igt_output_set_pipe(output, pipe); - commit. Since legacy setcrtc and atomic commit differ, there are some differences in how we commit pipes and connectors too. For atomic we set output->crtc during igt_output_set_pipe, and use it in atomic commit. This may be set to NULL, in which case the output is disconnected from the crtc. Unlike legacy we won't attempt to bind all connectors to all pipes, only the ones that were explicitly set. As a test, convert kms_rmfb.c Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-06-29lib/igt_kms: Add for_each_pipe_with_valid_output and ↵Maarten Lankhorst
for_each_valid_output_on_pipe. There are a lot of places where we do either for_each_pipe { igt_subtest_f(... "-pipe-C", pipe_name()) for_each_connected_output() /* Run subtest */ } or: igt_subtest_f(...) { for_each_pipe() for_each_connected_output() /* Run subtest */ } The former should be replaced with for_each_valid_output_on_pipe, the latter with for_each_pipe_with_valid_output. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-05-17lib/igt_kms: move gtk-doc comments next to the definitionJani Nikula
Now that we have actual functions for kms_test_*_str since commit 2d432fc5773df17f04283f4780dab161dd2e1c85 Author: Jani Nikula <jani.nikula@intel.com> Date: Wed May 11 12:42:06 2016 +0300 lib/igt_aux: define actual functions for kmstest_*_str move also the gtk-doc comments next to the definitions, for consistency. Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-04-22lib/igt_kms: Move IGT_MAX_PLANES into the igt_plane enumDaniel Vetter
Makes sure we automatically extend that when adding more planes. Inspired by a patch from Robert Foss who extended the max, but forgot all about the enum. While at it, also fix up the whitespace damage. Cc: robert.foss@collabora.com Acked-by: robert.foss@collabora.com Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-04-14lib: Add helper kmstest_dumb_map_bufferTomeu Vizoso
Which basically just calls DRM_IOCTL_MODE_MAP_DUMB and is similar to gem_mmap__gtt(). Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14lib: Add wrapper for DRM_IOCTL_MODE_CREATE_DUMBTomeu Vizoso
In order to test drivers that don't have support for proper buffer objects, add a wrapper for creating dumb buffer objects that will be called from the lib code for those subtests that don't need to care. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-05lib: kms: move framebuffer scanout offset/size to planeLionel Landwerlin
This fixes potential crashes when the framebuffer is unset from a given plane. v2: s/with/within/ typo in header Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Marius Vlad <marius.c.vlad@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-03-21lib: kms: add helpers for color management properties on pipesLionel Landwerlin
v2: Rename CTM_MATRIX property to CTM v3: Add support for atomic commits Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21lib: kms: add crtc_id to igt_pipe_tLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-15lib/igt_kms: Add COMMIT_ATOMIC to igt_display_commit2()Mayuresh Gharpure
Co-Author : Marius Vlad <marius.c.vlad@intel.com> Co-Author : Pratik Vishwakarma <pratik.vishwakarma@intel.com> So far we have had only two commit styles, COMMIT_LEGACY and COMMIT_UNIVERSAL. This patch adds another commit style COMMIT_ATOMIC which makes use of drmModeAtomicCommit() v2: (Marius) i)Set CRTC_ID to zero while disabling plane ii)Modified the log message in igt_atomic_prepare_plane_commit https://patchwork.freedesktop.org/patch/71945/ v3: (Marius)Set FB_ID to zero while disabling plane https://patchwork.freedesktop.org/patch/72179/ v4: (Maarten) Corrected the typo in commit message https://patchwork.freedesktop.org/patch/72598/ v5: Added check for DRM_CLIENT_CAP_ATOMIC in igt_display_init (Marius) i)Removed unused props from igt_display_init ii)Removed unused ret. Changed function to void iii)Declare the variable before checking if we have DRM_CLIENT_CAP_ATOMIC. https://patchwork.freedesktop.org/patch/73505/ v6: (Jani) Corrected typo in commit message v7: Added is_atomic check for DRM_CLIENT_CAP_ATOMIC in igt_display_init and igt_atomic_commit v8: (Matthew Auld) Replaced for loops by for_each_connected_output and for_each_plane_on_pipe (Lionel) Populate properties only if the value has changed Remove the resetting of values in disable case Note : I've used Maarten's diff patch v9: (Lionel) Added resetting of rotation property v10: (Marius) Modified the macro declaration to avoid shadow declaration warning, also removed one unused variable Signed-off-by: Mayuresh Gharpure <mayuresh.s.gharpure@intel.com> Signed-off-by: Pratik Vishwakarma <pratik.vishwakarma@intel.com> Signed-off-by: Mayuresh Gharpure <mayuresh.s.gharpure@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>