767 Commits

Author SHA1 Message Date
Thomas Wood
f8b3c704af lib: add the ability to include a description with a test
The IGT_TEST_DESCRIPTION macro can be used to define a description for a
test.

v2: Remove semicolon from end of macro (Damien Lespiau)
    Add API documentation for the macro.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 13:24:29 +00:00
Thomas Wood
b441e6ac2a lib/tests: don't use hard error status to indicate test failure
An exit status of 99 is reported separately in the test summary as an
error, rather than as a test failure.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 11:39:43 +00:00
Thomas Wood
03a4ad16d1 lib/tests: fix tests and test list location
The igt_command_line.sh script was moved by commit 685e577 (Move library
selftests to lib/tests), but the location of the tests and the test
lists was not updated.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 11:39:02 +00:00
Zhao Yakui
2c44d6316a Mediafill/skl: Remove redundant field to fix GPU hang
After applying the commit(982f7eb238a0898c456e0574dee7c4507738d75f), the
OUT_RELOC is updated on Broadwell and later, which is to handle the
64-bit field of gfx address internally. In such case some commands
should be fixed, otherwise GPU hang will be triggered when running
gem_media_fill.  (It is already fixed on Broadwell)

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-11-06 08:26:01 +00:00
Zhao Yakui
c68028936b Rendercopy/skl: Remove redundant field to fix GPU hang
After applying the commit(982f7eb238a0898c456e0574dee7c4507738d75f), the
OUT_RELOC is updated on Broadwell and later, which is to handle the
64-bit field of gfx address internally. In such case some commands
should be fixed, otherwise GPU hang will be triggered when running
rendercopy.  (It is already fixed on Broadwell)

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-11-06 08:25:39 +00:00
Chris Wilson
6fff1f8787 ioctl_wrappers: Pass in offset to CPU mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-04 12:08:50 +00:00
Thomas Wood
e622850966 lib/igt_core.h: add debug messages for test requirements
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-31 14:10:26 +00:00
Thomas Wood
d950f37be3 lib/igt_core.h: fix igt_skip_on_f requirement message
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-31 14:10:26 +00:00
Thomas Wood
5a61421a02 lib/tests: use the "check_" prefix for tests
The "check_" prefix ensures the test programs are not installed and are
only built when "make check" is run.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-29 17:26:38 +00:00
Thomas Wood
b78d142a15 build: fix distcheck
Fix distcheck issues introduced by commit 685e577 (Move library
selftests to lib/tests).

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-29 17:26:34 +00:00
Thomas Wood
ab5f7eace1 lib: ensure the library is built before the tests
This fixes the build problems introduced by commit 685e577 (Move library
selftests to lib/tests).

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-29 16:27:59 +00:00
Daniel Vetter
685e57736a Move library selftests to lib/tests
Again they're not really igt testcases so are in the way of
running spatch unconditionally. Move them someplace else.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-29 13:29:32 +01:00
Mika Kuoppala
4f6a6cbdff lib: fix #define max
Regression from:

commit be4710a541b517b5f8663448bffed5656d59b47b
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Fri Oct 10 11:20:35 2014 +0100

    lib: add common min and max macros

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85218
Tested-by: Guo Jinxian <jinxianx.guo@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-23 12:48:05 +03:00
Paulo Zanoni
ac2079596c lib/igt_aux: move audio RPM code to igt_setup_runtime_pm()
If we don't enable audio runtime PM, the audio driver won't release
its reference, the refcount won't ever become zero, so we will never
actually runtime suspend. So move this code from pm_rpm.c to
igt_aux.c, so kms_flip - and any other IGT test case using RPM - can
benefit from it.

