platform/upstream/intel-gpu-tools.git
10 years agokms_plane: Remove spurious inclusion of glib.h
Damien Lespiau [Tue, 18 Feb 2014 14:16:49 +0000 (14:16 +0000)]
kms_plane: Remove spurious inclusion of glib.h

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotest/kms_flip: fix up igt logging conversion
Daniel Vetter [Thu, 13 Feb 2014 18:22:53 +0000 (19:22 +0100)]
test/kms_flip: fix up igt logging conversion

Silly me ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotestdisplay: Allow to specify the dpms level
Daniel Vetter [Thu, 13 Feb 2014 18:22:35 +0000 (19:22 +0100)]
testdisplay: Allow to specify the dpms level

aka the jbarnes-me-harder mode

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotestdisplay: implement dpms test
Daniel Vetter [Thu, 13 Feb 2014 18:15:38 +0000 (19:15 +0100)]
testdisplay: implement dpms test

For those who wonder about the -j switch ... all the good ones have
been taken, so this is the Jesse-flag.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoNEWS: Mention new logging support
Daniel Vetter [Thu, 13 Feb 2014 13:43:20 +0000 (14:43 +0100)]
NEWS: Mention new logging support

10 years agotests/kms_flip: use igt logging
Daniel Vetter [Thu, 13 Feb 2014 13:25:55 +0000 (14:25 +0100)]
tests/kms_flip: use igt logging

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_seqno_wrap: use igt logging
Daniel Vetter [Thu, 13 Feb 2014 13:12:03 +0000 (14:12 +0100)]
tests/gem_seqno_wrap: use igt logging

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotest/pm_rps: use igt logging
Daniel Vetter [Thu, 13 Feb 2014 13:09:41 +0000 (14:09 +0100)]
test/pm_rps: use igt logging

Cc: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: (somewhat) structured logging support
Daniel Vetter [Wed, 12 Feb 2014 14:19:15 +0000 (15:19 +0100)]
lib: (somewhat) structured logging support

Apparently there's a bit a need for more verbose output in testcases,
mostly for debugging purposes. At least gem_reset_stats and pm_rps
have a verbose mode.

On top of that we're currently not taking advantage of piglit's "warn"
state all that much. But I think it might be useful for testcases which
are notorious for some kinds of spurious failures, like e.g. the really
nasty timing checks in kms_flip. If we demote some of them to just
warnings we could run the overall tests more often.

Hence this patchs adds a new igt_log function with the three levels DEBUG,
INFO and WARN. Plus a bunch of convenience helpers to keep the test
code tidy.

The level can be set through an enviroment vairable IGT_LOG_LEVEL with
info being the default. Also tests can look at the selected log level in
case they want to run costly debug functions only when needed.

