112 Commits

Author SHA1 Message Date
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
Jesse Barnes
555cfd4597 testdisplay: update to new colorkey ioctl 2012-01-09 14:34:19 -08:00
Daniel Vetter
74d6545ffa testdisplay: shut up compiler
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-18 00:24:45 +01:00
Daniel Vetter
2de19c477a testdisplay: move drm_fourcc.h include under the #ifdef protection
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-18 00:21:39 +01:00
Yi Sun
1f41a30070 tests/testdisplay.c: make the 3th pipe finish all the mode setting.
If test all modes rather than preferred mode, remove framebuffer and
set CRTC to zero after each connector mode setting.

Signed-off-by: Sun Yi <yi.sun@intel.com>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-12-17 00:03:55 +01:00
Jesse Barnes
b4fb480c80 testdisplay: don't test planes if i915 color key ioctl is not available 2011-12-14 08:15:04 -08:00
Jesse Barnes
5a9d82c6d5 testdisplay: update for final plane & fb ABI
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-12-07 08:23:36 -08:00
Chris Wilson
4c7c94ad98 testdisplay: Round tiled allocations up to pot stride and fence size
Be simple and use the strictest requirements from gen2/3 with old
kernels so that this simply works everywhere.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42585
2011-11-04 13:25:45 +00:00
Jesse Barnes
9c29be40bc testdisplay: find planes for each pipe
Fixes a bug where we were masking against the wrong value.
2011-11-03 17:38:55 -07:00
Jesse Barnes
3afb7b22d6 testdisplay: update to new addfb2 definition 2011-11-03 17:38:55 -07:00
Daniel Vetter
5b8bbc950d testdisplay: compile fix for !DRM_PLANES
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-30 20:45:42 +01:00
Jesse Barnes
1f4c37a6e9 testdisplay: allow overlay plane to be moved & scaled at runtime
For additional testing.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-10-28 18:06:23 +02:00
Jesse Barnes
234b5c40b1 testdisplay: add stub disable_planes() function
To fix the compile with non-plane libdrms.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-10-27 17:47:58 -07:00
Jesse Barnes
24e60385fe testdisplay: add sprite scaling and location support
Allow testdisplay to locate the sprite on the screen and potentially
scale it using different crtc width/height vs the source width/height
(determined by the resolution on the target pipe).

Also fix exit, making sure we properly disable all the planes.

Signed-off-by: Jesse Barnes <jbarnes@virtuougseek.org>
2011-10-24 17:18:42 +02:00
Paulo Zanoni
17ceccedbf testdisplay: return 0 when successful
We use the "ret" variable to check function return values, and these
values are not necessarily 0 on the successful cases, so we need to
reset "ret" after we finish using it.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-16 22:21:52 +02:00
Paulo Zanoni
3ba12bbb2f testdisplay: remove wrong return statement
It seems that the kernel patches required by the TEST_PLANES feature are
still not upstream, so I didn't test this patch.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-15 19:38:29 +02:00
Paulo Zanoni
7ead7ba3e6 testdisplay: don't enter the main loop if dump_info or test_all_modes
If calls inside update_display fail, the function returns and we don't
quit the program if dump_info or test_all_modes. So we enter the main
loop and keep waiting for user input, even on cases where we are not
supposed to require user input. To fix this, we move the check to
outside the update_display function.  As a side effect, we also do
cleanup instead of just exit(0) and we return 1 in case update_display
failed.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-15 19:38:21 +02:00
Paulo Zanoni
9fe1148c4b testdisplay: test all modes if no option is provided
Previously, when called without any arguments, the application required
user input to finish.  However, testdisplay is ran by "make check", and
it is not a good idea to run a program that requires user input in "make
check". So we change the default behavior to something that doesn't
require user input. You can still access the previous behavior using the
"-m" argument.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-15 19:38:18 +02:00
Paulo Zanoni
19fef544eb testdisplay: fix compiler warnings
testdisplay.c:117:1: warning: comparison between signed and unsigned
integer expressions
testdisplay.c:125:1: warning: comparison between signed and unsigned
integer expressions
testdisplay.c:145:1: warning: comparison between signed and unsigned
integer expressions
testdisplay.c:1060:16: warning: comparison between signed and unsigned
integer expressions

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-15 19:38:04 +02:00
Hai Lan
6857a1af81 testdisplay: for tiled mode test, the height should be aligned
Signed-off-by: Hai Lan <hai.lan@intel.com>
2011-08-12 11:44:03 -07:00
Hai Lan
6cc92bcbc5 testdisplay: Test the first mode if there is no preferred mode.
For a TV device, there  might be no preferred mode. In this case,
we can test the first mode.

Signed-off-by: Hai Lan <hai.lan@intel.com>
2011-07-13 14:05:54 +08:00
Jesse Barnes
e235f93288 testdisplay: automatically enable TEST_PLANES if possible
Just look for the ADDFB2 ioctl and enable the new code if it exists.
2011-06-07 13:32:37 -07:00
Jesse Barnes
8969b839b5 testdisplay: fix error output if test pattern draw fails 2011-06-07 13:29:01 -07:00
Jesse Barnes
b707feb9d5 testdisplay: add tiled buffer test support
Useful for testing tiled vs linear framebuffers.
2011-06-07 13:29:01 -07:00
Jesse Barnes
7230c01421 testdisplay: add overlay plane test option
Enumerate available extra planes and try to use one on each CRTC we enable.
2011-06-07 13:29:01 -07:00