86 Commits

Author SHA1 Message Date
Thomas Wood
ce5becbb61 testdisplay: Allow getopt to print error messages
By not assigning opterr, getopt will print its own error message that
includes information about whether an option is unknown or just requires
an additional argument.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2013-10-11 13:16:07 +01:00
Damien Lespiau
6de613f8e5 testdisplay: Print the stereo mode being tested
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
e836b60d37 testdisplay: Make -o and -3 work together
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
8393bb41a1 testdisplay: Remove mode resetting now that we don't adjust the timings
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
c128b731dc testdisplay: Respect specified_disp_id in the stereo loop
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
28cf66de94 testdisplay: Remove printing out the eyes geometry
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
a7d1937cd7 testdisplay: Use DRM_MODE_FLAG_3D_MASK
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
578c1cefc9 testdisplay: Remove the timing adjustements now that the kernel does it
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
9a8fda7a4a testdisplay: Test the stereo 3D modes
Now that modes have flags to describe which 3d formats the sink
supports, it's time to test them.

The new test cycles through the supported 3D formats and paint 3D
stereoscopic images taken from publicly available samples:
  http://www.quantumdata.com/apps/3D/sample_BMP.asp

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
951b37e2d0 testdisplay: Provide a full path when opening pngs
This way one doesn't have to be in tests/ for testsdisplay to be able to
open pass.png.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
5d99634913 testdisplay: Free the array of connectors
That's an array we allocated earlier in this function. Let's be symetric
and free it once done.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
66477a230f testdisplay: Untangle dump_info() from the main testing loop
-i is just supposed to show some information about the DRM resources.
Right now it works in a quite convoluted way. Untangle this to call
dump_info() when -i is given, exit the program and be done with it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:22 +01:00
Damien Lespiau
b9db1a6a96 testdisplay: Fix CRTS typo
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Damien Lespiau
eecd0061eb testdisplay: Properly handle the life cycle of framebuffers
When cycling through the modes, let's make sure to free the previous
framebuffers. This is the perfect occasion to use kmstest_remove_fb().

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Damien Lespiau
5a1d84300b testdisplay: Map the fb inside paint_color_key()
So the code for this is self-contained. This goes along the way of
reducing the number of global variables in testdisplay.

Take the opportunity to unmap the fb after use as well.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Damien Lespiau
0396273972 testdisplay: Move the code sanitizing depth into main()
It'll be shared by the set_mode() and set_3d_mode() functions.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30 18:04:21 +01:00
Daniel Vetter
225a91bc54 lib/drmtest: include sys/mman.h from drmtest.h
We need it for mmapping to get at PROT_READ|WRITE anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:38:29 +02:00
Daniel Vetter
83440953e5 tests: s/assert/igt_assert
Just a wholesale rollout for now, we can refine later on.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Daniel Vetter
1caaf0a6b6 s/drmtest_/igt_/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:20:22 +02:00
Daniel Vetter
7847ea2965 tests: use drmtest_skip to check for rings
To simplify things add a set of gem_check_<ring> functions which take
care of this. Since I've opted for static inlines drmtest.h grew a few
more header includes which was a neat opportunity to dump a few redundant
#defines.

This kills all the skipped_all hand-rolled logic we have.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:17:58 +02:00
Damien Lespiau
5fa15f79d0 tests: Black list tests we don't want to run on simulation
Let's start by a small set of tests, to eventually consider running
more.

The current list should then be:

gem_mmap
gem_pread_after_blit
gem_ring_sync_loop
gem_ctx_basic
gem_pipe_control_store_loop
gem_storedw_loop_render
gem_storedw_loop_blt
gem_storedw_loop_bsd
gem_render_linear_blits
gem_tiled_blits
gem_cpu_reloc

gem_exec_nop
gem_mmap_gtt

v2 add (Daniel Vetter)
gem_exec_bad_domains
gem_exec_faulting_reloc
gem_flink
gem_reg_read
gem_reloc_overflow
gem_tiling_max_stride
prime_*

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:49:02 +01:00
Imre Deak
f68d964c57 lib: refactor kmstest_create_fb
Factor out parts that will be used by an upcoming patch adding
kmstest_create_fb2.

Also call the fb paint functions directly, there is not much
point in passing a function pointer for that.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
bfb0cdd668 lib: add kmstest_get_connector_config
This is used by multiple test cases, so make it shared.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
542a40c485 lib: add kmstest_cairo_printf_line
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
[v3: fix mode printing in paint_output_info() botched by debugging leftover :/ ]
2013-06-06 01:43:51 +03:00
Imre Deak
3a2aed1f30 lib: move connector_type_str and co to drmtest
These are used by multiple test cases, so make them shared.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:50 +03:00
Imre Deak
01b408e43a testdisplay: set VT graphics mode
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-08 21:00:52 +02:00
Damien Lespiau
7ee278f176 build: Guard the inclusions of config.h with HAVE_CONFIG_H
autoconf can be configured to not generate a config.h but to give the
defines with command line arguments instead. In this case, there's no
config.h to include.

