62 Commits

Author SHA1 Message Date
Thomas Wood
0986b432f8 lib: add PIPE_ANY to the pipe enum
This avoids compiler warnings about invalid enum values.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Ville Syrjälä
2b74b2bb33 tests: Add kms_legacy_colorkey
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-16 16:49:46 +03:00
chandra konduru
a26f9f9ad0 i-g-t: Adding plane scaling test case
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-14 17:44:34 +01:00
chandra konduru
ace4208702 i-g-t: Adding test case to test background color.
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-04-14 17:44:34 +01:00
Ander Conselvan de Oliveira
9aeff2b5c5 lib/kms: Add a way to override an output's mode
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-31 10:21:54 +01:00
Tvrtko Ursulin
e36091d1c7 tiling: Convert framebuffer helpers to use fb modifiers
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>
2015-03-12 14:23:48 +00:00
Thomas Wood
8d82e5b5ef lib: remove igt_edid.h
This has been replaced by igt_kms_get_base_edid().

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04 16:07:55 +00:00
Thomas Wood
273a06dc9b igt_kms: add a base edid
Add a basic edid block that includes several different display modes.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04 16:07:55 +00:00
Thomas Wood
519f377ddd doc: various spelling and typo fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30 17:54:02 +01:00
Ville Syrjälä
7b76754e0e lib: Add igt_plane_set_size()
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-18 12:56:56 +03:00
Thomas Wood
a124b1a430 lib: add kmstest_edid_add_3d
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-09-05 16:52:51 +01:00
Thomas Wood
fcb324c2cc lib: add igt_restore_vt_mode
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-14 15:02:17 +01:00
Daniel Vetter
1cad834261 lib/igt_kms: Simplify return value of kmstest_get_connector_config
A plain bool is enough.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Daniel Vetter
81dfcaba88 lib/igt_kms: Simplify return value of kmstest_get_connector_default_mode
A plain bool is good enough, no need for fancy negative error values.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Daniel Vetter
3b39bfff60 lib/igt_kms: Shuffle kmtests_ functions
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-12 19:36:53 +02:00
Daniel Vetter
33f0884f3c lib/igt_kms: set_vt_graphics_mode is a low-level helper
So give it a kmstest_ prefix and shuffle it around a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Daniel Vetter
9a15b5a5e2 lib/igt_kms: doc for type2str functions
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-12 19:36:53 +02:00
Daniel Vetter
27a19de059 lib/igt_kms: Clean up the other _name functions/macros
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-12 19:36:53 +02:00
Daniel Vetter
dd8fba44cd lib/igt_kms: Unify pipe name helpers
And add api doc while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Paulo Zanoni
d52365677e igt_kms: add kmstest_unset_all_crtcs()
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-07 15:44:06 -03:00
Paulo Zanoni
4924b78368 igt_kms: document and export kmstest_get_property()
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-08-07 15:42:22 -03:00
Thomas Wood
bb48429a6c lib: don't abort if forcing the connector state fails
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-30 11:13:13 +01:00
Damien Lespiau
753352cb3c igt_kms: Introduce a for_each_pipe() macro
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:21 +01:00
Damien Lespiau
068efd8d9f igt_kms: Add support for setting plane rotation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:21 +01:00
Damien Lespiau
b2eb48576f igt_kms: Add a way to query of the plane supports rotation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:21 +01:00
Thomas Wood
b6ed9fb0d9 lib: add igt_enable_connectors and igt_reset_connectors
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-11 11:47:46 +01:00
Thomas Wood
13cd79c128 lib: add the ability to set an EDID data block on a connector
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-11 11:47:46 +01:00
Thomas Wood
37ffb22d3c lib: add function to change connector states
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-11 11:47:46 +01:00
Yi Sun
b5333b416f kms_plane: Add panning test for primary plane
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-07 18:27:10 +01:00
Matt Roper
794a9fd6bc lib/kms: Add universal plane support (v2)
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-04 12:04:14 +01:00
Matt Roper
82bc03f392 lib/kms: Add igt_display_try_commit2()
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-04 12:04:12 +01:00
Matt Roper
1c25547d48 lib/kms: Add igt_display_commit2()
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-04 12:04:01 +01:00
Matt Roper
2a3e212acc lib/kms: Track need for vblank wait locally
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-04 12:03:45 +01:00
Matt Roper
3cc60bab46 lib/kms: Drop igt_pipe->need_set_{crtc, cursor}
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-07-04 12:03:26 +01:00
Thomas Wood
d96490af99 lib: add missing includes to headers
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-16 20:11:57 +02:00
Thomas Wood
52a3a2e205 lib: various documentation fixes
Fix some documentation comments and mark some struct members private.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-06-12 10:12:13 +01:00
Daniel Vetter
29ee36f259 lib: extract kmstest_set_connector_dpms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-30 18:07:58 +02:00
Daniel Vetter
64401f57e9 lib: fold igt_display into igt_kms
For 1 function and 2 types we kinda don't need separate files.
Especially now that igt_kms is much more focused on the actual modeset
stuff with all the framebuffer helpers extracted to igt_fb.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:28 +01:00
Daniel Vetter
9aea7ae541 lib/igt_fb: switch to igt_ prefix from kmstest_
Shorter and more in line with our general igt_ prefix for everything
which isn't somehow intel or i915-gem or otherwise hw specific - these
helpers here are all fully generic framebuffer handling functions
based on kms + cairo.