Previously, if you ran pm_rpm before running the other tests - or if
you just didn't have snd_hda_intel loaded - you wouldn't notice this
bug.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78893
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-22 16:23:42 -02:00
Brad Volkin
a06071c0cf tests/gem_exec_parse: test for chained batch buffers
libva makes extensive use of chained batch buffers. The batch
buffer copy portion of the command parser has the potential to
break chained batches, so add a simple test to make sure that
doesn't happen.

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-21 17:27:36 +02:00
Paulo Zanoni
fc6d464a59 lib/igt_aux: make igt_wait_for_pm_status() resist the signal helper
If the signal helper is active, the usleep() calls return earlier, and
we may end up returning false way before the 10s timeout, failing the
subtests. This currently happens on the kms_flip RPM interruptible
subtests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78893
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-17 16:20:26 -03:00
Thomas Wood
be4710a541 lib: add common min and max macros
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:43 +01:00
Thomas Wood
d4e3b6a0f5 lib: various documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17 15:34:43 +01:00
Armin Reese
f246f1ed0c tools/null_state_gen: Add GEN9 golden context batch buffer creation
Modifications to 'null_state_gen' so it can generate GEN9
golden context batch buffer source for SKL.

v2: - rebased on top of gen8 changes (Mika)
    - fixed state base address command size (Mika)
    - base address size macro as pages (Mika)

v3: - rebased on top of current master (Mika)
    - removed obsolete #includes (Mika)
    - added copyright (Mika)
    - render and component packing added (Mika)

Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Armin Reese <armin.c.reese@intel.com>
Cc: Volkin, Bradley D <bradley.d.volkin@intel.com>
Reviewed-by: Volkin, Bradley D <bradley.d.volkin@intel.com> (v2)
Signed-off-by: Armin Reese <armin.c.reese@intel.com> (v1)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-10 17:26:27 +03:00
Mika Kuoppala
0e8ac72d5d tools/null_state_gen: Add Gen8 golden state
Previously we didn't have a clear understanding what is necessary
for a pipeline state to be properly initialized. So we had to improvise
and use a stripped out render copy.

Now we have a more clear understanding so switch out render copy based
frankenstate to state we can call golden state.

v2: - export intel_batch_state_offset
    - add 3DSTATE_RASTER (Bradley Volkin)

Cc: Volkin, Bradley D <bradley.d.volkin@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-10-09 19:47:51 +03:00
Tim Gore
764772c3c8 lib/Android.mk: add define of IGT_DATADIR for igt_fb.c
Since the igt_create_stereo_fb function moved into igt_fb.c
we need to add the definition of IGT_DATADIR in the Android
makefile in order to build the cairo dependent tests.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-02 16:39:36 +01:00
Tim Gore
5782eca1e1 lib/igt_core.c: disable lowmemorykiller during tests
Several IGT tests cycle through a lot of GEM memory and
when running these tests on Android they tend to get
killed by the lowmemorykiller. The lowmemorykiller really
is not usefull in this context and is just preventing the
test from doing its job. This commit adds a function to
disable the lowmemorykiller by writing "9999" to its
oom adj parameter, which means it will never "select"
any process to kill. The normal linux oom killer is still
there to protect the kernel.
The low memory killer is disabled during the common
init function and then re-enabled by the exit handler.
To make this work for single tests the exit handler is now
installed in the common init function also so that it is
invoked for all tests.
This is just a hack to get round the fact that the i915
driver uses the concept of purgeable memory which is not
understood by the lowmemorykiller. If this ever gets
fixed then this patch can be removed.

Signed-off-by: Tim Gore <tim.gore@intel.com>
[danvet: A bit of polish (coding style, static and rename
check_igt_exit to common_exit_handler, drop the is_disabled check
since we only call this once now).]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-01 14:44:30 +02:00
Daniel Vetter
711199b8ec lib/aux: Print progress output at INFO level
With the structured logging it makes more sense to tune this down a
bit. Also, this way it is consistent with Thomas Wood's new activity
indicator helper.

Spotted while discussing Thomas' patch with him.

v2: Thomas noticed that I've forgotten the fflush. Extract
igt_interactive_info for both igt_progress and igt_print_activity.

v3: Interactive output should go to stderr. Also extract the "is this
a terminal" check.