Comments highly welcome, I plan to roll this out over tests which can
use it (not all, imo that's too much churn) once we've settled on the
interfaces/semantics.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoAssembler/bdw: Remove the unsupported cache agent for WRITE(...)
Zhao Yakui [Tue, 28 Jan 2014 01:53:50 +0000 (09:53 +0800)]
Assembler/bdw: Remove the unsupported cache agent for WRITE(...)

The Sampler/Constant cache is read-only. And it can't be used as
the target cache agent of WRITE message.

Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotests: fix sub-test enumeration
Thomas Wood [Wed, 12 Feb 2014 15:54:27 +0000 (15:54 +0000)]
tests: fix sub-test enumeration

Ensure sub-tests can be listed correctly by doing any test setup within
an igt_fixture block.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoNEWS: Mention Damien's new helper library
Daniel Vetter [Tue, 11 Feb 2014 23:12:07 +0000 (00:12 +0100)]
NEWS: Mention Damien's new helper library

10 years agolib: Make igt_skip noreturn
Daniel Vetter [Tue, 11 Feb 2014 22:54:19 +0000 (23:54 +0100)]
lib: Make igt_skip noreturn

This is a remnant from the subtest code before we had proper
fixture blocks. With those there's no no reason to have igt_skip
calls outside of fixtures or subtests, so we can assert this and
hence always jump out.

Suggested by Thomas Wood since static analyzers got confused about
this.

To check for fallout I've run all tests as non-root so that they'll
all skip. Only very little fallout resulted.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: install exit handler only on success for prefault control
Daniel Vetter [Tue, 11 Feb 2014 23:07:11 +0000 (00:07 +0100)]
lib: install exit handler only on success for prefault control

Otherwise we'll hit an igt_skip in the exit handler, which upsets
the new in_fixture||in_subtests checks.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotest/gem_gtt_hog: bail out earlier
Daniel Vetter [Tue, 11 Feb 2014 23:05:57 +0000 (00:05 +0100)]
test/gem_gtt_hog: bail out earlier

This way we properly skip instead of failing hard. Just result
polish when running on non-intel systems.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_madvise: use correct main block
Daniel Vetter [Tue, 11 Feb 2014 22:52:43 +0000 (23:52 +0100)]
tests/gem_madvise: use correct main block

igt_simple_main doesn't enumerate subtests ...

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_bad_ctx_exec: Properly wrap in igt_fixtures
Daniel Vetter [Tue, 11 Feb 2014 22:50:10 +0000 (23:50 +0100)]
tests/gem_bad_ctx_exec: Properly wrap in igt_fixtures

Caught by the new nasty assert in igt_skip.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_close_race: Properly wrap init code in fixtures
Daniel Vetter [Tue, 11 Feb 2014 22:47:50 +0000 (23:47 +0100)]
tests/gem_close_race: Properly wrap init code in fixtures

Blows up otherwise if there's no intel gpu around.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: fix header include
Daniel Vetter [Tue, 11 Feb 2014 22:36:24 +0000 (23:36 +0100)]
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>
10 years agolib/display: Fix typo in igt_plane_get_fd_id() (fb)
Damien Lespiau [Tue, 11 Feb 2014 17:53:00 +0000 (17:53 +0000)]
lib/display: Fix typo in igt_plane_get_fd_id() (fb)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Remove igt_display_get_n_pipes() usage in main
Damien Lespiau [Tue, 11 Feb 2014 17:48:32 +0000 (17:48 +0000)]
kms_pipe_crc_basic: Remove igt_display_get_n_pipes() usage in main

The fixture won't be run when listing the subtests and thus we can't use
igt_display_get_n_pipes() in the list of tests. The alternative here is
to list the subtests with the maximum values and skip when not supported
on the platform.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Fix igt_ouput_get_plane() typo (output)
Damien Lespiau [Tue, 11 Feb 2014 17:45:48 +0000 (17:45 +0000)]
lib: Fix igt_ouput_get_plane() typo (output)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Don't wait in igt_wait_for_keypress() if stdin is not a tty
Damien Lespiau [Tue, 11 Feb 2014 13:54:10 +0000 (13:54 +0000)]
lib: Don't wait in igt_wait_for_keypress() if stdin is not a tty

When running in a non interactive terminal, there's little point in
trying to wait for some input on stdin.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_plane: Start a basic display plane test
Damien Lespiau [Thu, 6 Feb 2014 21:20:35 +0000 (21:20 +0000)]
kms_plane: Start a basic display plane test

We test the sprite plane positionning in there, for now.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Fix assertion in set_plane()
Damien Lespiau [Fri, 7 Feb 2014 14:12:44 +0000 (14:12 +0000)]
lib/display: Fix assertion in set_plane()

When cycling throuth planes, we still want to reach the cursor plane. We
have to special case IGT_PLANE_CURSOR as a shorthand to select the
cursor plane (the last plane on the pipe).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Wait for a vblank after SetPlane()
Damien Lespiau [Thu, 6 Feb 2014 21:18:28 +0000 (21:18 +0000)]
lib/display: Wait for a vblank after SetPlane()

Let's be testing friendly and gently wait for the next vblank before
returning from commit() when needed.

After igt_display_commit() one can safely look at the CRC.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Print the fb id, not its pointer in the set_fb() log message
Damien Lespiau [Thu, 6 Feb 2014 21:06:59 +0000 (21:06 +0000)]
lib/display: Print the fb id, not its pointer in the set_fb() log message

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Add a way to wait at every commit for inspection
Damien Lespiau [Thu, 6 Feb 2014 21:06:25 +0000 (21:06 +0000)]
lib/display: Add a way to wait at every commit for inspection

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Add a helper to wait for a keypress
Damien Lespiau [Thu, 6 Feb 2014 21:06:07 +0000 (21:06 +0000)]
lib: Add a helper to wait for a keypress

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Use kmstest_create_color_fb()
Damien Lespiau [Thu, 6 Feb 2014 19:10:51 +0000 (19:10 +0000)]
kms_pipe_crc_basic: Use kmstest_create_color_fb()

Reducing again the per-test number of lines.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Include drm_fourcc.h from igt_kms.h
Damien Lespiau [Thu, 6 Feb 2014 19:09:53 +0000 (19:09 +0000)]
lib: Include drm_fourcc.h from igt_kms.h

This include is needed for the DRM_FORMAT* defines used in the fb
creation helpers.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_cursor_crc: Use kmstest_create_color_fb()
Damien Lespiau [Thu, 6 Feb 2014 19:04:58 +0000 (19:04 +0000)]
kms_cursor_crc: Use kmstest_create_color_fb()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Introduce a new helper kmstest_create_color_fb()
Damien Lespiau [Thu, 6 Feb 2014 19:04:12 +0000 (19:04 +0000)]
lib: Introduce a new helper kmstest_create_color_fb()

We need to create fbs of a single color in a few places. Time to
abstract that out to a helper function.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Add support for DRM planes
Damien Lespiau [Thu, 6 Feb 2014 17:54:33 +0000 (17:54 +0000)]
lib/display: Add support for DRM planes

We can now extend our plane support beyond primary and cursor planes.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotests/kms_cursor_crc: Use igt_pipe_crc_collect_crc()
Damien Lespiau [Thu, 6 Feb 2014 16:26:31 +0000 (16:26 +0000)]
tests/kms_cursor_crc: Use igt_pipe_crc_collect_crc()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/crc: Add a helper to read a single CRC value
Damien Lespiau [Thu, 6 Feb 2014 16:17:38 +0000 (16:17 +0000)]
lib/crc: Add a helper to read a single CRC value

In this case, we also take care of starting/stopping the CRC collection.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/crc: Factor out reading a single CRC value
Damien Lespiau [Thu, 6 Feb 2014 16:17:14 +0000 (16:17 +0000)]
lib/crc: Factor out reading a single CRC value

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Check if we're trying to use the same pipe on 2 outputs
Damien Lespiau [Thu, 6 Feb 2014 16:05:19 +0000 (16:05 +0000)]
lib/display: Check if we're trying to use the same pipe on 2 outputs

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Allow to override the display verbosity with an env variale
Damien Lespiau [Wed, 5 Feb 2014 17:51:50 +0000 (17:51 +0000)]
lib/display: Allow to override the display verbosity with an env variale

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_cursor_crc: Port the test to the new modeset API
Damien Lespiau [Wed, 5 Feb 2014 17:14:12 +0000 (17:14 +0000)]
kms_cursor_crc: Port the test to the new modeset API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Add a way to specify we don't care about the pipe to use
Damien Lespiau [Thu, 6 Feb 2014 15:45:42 +0000 (15:45 +0000)]
lib/display: Add a way to specify we don't care about the pipe to use

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Add support for the cursor plane
Damien Lespiau [Wed, 5 Feb 2014 16:36:51 +0000 (16:36 +0000)]
lib/display: Add support for the cursor plane

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Fix the SetCrtc disabling log message
Damien Lespiau [Wed, 5 Feb 2014 15:54:13 +0000 (15:54 +0000)]
lib/display: Fix the SetCrtc disabling log message

We were displaying the value of fb_id (0), when the actual interesting
thing about this call it that it'll just down the pipe.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotests/kms_cursor_crc: Move the array of cursor fb_ids to the stack
Damien Lespiau [Wed, 5 Feb 2014 15:32:15 +0000 (15:32 +0000)]
tests/kms_cursor_crc: Move the array of cursor fb_ids to the stack

This array is not used outside ouf create_cursor_fb(). A stack allocated
array is enough.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Use igt_display_get_n_pipes() instead of hardcoding 3
Damien Lespiau [Tue, 4 Feb 2014 15:11:29 +0000 (15:11 +0000)]
kms_pipe_crc_basic: Use igt_display_get_n_pipes() instead of hardcoding 3

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/display: Add an accessor to retrieve the number of pipes
Damien Lespiau [Tue, 4 Feb 2014 14:59:39 +0000 (14:59 +0000)]
lib/display: Add an accessor to retrieve the number of pipes

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Use for_each_connected_output()
Damien Lespiau [Tue, 4 Feb 2014 12:07:56 +0000 (12:07 +0000)]
kms_pipe_crc_basic: Use for_each_connected_output()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Introduce a for_each_connected_output() macro
Damien Lespiau [Tue, 4 Feb 2014 12:06:57 +0000 (12:06 +0000)]
lib: Introduce a for_each_connected_output() macro

So we can easily cycle through them in tests without knowing too many
internal details about how igt_display_t organize its data.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Introduce symbolic names for display planes
Damien Lespiau [Sun, 2 Feb 2014 17:48:24 +0000 (17:48 +0000)]
lib: Introduce symbolic names for display planes

It'd be nice to have symbolic names for planes instead of using an index
in igt_output_get_plane().

We also namespace the enum to not conflict with anyone.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Port to the new modeset API
Damien Lespiau [Mon, 27 Jan 2014 16:32:09 +0000 (16:32 +0000)]
kms_pipe_crc_basic: Port to the new modeset API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Introduce a modeset API
Damien Lespiau [Mon, 27 Jan 2014 16:25:43 +0000 (16:25 +0000)]
lib: Introduce a modeset API

The goals here are:
  - Reduce duplicated code in each KMS test
  - Provide an API that looks more like what we want for atomic
    modesets. The hope is then that it'll be easy to switch, at
    run-time, between the "legacy" path and atomic modesets, keeping
    the same API for tests.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotests/gem_seqno_wrap: fix over allocation of arrays
Thomas Wood [Fri, 7 Feb 2014 17:03:39 +0000 (17:03 +0000)]
tests/gem_seqno_wrap: fix over allocation of arrays

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoassembler: fix condition for printing a warning
Thomas Wood [Fri, 7 Feb 2014 17:03:38 +0000 (17:03 +0000)]
assembler: fix condition for printing a warning

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agodebugger: fix the -p option
Thomas Wood [Fri, 7 Feb 2014 17:03:37 +0000 (17:03 +0000)]
debugger: fix the -p option

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: Fix up skip_henceforth checks
Daniel Vetter [Tue, 11 Feb 2014 11:14:09 +0000 (12:14 +0100)]
lib/drmtest: Fix up skip_henceforth checks

We need to first check whether we'll even run the testcase before
deciding to print a premature SKIP/FAIL. Without this and global
skipped resulted in superflous output when running only one testcase.

References: https://bugs.freedesktop.org/show_bug.cgi?id=74100
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_reset_stats: Correctly wrap global test code
Daniel Vetter [Tue, 11 Feb 2014 11:04:57 +0000 (12:04 +0100)]
tests/gem_reset_stats: Correctly wrap global test code

Tests _must_ be able to run as non-root and on non-intel platforms,
otherwise the enumeration is busted (since QA enumerates testcases on
a gpu-less xeon box).

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/pm_rps: remove setfreq
Daniel Vetter [Fri, 7 Feb 2014 09:02:41 +0000 (10:02 +0100)]
tests/pm_rps: remove setfreq

It's unused.

Cc: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/pm_rps: Round requested freq correctly
Daniel Vetter [Fri, 7 Feb 2014 08:59:42 +0000 (09:59 +0100)]
tests/pm_rps: Round requested freq correctly

The kernel will round it, so if we don't we'll have a spurious
mismatch. Happens on my machine here with 650-1300MHz range, where the
midpoint is 975.

Cc: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: fix signed/unsigned comparison issues
Thomas Wood [Thu, 6 Feb 2014 16:31:54 +0000 (16:31 +0000)]
lib: fix signed/unsigned comparison issues

Store the result of set_vt_mode as a signed value so that errors can be
caught correctly.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoassembler: define YY_NO_INPUT to prevent unused symbol warnings
Thomas Wood [Thu, 6 Feb 2014 16:23:42 +0000 (16:23 +0000)]
assembler: define YY_NO_INPUT to prevent unused symbol warnings

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/pm_rps: Fix compilation on Linux
Daniel Vetter [Thu, 6 Feb 2014 06:49:33 +0000 (07:49 +0100)]
tests/pm_rps: Fix compilation on Linux

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: New subtest for gpu reset
Jeff McGee [Fri, 31 Jan 2014 16:13:53 +0000 (10:13 -0600)]
pm_rps: New subtest for gpu reset

Test that RPS functions as expected after a gpu reset.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: Add variable load support to load helper
Jeff McGee [Fri, 31 Jan 2014 16:13:52 +0000 (10:13 -0600)]
pm_rps: Add variable load support to load helper

The load helper can be set to HIGH or LOW. HIGH is the original mode
of sending continuous dword store commands. LOW adds a pause between
each command to reduce throughput.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: Load helper should stall for last write
Jeff McGee [Fri, 31 Jan 2014 16:13:51 +0000 (10:13 -0600)]
pm_rps: Load helper should stall for last write

This ensures that gpu is quiescent when load helper exits.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: Add stop rings injection utility
Jeff McGee [Fri, 31 Jan 2014 16:13:50 +0000 (10:13 -0600)]
pm_rps: Add stop rings injection utility

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: New subtest min-max-config-loaded
Jeff McGee [Wed, 29 Jan 2014 00:25:06 +0000 (18:25 -0600)]
pm_rps: New subtest min-max-config-loaded

Like subtest basic-api, but additionally requires that current
frequency is increasing to the configured maximum within reasonable
time since we are loaded.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: Add load helper for loading gpu
Jeff McGee [Wed, 29 Jan 2014 00:25:05 +0000 (18:25 -0600)]
pm_rps: Add load helper for loading gpu

The load helper submits repeated dword store commands to keep the
gpu loaded while subtests running in the parent process check for
expected rps response.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: Add igt_wait_helper
Jeff McGee [Wed, 29 Jan 2014 00:25:04 +0000 (18:25 -0600)]
lib/drmtest: Add igt_wait_helper

igt_wait_helper compliments igt_stop_helper and is used when helper
processes are expected to exit naturally.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: New subtest min-max-config-idle
Jeff McGee [Wed, 29 Jan 2014 00:25:03 +0000 (18:25 -0600)]
pm_rps: New subtest min-max-config-idle

Like subtest basic-api, but additionally requires that current
frequency is settling to the configured minimum within reasonable
time since we are idle.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: fix hang in quiescent_gpu_at_exit due to signal-unsafe asprintf
Imre Deak [Wed, 5 Feb 2014 11:48:26 +0000 (13:48 +0200)]
lib/drmtest: fix hang in quiescent_gpu_at_exit due to signal-unsafe asprintf

I got kms_flip in hung state with the backtrace below, while the parent process
waiting for the signal helper to exit. It was quite easy to reproduce the bug
by running

kms_flip --run-subtest=flip-vs-dpms-off-vs-modeset

With the change I couldn't reproduce it.

TODO: audit/fix other signal handlers with signal-unsafe functions

0  0x00007f9a1362018b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007f9a1359df81 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007f9a1359b6cf in ?? () from /lib/x86_64-linux-gnu/libc.so.6
3  0x00007f9a13628eb6 in __vasprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
4  0x00007f9a13628e72 in __asprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
5  0x000000000040a4a2 in asprintf (__fmt=0x417441 "/dev/dri/card%u", __ptr=0x7fff1a972c08)
    at /usr/include/x86_64-linux-gnu/bits/stdio2.h:178
6  drm_get_card () at drmtest.c:190
7  0x000000000040a54a in __drm_open_any () at drmtest.c:229
8  0x000000000040a846 in quiescent_gpu_at_exit (sig=<optimized out>) at drmtest.c:281
9  0x0000000000408759 in call_exit_handlers (sig=3) at drmtest.c:1519
10 fatal_sig_handler (sig=3) at drmtest.c:1543
11 <signal handler called>
12 0x00007f9a13596770 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
13 0x00007f9a135d8f3f in fork () from /lib/x86_64-linux-gnu/libc.so.6
14 0x000000000040b3af in __igt_fork_helper (proc=0x61d8cc <signal_helper>) at drmtest.c:1199
15 0x000000000040b4ce in igt_fork_signal_helper () at drmtest.c:751
16 0x0000000000404167 in main (argc=<optimized out>, argv=<optimized out>) at kms_flip.c:1533

v2:
- can't use snprintf as that's also signal-unsafe, so just use a dup'ed fd (Chris,Daniel)

Signed-off-by: Imre Deak <imre.deak@intel.com>
10 years agotests: Add gem_madvise
Chris Wilson [Tue, 4 Feb 2014 14:14:31 +0000 (14:14 +0000)]
tests: Add gem_madvise

Exercise that calling madvise produces expected results

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agofix make distcheck
Daniel Vetter [Tue, 4 Feb 2014 12:10:37 +0000 (13:10 +0100)]
fix make distcheck

Bunch of explicit include paths needed adjustments and
eviction_common.c needs to be added to the dist files.

This has been broken in the following three commits:

commit 42bcd05eb3f1545fbf9c397c3f37c3f6a27c5da4
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Mon Feb 3 10:59:41 2014 +0000

    tests/eviction_common: Avoid submitting duplicate objects

commit b92b397d5e4ffe10ed92fb2fc6711758ef5bcf89
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Tue Dec 3 15:09:57 2013 +0000

    build: Make sure asserts are enabled for tests

commit 8c33e9ad111d27b84db4daac43809a807f262632
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Fri Dec 6 20:35:29 2013 -0800

    intel-gpu-tools: Version informatio

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/eviction_common: Avoid submitting duplicate objects
Tvrtko Ursulin [Mon, 3 Feb 2014 10:59:41 +0000 (10:59 +0000)]
tests/eviction_common: Avoid submitting duplicate objects

Make sure selection loop does not generate duplicates
when it picks a subset of objects for a single exec buffer.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_evict_everything: Factor out eviction logic
Tvrtko Ursulin [Mon, 3 Feb 2014 10:59:40 +0000 (10:59 +0000)]
tests/gem_evict_everything: Factor out eviction logic

In preparation for userptr test we move the eviction logic
into a common file so it can be used from both test cases.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agogem_ring_sync_copy: Add a ring to ring synchronization test
Damien Lespiau [Wed, 29 Jan 2014 15:53:33 +0000 (15:53 +0000)]
gem_ring_sync_copy: Add a ring to ring synchronization test

The goal of this test is to ensure that we respect inter ring
dependencies. A more detailed description of what it tests is in a
comment.

The tests relies on having a blit function for the ring, so is currently
only checking synchronization between the render and blitter ring.

v2: Actually create an inter-ring dependency by making the first copy on
ring2 and the second on ring2, not both on ring2.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoandroid: Change tests & tools directory to use the lib directory
Rafael Barbalho [Fri, 31 Jan 2014 14:57:40 +0000 (14:57 +0000)]
android: Change tests & tools directory to use the lib directory

Instead of recompiling the lib directory for every tool or tests we can just
re-use the static library. This also has the nice side effect of fixing the
android "mm" command to allow android users to only rebuild the local changes
in either the test or tools directory.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoandroid: Add the generation of vesion.h & config.h to lib
Rafael Barbalho [Fri, 31 Jan 2014 14:57:39 +0000 (14:57 +0000)]
android: Add the generation of vesion.h & config.h to lib

The lib directory is used by all the tests & tools so it should really be
the place where the generate files are created.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoandroid: Add makefile for the lib directory
Rafael Barbalho [Fri, 31 Jan 2014 14:57:38 +0000 (14:57 +0000)]
android: Add makefile for the lib directory

The lib directory should really be compiled as a static library on its own
and be re-used by any tests or tools that require it.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoandroid: Clean-up common makefile directives
Rafael Barbalho [Fri, 31 Jan 2014 14:57:37 +0000 (14:57 +0000)]
android: Clean-up common makefile directives

All the Android.mk files had the same directives to find the path of
libdrm & libpciaccess. These are no longer required as the android system
now allows the libraries being used to export include paths to dependant
modules & programs.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoandroid: Handle the case when android doesn't have mmap64
Rafael Barbalho [Fri, 31 Jan 2014 14:57:36 +0000 (14:57 +0000)]
android: Handle the case when android doesn't have mmap64

Not all versions of Android have the mmap64 call, thus a suitable alternative
must be called.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoquick_dump/broadwell: Add gen7 ring mode registers
Ben Widawsky [Fri, 31 Jan 2014 05:33:56 +0000 (05:33 +0000)]
quick_dump/broadwell: Add gen7 ring mode registers

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agoquick_dump/haswell: Add gen7 stuff + VECS_MODE
Ben Widawsky [Fri, 31 Jan 2014 05:31:07 +0000 (05:31 +0000)]
quick_dump/haswell: Add gen7 stuff + VECS_MODE

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agoquick_dump/gen7: Add other GFX_MODE registers
Ben Widawsky [Fri, 31 Jan 2014 05:29:27 +0000 (05:29 +0000)]
quick_dump/gen7: Add other GFX_MODE registers

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agoquick_dump: Add a file argument
Ben Widawsky [Fri, 31 Jan 2014 04:46:06 +0000 (04:46 +0000)]
quick_dump: Add a file argument

-f, or --file will simply dump the file in the specified format. All
other options will be skipped. This is helpful when one wants to create
their own list for temporary debug, or if one requires a subset of
registers to work around things like fused off PCH.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agoquick_dump: Refactor to allow future code
Ben Widawsky [Fri, 31 Jan 2014 04:42:50 +0000 (04:42 +0000)]
quick_dump: Refactor to allow future code

Extract everything possible, and create a main function which is pretty
darn simple. The goal is to make the various paths the program can take
based on command line options (one more is coming) more decipherable.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agolib: Capture errno on entry
Chris Wilson [Fri, 31 Jan 2014 16:56:01 +0000 (16:56 +0000)]
lib: Capture errno on entry

When printing the errno, it is important that we capture the user errno
before we make any library calls - as they may alter the value.

References: https://bugs.freedesktop.org/show_bug.cgi?id=74007
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_close_race: Fix blit commands for BDW
Chris Wilson [Wed, 29 Jan 2014 22:59:57 +0000 (22:59 +0000)]
igt/gem_close_race: Fix blit commands for BDW

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73958
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoiosf: make iosf_rw take a larger addr
Jesse Barnes [Tue, 28 Jan 2014 22:17:30 +0000 (14:17 -0800)]
iosf: make iosf_rw take a larger addr

For higher DPIO ranges for example.  Also fix it up to use
intel_register_read/write.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
10 years agodpio: make dpio reg read/write output like normal reg read/write output
Jesse Barnes [Tue, 28 Jan 2014 21:58:55 +0000 (13:58 -0800)]
dpio: make dpio reg read/write output like normal reg read/write output

Just for consistency.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
10 years agommio: drop unused i915_loaded fn
Jesse Barnes [Tue, 28 Jan 2014 21:58:23 +0000 (13:58 -0800)]
mmio: drop unused i915_loaded fn

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
10 years agommio: use intel_iosf.c for DPIO reads and writes
Jesse Barnes [Tue, 28 Jan 2014 21:46:38 +0000 (13:46 -0800)]
mmio: use intel_iosf.c for DPIO reads and writes

This makes it a bit more like the kernel, so we can go poke at DPIO and
other IOSF regs a bit more easily.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
10 years agotests/pm_rps: rename basic test to "basic-api"
Daniel Vetter [Mon, 27 Jan 2014 22:38:02 +0000 (23:38 +0100)]
tests/pm_rps: rename basic test to "basic-api"

Jeff plans to add more tests ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: Make frequency logging more compact
Jeff McGee [Tue, 21 Jan 2014 23:14:33 +0000 (17:14 -0600)]
pm_rps: Make frequency logging more compact

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: Remove repeat sysfs reads
Jeff McGee [Tue, 21 Jan 2014 23:14:32 +0000 (17:14 -0600)]
pm_rps: Remove repeat sysfs reads

Storing values avoids some unnecessary overhead but more importantly
allows all of our processing to be atomic.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agopm_rps: Expand on min and max config testing
Jeff McGee [Tue, 21 Jan 2014 23:14:31 +0000 (17:14 -0600)]
pm_rps: Expand on min and max config testing

Add a function that methodically varies min and max to exercise
several valid and invalid combinations. Allow the caller to
define what is to be checked between each step.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoNEWS: update with nomodeset register access change
Jesse Barnes [Mon, 27 Jan 2014 18:43:02 +0000 (10:43 -0800)]
NEWS: update with nomodeset register access change

10 years agoquick_dump: more vlv dpio regs
Jesse Barnes [Mon, 27 Jan 2014 18:26:57 +0000 (10:26 -0800)]
quick_dump: more vlv dpio regs

10 years agommio: allow register init even if debugfs isn't available and i915 isn't loaded
Jesse Barnes [Mon, 27 Jan 2014 18:26:05 +0000 (10:26 -0800)]
mmio: allow register init even if debugfs isn't available and i915 isn't loaded

This lets us dump regs even if modeset=0 for example.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
10 years agoigt/gem_concurrent_blit: Scale resource usage to RAM correctly
Chris Wilson [Sun, 26 Jan 2014 14:36:32 +0000 (14:36 +0000)]
igt/gem_concurrent_blit: Scale resource usage to RAM correctly

Note that we use twice the number of buffers, and so we need to restrict
num_buffers appropriately to fit within RAM.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72255
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel_error_decode: Protect against missing ring registers
Chris Wilson [Thu, 23 Jan 2014 21:50:36 +0000 (21:50 +0000)]
intel_error_decode: Protect against missing ring registers

A dodgy kernel may miss printing out the ring registers leading to a
FPE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>