3031 Commits

Author SHA1 Message Date
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
Daniel Vetter
fb38cf260b tests/kms_cursor_crc: Align opening {
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12 19:36:53 +02:00
Chris Wilson
2ce0691cd5 igt/gem_cpu_reloc: Update the memory requirements
Use intel_check_memory() for accuracy and beautification

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-12 15:34:12 +01:00
Ville Syrjälä
eda904c9d7 tests: Add kms_flip_event_leak test
kms_flip_event_leak will issue a page flip and close the file
descriptor before the flip has finished. This may cause the kernel
to leak the page flip event. The test itself won't actually fail but
if the kernel notices the leak and WARNs piglit will report a failure.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-08-11 19:12:52 +03:00
Paulo Zanoni
5a06d361b5 tests/pm_rpm: refactor the modesetting code
Refactor the code so the params for the modesets are always stored and
don't have to be recomputed every time. With this, we can get rid of
our FB caching structures, and we now also allow the subtests that do
special modesets to reuse the parameters used on the default modesets,
just changing whatever they want.

The biggest win here is that the test case subfunctions get smaller
and simpler to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:43 -03:00
Paulo Zanoni
5a978121d3 tests/pm_rpm: add disable_or_dpms_all_screens()
And its and_wait() version. The goal is to extract common code
patterns into functions/macros, so the code for the test cases gets
easier to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:39 -03:00
Paulo Zanoni
1892059842 tests/pm_rpm: add macros to disable/enable screens and wait
This should make the test case functions better to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:34 -03:00
Paulo Zanoni
f6ffa3ca7f tests/pm_rpm: add wait_for_suspended() calls to test_one_plane
Make sure we do all operations while really runtime suspended, so we
can actually test things.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:29 -03:00
Paulo Zanoni
a17f0604ef tests/pm_rpm: add subtests for fences
Daniel thought fences were not surviving runtime PM on DPMS, so we
wrote this test to check. The good news is that the test passed, so
there's no need for a Kernel patch, at least on the Kernel I tested.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:44:28 -03: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
da458758e7 tests/pm_rpm: use kmstest_get_property()
So we can reduce the code size.

v2: Rebase after the rename to kmstest_get_property.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:43:00 -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
Paulo Zanoni
053c104322 igt_kms: optionally return the property from get_property
So we can use this function on places that also need the property
pointer, without having to call drmModeGetProperty() again with the
returned id.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:41:55 -03:00
Paulo Zanoni
18d8ea7fe4 igt_kms: pass drm_fd instead of igt_display_t on some functions
Since these functions only really use the drm_fd. The goal is to be
able to reuse these functions on programs that don't use the
igt_display_t structure.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:41:28 -03:00
Paulo Zanoni
61920c68d8 igt_kms: don't get drmModeRes just to free it later
Stress testing malloc is not our goal :)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:41:02 -03:00
Paulo Zanoni
bfb5a75775 tests/pm_rpm: add subtests for planes and cursors
These tests should trigger WARNs on Kernels that don't have the most
recent fixes.

v2: - Merge both the cursor and planes patches into one so it's easier
      to update them.
    - Extend the tests a little bit to exercise fences.
    - Fix bug found by Matt to enable the test to run on older Kernels

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:40:28 -03:00
Sean V Kelley
17d63e4968 lib/chv: CHV media pipeline command sequence
Enable gem_media_fill test for CHV platform.  In addition to differences in
media IP blocks from Broadwell, the command sequence also differs for
programming the media pipeline, e.g., should not send a MEDIA_STATE_FLUSH
right before the MI_BATCH_BUFFER_END of batch buffers using MEDIA_OBJECT.
Uses explicit IS_BROADWELL / IS_CHERRYVIEW to distinguish in gen8 media
fill handling.

Signed-off-by: Sean V Kelley <sean.v.kelley@intel.com>
Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-06 18:04:14 +02:00
Gaurav K Singh
ac31f19264 intel_bios_reader: Add support to dump MIPI Sequence block #53
Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-01 17:48:53 +01:00
Gaurav K Singh
525044ba32 intel_bios_reader: Add support to dump MIPI Configuration Block #52
Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-01 17:48:48 +01:00
Thomas Wood
ff6b068ecd testdisplay: ignore invalid subtest options
testdisplay does not have any subtests and should therefore exit with
the appropriate exit code if the --list-subtests or --run-subtest
options are used.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-31 16:30:01 +01:00
Chris Wilson
de1e877be5 core: Add all kernel log levels
And notice that INFO is 6 not 5. This is because I had intended to use
KERN_NOTICE anyway...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-30 12:04:46 +01:00
Thomas Wood
9b500dbf6b Update .gitignore files
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:16:09 +01: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
Thomas Wood
c3ba7740c1 lib: check test options for conflicts
Check any test specific options for conflicts with the standard set of
options.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:13:13 +01:00
Thomas Wood
fc5e25750f lib: avoid getopt value conflicts with tests
Most tests use a printable character as the value for getopt to return,
so avoid conflicts by using non-printing values for the standard options.