Cc: Thomas Wood <thomas.wood@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-30 22:55:18 +02:00
Thomas Wood
6a8d33c2bb lib: add a function to indicate activity
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30 17:54:12 +01:00
Thomas Wood
756764a4e7 lib: ensure any buffers are flushed before fork
Flush any buffers before forking to prevent duplicated output.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30 17:54:02 +01: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
Imre Deak
bfda78cd33 tests/pm_rpm: factor out drm_open_any_master
Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-09-30 16:44:50 +03:00
Xiang, Haihao
781a0485ac lib/skl: Return the render copy and media fill functions
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
[Ben: Reordered if tree]
Signed-off-by: Ben Widawsky <benjamin.widawsky@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
20e9cf38b7 mediafill/skl: Follow spec to configure media sampler DOP clock gating in PIPELINE_SELECTION
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
d2e4eb3619 mediafill/skl: Follow spec to configure FORCE_MEDIA_AWAKE in PIPELINE_SELECTION
The FORCE_MEDIA_AWAKE bit is added for the PIPELINE_SELECTION command and
some instructions requires that the media enginee is awake.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
54465b8ac5 mediafill/skl: Follow the spec to add pipeline_select mask
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
17371958db mediafill/skl: follow the spec to update STATE_BASE_ADDRESS command
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
31e94ad28b mediafill/skl: Start the gen9 media_fill from the gen8 version
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Xiang, Haihao
fe4e4c176c rendercopy/skl: Set the URB VS start address to 4
A value less than 4 might result in GPU hang on simulation

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
5b46cd335d rendercopy/skl: Follow the spec to add the Pipeline selection mask
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
8e62f78999 rendercopy/skl: Emit 3DSTATE_WM_HZ_OP
This is from that on BDW. Without it, the pixel pipeline can't work well.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
833e476624 rendercopy/skl: Fix the 3DSTATE_DS instruction length
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
7628268952 rendercopy/skl: Fix the STATE_BASE_ADDRESS instruction length
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
77a9ed7da2 rendercopy/skl: Set Instruction Buffer size Modify Enable to 1
This is ported from that on BDW.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
e539e91cf5 rendercopy/skl: update instruction length
This is ported from that on BDW.

v2: Only bump the prefix when we need to program the instruction
differently with the previous generations.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Zhao Yakui
f04bf00c0d rendercopy/skl: Pass the context to rendercopy function on SKL
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2014-09-30 12:21:02 +01:00
Damien Lespiau
ecd659e000 rendercopy/skl: Update 3DSTATE_SBE
SBE has now to be explicitely told which channels of which components
are used by the pixel shader.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2014-09-30 12:21:02 +01:00
Damien Lespiau
e5b850cb34 rendercopy/skl: Set the 3DSTATE_VF state
This is to ensure the "Component Packing Enable" bit is set to 0.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2014-09-30 12:21:02 +01:00
Damien Lespiau
aa7f9cf881 rendercopy/skl: Start the gen9 rendercopy from the gen8 version
v2 (Ben): Rebased on:
 commit ea11d103e0617e33bce6f11328521d15b13422b0
Author: Oscar Mateo <oscar.mateo@intel.com>
Date:   Tue Nov 12 11:50:35 2013 +0000

    build: list all test/tool/lib source files in their own Makefile.sources

v3: (Ben): Rebased on the doc/API rework. Probably needs review

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2014-09-30 12:21:02 +01:00
Damien Lespiau
4d95a1551b skl: initialize instdone bits for gen9
gen9 uses the same bits as gen8.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-09-30 12:21:02 +01:00
Damien Lespiau
256831cd88 skl: Add gen9 to intel_gen()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-09-30 12:21:02 +01:00
Damien Lespiau
91ebcd0c54 skl: Add SKL PCI ids
v2: Update to the latest PCI ids

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2014-09-30 12:21:02 +01:00
Tim Gore
f33fa71481 lib/igt_core: make single/simple tests use igt_exit
Currently tests that use igt_simple_main will simply call
"exit()" if they pass, making it difficult to ensure that
any required cleanup is done. At present this is not an
issue, but it will be when I submit a patch to turn off the
lowmemorykiller for all tests.

Signed-off-by: Tim Gore <tim.gore@intel.com>
[danvet: Also update api docs.]
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-29 16:57:49 +02: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
Chris Wilson
4779655c6f lib: Try harder to drop-caches
If at first we don't succeed, try again. (For as long as the errno says
to at least!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 11:12:21 +01:00