summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
AgeCommit message (Collapse)Author
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>
2016-03-03tests: fix CRTC assignment for a few testsPaulo Zanoni
All the tests I wrote always assumed that every connector supported CRTC 0. This is not the case for BSW and possibly others, so fix the tests before the CI reports more failures. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03lib/igt_kms: add kmstest_get_crtc_idxPaulo Zanoni
Move it from pm_rpm.c to lib/igt_kms and remove the hardcoded version from kms_frontbuffer_tracking. I'm also planning to add other callers. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-26lib/igt_kms, tests/testdisplay: allow probing of new connector modesJesse Barnes
Fixup some fallout from the connector probing changes so testdisplay -m will pick up newly hotplugged displays correctly. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org.
2015-12-08tests/kms_force_connector_basic: Add prune-stale-modes subtestVille Syrjälä
Add a new subtest that makes sure old stale modes get pruned from the connector's mode list when the EDID changes. v2: s/drmModeGetConnector/drmModeGetConnectorCurrent/ since kmstest_force_edid() already takes care of doing the heavier call for us (Daniel) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-11lib: add PIPE_ANY to the pipe enumThomas Wood
This avoids compiler warnings about invalid enum values. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-16tests: Add kms_legacy_colorkeyVille Syrjälä
Add a quick test to make sure the legacy set colorkey ioctl only works for sprite planes. v2: Drop igt_fixtures Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-04-14i-g-t: Adding plane scaling test casechandra konduru
This patch is adding i-g-t plane scaling test case to test couple basic display plane scaling usages. Additional test scenarios can be added later. v2: -Added iterative scaling to visually observe scaling (me) v3: -Added a flag to control primary plane scaling (me) v4: -Use new tiled types when calling igt_create_fb (me) Signed-off-by: chandra konduru <chandra.konduru@intel.com> [Thomas: convert test to use igt_simple_main] Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14i-g-t: Adding test case to test background color.chandra konduru
Adding i-g-t test case to test display crtc background color. v2: - Added IGT_TEST_DESCRIPTION() (Thomas Wood) - Added to .gitignore (Thomas Wood) - Added additional details to function header (Thomas Wood) - Simplified igt_main (Thomas Wood) v3: - rebased to latest master (me) - took sleep calls out (Daniel) - use new tiled types when calling igt_create_fb (me) Signed-off-by: chandra konduru <chandra.konduru@intel.com> [Thomas: convert test to use igt_simple_main] Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-31lib/kms: Add a way to override an output's modeAnder Conselvan de Oliveira
So that it is possible to use a custom mode with the simplified mode set API. v2: Add documentation for igt_output_override_mode(). (Thomas) Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-12tiling: Convert framebuffer helpers to use fb modifiersTvrtko Ursulin
This converts the IGT API only, underneath legacy set_tiling is still used. v2: One got away in kms_flip. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-12-04lib: remove igt_edid.hThomas Wood
This has been replaced by igt_kms_get_base_edid(). Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04igt_kms: add a base edidThomas Wood
Add a basic edid block that includes several different display modes. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30doc: various spelling and typo fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-18lib: Add igt_plane_set_size()Ville Syrjälä
Allow tests to specify the plane size instead of assuming that the entire FB will be scanned out. To keep the current tests working without having to sprinkle igt_plane_set_size() calls all over the place, make igt_plane_set_fb() reset the plane size to the FB size. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-09-05lib: add kmstest_edid_add_3dThomas Wood
kmstest_edid_add_3d adds an EDID extension block with 3D support to a copy of the specified EDID. v2: Avoid using an invalid CEC SPA (Clint Taylor) Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-08-14lib: add igt_restore_vt_modeThomas Wood
Add a function to restore the previous VT mode after igt_set_vt_graphics_mode is called. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-08-12lib/igt_kms: Simplify return value of kmstest_get_connector_configDaniel Vetter
A plain bool is enough. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Simplify return value of kmstest_get_connector_default_modeDaniel Vetter
A plain bool is good enough, no need for fancy negative error values. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Shuffle kmtests_ functionsDaniel Vetter
Group them a bit both in the header and .c file, and make sure they appear in the same order in both. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: set_vt_graphics_mode is a low-level helperDaniel Vetter
So give it a kmstest_ prefix and shuffle it around a bit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: doc for type2str functionsDaniel Vetter
Also shuffle things around a bit to make sure the order in the header matches the order in the .c file. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Clean up the other _name functions/macrosDaniel Vetter
And remove sprite_name, redundant and won't work due to lack of dev_priv. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Unify pipe name helpersDaniel Vetter
And add api doc while at it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-07igt_kms: add kmstest_unset_all_crtcs()Paulo Zanoni
Both pm_rpm.c and pm_lpsp.c call it "disable_all_screens", but let's give it a name that better describes what the implementation does. v2: Rename to kmstest_unset_all_crtcs (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07igt_kms: document and export kmstest_get_property()Paulo Zanoni
So we can use it on pm_rpm.c. v2: Rename to kmstest_get_property (Daniel) Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-07-30lib: don't abort if forcing the connector state failsThomas Wood
Ensure tests using igt_enable_connectors can still run even if the relevant debugfs files are not available. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11igt_kms: Introduce a for_each_pipe() macroDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11igt_kms: Add support for setting plane rotationDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11igt_kms: Add a way to query of the plane supports rotationDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11lib: add igt_enable_connectors and igt_reset_connectorsThomas Wood
igt_enable_connectors forces connectors to be enabled where doing so is known to work well. igt_reset_connectors resets the force state on all connectors.
2014-07-11lib: add the ability to set an EDID data block on a connectorThomas Wood
Add a function to set an EDID data block on a connector and include a set of generic EDID blocks for testing. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11lib: add function to change connector statesThomas Wood
Add an API function and a test program to force a particular state on a connector. v2: mask the correct part of the minor number to get the card number (Chris Wilson) Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-07kms_plane: Add panning test for primary planeYi Sun
Get CRCs of a full red and a full blue surface as reference. Create a big framebuffer that is twice width and twice height as the current display mode. Fill the top left quarter with red, bottom right quarter with blue Check the scanned out image with the CRTC at position (0, 0) of the framebuffer and it should be the same CRC as the full red fb Check the scanned out image with the CRTC at position (hdisplay, vdisplay) and it should be the same CRC as the full blue fb v2: Fix a few things here and there (Damien) Cc: Lei Liu <lei.a.liu@intel.com> Cc: Yi Sun <yi.sun@intel.com> Signed-off-by: Lei Liu <lei.a.liu@intel.com> Signed-off-by: Yi Sun <yi.sun@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Add universal plane support (v2)Matt Roper
Add support for universal planes. This involves revamping the existing plane handling a bit to allow primary & cursor planes to come from the DRM plane list, rather than always being manually added. v2: Don't drop fixed ordering of internal plane list. Primary will always be index 0, cursor will always be last in internal plane list. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Add igt_display_try_commit2()Matt Roper
Add a new public API that will attempt a display commit, but will return an error code upon failure rather than failing the IGT test. This is intended to allow igt tests to verify that the expected error codes are returned to userspace when invalid requests are issued. Note that with non-atomic programming, a single commit operation has several potential failure points internally; the first non-zero error code encountered will be returned immediately and no further programming will be performed by the commit. It is the caller's responsibility to return to a sane state. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Add igt_display_commit2()Matt Roper
Add a new commit interface, igt_display_commit2(), that allows tests to specify which programming API should be used to perform hardware updates. COMMIT_LEGACY is the only option for now, but universal and atomic interfaces will be added as additional options in the future. igt_display_commit() remains unchanged for existing tests that wish to place the hardware in a specific state, but that don't care which API is used to achieve that state. The legacy API will be used by default for now, but in the future we may decide to make the default API configurable via an environment variable. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Track need for vblank wait locallyMatt Roper
The need to wait for a vblank after programming is due to the way we actually program the hardware. Move need_wait_for_vblank out of the pipe and into a local variable in preparation for future programming styles (e.g., atomic pageflip) that will need different logic. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Drop igt_pipe->need_set_{crtc, cursor}Matt Roper
The "need" flags on igt_pipe simply mirror the fb_changed field of the primary/cursor planes. Drop them and just use fb_changed instead. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-06-16lib: add missing includes to headersThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>