v2: fix "-h" short option

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:13:13 +01:00
Thomas Wood
8fc4107c91 testdisplay: set a non-zero exit code if getopt detected an error
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:13:13 +01:00
Ben Widawsky
2fae99bf2c lib: Add ndebug to the headers
If you don't do this, it is excluded from the tarball generated by make
distcheck.

1.6 and 1.7 both are not buildable as a result.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-07-29 17:00:28 -07:00
Daniel Vetter
21e9422b01 tests/gem_ringfill: add interruptible mode
Should be useful to test intel_ring_begin restart behaviour a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-29 18:46:09 +02:00
Damien Lespiau
660a7ffdba testdisplay: Destroy the cairo context once the fb is painted
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
0db75bb3f9 lib: Don't take a reference to the surface in get_cairo_surface()
We don't need to keep a reference to the surface, the cairo context will
keep a reference to it until we destroy it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
72357f3de0 lib: NULLify ->cairo_surface once unmapped
Just a matter of not leaving dangling pointers around.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
4aadbc817b lib: Split the GTT mapping out of get_cairo_surface()
This is preparation work for when we need a different way to get a
linear buffer we can use with cairo.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
f5959af8a5 lib: Remove unused field from struct igt_fb
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Chris Wilson
e48c495572 igt/pm_rps: Fix assertion in load_helper_stop
The load_helper isn't killed by the signal, but it exits gracefully. So
update the assertion to check for the successful exit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-27 15:39:58 +01:00
Chris Wilson
a6e6c5bdcf drmtest: First check that driver is i915
Before issuing any i915 specific ioctls, check the driver is i915
otherwise we make other drivers emit nasty errors at the start of every
test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-25 17:38:19 +01:00
Thomas Wood
fcbc5028ae quick_dump: fix distcheck
version.h is now generated in the libs directory, so make sure it is
correctly included in the compiler flags.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-25 14:46:51 +01:00
Tim Gore
57bd86068a intel-gpu-tools: fix version.h creation in android
commit 743dc7997aa9f5210055896940d87c88983dcda6
breaks the build under Android because version.h
is not created. This happens because the android
make executes from the ANDROID_BUILD_TOP directory
rather than from the directory containing the source
files, so we need to differentiate between Android
and linux builds. This is V2 of this patch based on
Thomas Wood's suggestion.

Signed-off-by: Tim Gore <tim.gore@intel.com>
[Thomas: Fix distcheck issues]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-25 14:46:51 +01:00
Thomas Wood
8408e00e62 testdisplay: only set terminal attributes when in foreground process group
The Piglit test runner for intel-gpu-tools creates a new process group
for the test processes, so attempting to set terminal attributes causes
the process to receive SIGTTOU and be stopped. Since the test is not run
interactively in this case, the issue can be avoided by not setting
terminal attributes if the process is not in the foreground process
group.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-25 14:46:51 +01:00
Chris Wilson
b9e7637542 core: Inject program name into dmesg
Write the program name if !list_only so that we associate oops with
simple tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-25 14:39:18 +01:00
Chris Wilson
e0dffbdeda core: Improve phrasing for test requirements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-25 14:39:18 +01:00
Tim Gore
72b1263649 intel-gpu-tools: add sys/wait.h to pm_rps.c
commit 745945546f7366a413a3a51a37f90caa3a227b1d
breaks the build under Android because some of the
macros used in pm_rps.c are defined in sys/wait.h
which is not included.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-25 09:36:10 +02:00
Daniel Vetter
93d07ab898 NEWS: Don't forget new universal plane commit for igt_kms
Suggest by Matt Roper.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-25 09:29:35 +02:00
Chris Wilson
52915fc88a core: Inject subtest message into dmesg
One of the side-effects we test for are kernel oops and knowing the
guilty subtest can help speed up debugging. We can write to /dev/kmsg to
inject messages into dmesg, so let's do so before the start of every
test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-24 14:54:30 +01:00
Chris Wilson
66e46630f8 igt_core: Read manpages more carefully for WNOHANG
/me hides

I thought it said it would not return for a signal and stopped thinking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-24 12:02:36 +01:00
Chris Wilson
745945546f igt_core: Refactor igt_stop_helper() to use igt_wait_helper()
Reduce code duplication as the igt_stop_helper can reuse
igt_wait_helper() to replace its own waiting routine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-24 11:52:37 +01:00