To work in both cases autoconf adds a HAVE_CONFIG_H define on the command
line to signal there's a config.h to include.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:45:34 +00:00
Yi Sun
6157d242a5 tests/testdisplay.c: Remove the variable only_one_mode.
That variable is useless, instead the variables specified_mode_num and specified_disp_id can cover all the situation.
For parameter -o, all three instances should work:

./testdisplay -o 21,4 only test the 4th mode on the connector with id 21.
./testdisplay -o 21   test all the mode lines on the connector wiht id 21.
./testdisplay -o ,4   the -o is ignored, just like -a.

Signed-off-by: Yi Sun <yi.sun@intel.com>
2013-02-13 23:00:07 +08:00
Yi Sun
cdd352df95 tests/testdisplay.c: Fix the issue which don't display anything until '-o' given.
Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-14 15:31:52 +01:00
Yi Sun
05bfbf4227 tests/testdisplay: Specify the display.
It can specify the display by the connector id which list as the first column of ./testdisplay -i.
E.g. command "./testdiplay -o 1,4" means setting number 4 mode line on the display with connector id 1.

v2. Specify the display by id which can be got from option '-i'

Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-12-27 14:38:55 +08:00
Damien Lespiau
b11887741c testdisplay: Use the fb stride when painting the color key
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55901

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-28 00:16:54 +01:00
Imre Deak
31dfc98a30 fix warn in testdisplay: ignoring return value of 'chdir'
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:19 +02:00
Yi Sun
53895acbe2 Add option -o <number>, which can test only one specified mode.
Each mode line has a number just like '[i]'. So we can only test the specified mode with giving the number of mode to '-o' parameter.

Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-09-26 14:46:02 +02:00
Ben Widawsky
54ed938d39 clang: Fix warnings found through clang.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-08-30 14:19:10 -07:00
Yi Sun
f669e8c12e tests/testdisplay.c Remove an uncomfortable error output
Signed-off-by: Yi Sun <yi.sun@intel.com>
2012-08-08 08:51:47 +02:00
Yi Sun
41fe811feb tests/testdisplay.c: Add a option '-r'.
With the option '-r', the testdisplay could paint a 2-D bar code(QR
bar code) on the screen. The word "pass" is hiden in the bar code
image.  Further more, with this option, testdisplay will wait until a
system signal 'SIGUSR1' coming after each mode setting. This function
is for another program to control testdisplay.

danvet: Fix up the missing static.

Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-07-26 15:01:08 +02:00
Daniel Vetter
434be47f12 shut up the compiler a bit
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-07-23 09:52:10 +02:00
Daniel Vetter
17787f30c6 lib: extract kmstest_dump_mode 2012-05-22 16:15:15 +02:00
Daniel Vetter
662d732199 lib: extract kmstest_create_fb
We should get more kms tests soon, and not needing to copy-paste a
nice test pattern should be useful.

That establishes a firm depency of i-g-t on cairo over everything, but
I don't care so much about that.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-05-22 15:56:29 +02:00
Daniel Vetter
0732cc59ab tests: use drm_open_any more
And fix it up to not leak open fds, which kills all the master only
stuff.
2012-05-22 12:01:36 +02:00
Jesse Barnes
1e74007b4c testdisplay: remove unnecessary passing of width, height, stride, depth
These are globals, no need to shadow them everywhere.
2012-02-27 12:50:50 -08:00
Jesse Barnes
ea4163395e testdisplay: remove plane test support
This is better done in intel_sprite_on and was broken anyway.
2012-02-27 12:46:11 -08:00
Yi Sun
3d46ca8c4d tests/testdisplay.c: rewite function dump_connectors and dump_crtcs.
Replace the globe variable drm_fd with local variable passed from parameter.

Signed-off-by: Yi Sun <yi.sun@intel.com>
[danvet: fixup whitespace]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-06 20:38:49 +01:00
Yi Sun
4cceae74e3 tests/testdisplay.c: Fix the black screen issue while force mode.
Replace the 8 globe force mode variables with a struct drmModeInfo variable.
Next step, we could reduce the number of globe veriables, to be convenient to call the functions.

Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-06 20:36:45 +01:00
Daniel Vetter
7f7cafe729 testdisplay: extract hotplug code
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-24 10:50:10 +01:00
Daniel Vetter
527cad1618 lib/drmtest: extract gem_mmap
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 18:41:46 +01:00
Daniel Vetter
7a6042e87e lib/drmtest: extract gem_create
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 18:30:39 +01:00
Daniel Vetter
73d1b88129 testdisplay: rename global fd variable to drm_fd
Shuts up compiler warnings about shadowing in functions.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 18:20:39 +01:00
Daniel Vetter
db7462e1f5 testdisplay: fixup smaller compiler warnings
const char * issues and redudant getopt stuff

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 18:15:05 +01:00
Daniel Vetter
5dd17d3f4b lib/drmtest: extract gem_close
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 15:07:19 +01:00