Well, the actual buffer alloc is done with i915 gem, but meh ;-)

Two special cases:
- bpp_depth_to_drm_format and drm_format_to_bpp completely lacked
  prefixes, so just add igt_.
- write_fb was a bit misleading given that we have gem_write for
  uploading to buffers. Rename that to write_fb_to_png to make it
  crystal clear what this thing does even without looking at docs.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
57d7db8cf8 lib: extract igt_fb library
Stuff all the framebuffer creation, cairo and drm fourcc format
handling in there. This gives us a very clear cut in the headers where
igt_fb.c only needs to include igt_fb.h, and igt_kms.c includes both
(well igt_kms.h pulls in igt_fb.h since we always need this).

The aim here is to add api docs for igt_fb since that part of the kms
library seems fairly stable already, while all the mode setting and
iteration is still a bit in flux.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
ef107940bb lib/igt_kms: make kmstest_get_cairo_surface static
Only used internally in igt_kms.c.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
2fc2fa5471 lib/igt_kms: s/kmstest_create_fb2/kmstest_create_fb/
Simplify the name since the old _fb function is now gone.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
70182167d6 lib: remove kmstest_create_fb
Use the new-style function using drm fourcc codes instead everywhere.

To easily use thew fourcc based interface also expose
bpp_depth_to_drm_format from the library. Finally include drm_fourcc.h
from the igt_kms.h header since pretty much everyone needs this now.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
f5daeec724 lib: extract igt_aux.[hc]
And shovel all the various helpers in there.

Also move igt_set_vt_graphics_mode to igt_kms.h since the function is
implemented in igt_kms.c. And it fits better. I kinda missed this in
the prep work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23 13:47:09 +01:00
Daniel Vetter
254f19ba8d lib: unnecessary header removal for drmtest.h, part 2
I've left unistd.h in it - it's not strictly required but most users
of drmtest.h want it for the open helpers, and then you kinda need to
close that file descriptor again ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:29:01 +01:00
Daniel Vetter
924115bfcd lib: more unecessary header removal
This time big with media_fill.h

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 20:18:51 +01:00
Daniel Vetter
6cfcd71589 lib: remove uncessary #includes from headers
Only include what the header itself needs. The big fish here is
intel-gpu-tools.h. More will follow.

One ugly thing removed here is the duplicated GEN6_TD_CTL #define, one
of which was broken.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 20:08:13 +01:00
Daniel Vetter
1e9e1baba3 lib/igt_kms: rip out custom verbose loggin support
Instead just piggy-pack on top of igt_log.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13 19:44:40 +01:00
Daniel Vetter
349ba5d3e1 lib: fix header include
drm/ path is for the headers from kernel sources, without when using
the pkgconfig libdrm version.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11 23:37:20 +01:00
Damien Lespiau
2043e6b265 lib: Fix igt_ouput_get_plane() typo (output)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 17:45:48 +00:00