summaryrefslogtreecommitdiff
path: root/tests/testdisplay.c
AgeCommit message (Collapse)Author
2019-03-25tests/testdisplay: fix heap overflowSimon Ser
v2: also simplify the code by using dirname(3). v3: dirname may modify in-place its argument, duplicate the string Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-01-21tests/testdisplay: Speed up testdisplay for ciVille Syrjälä
No point in sleeping 5 seconds between each modeset when running in ci. So let's just make the default sleep interval 0 seconds and leave it up to the user to bump it via -s when running interactively. On a KBL + LSPCON + a 4k HDMI display with 36 modes listed: time ./tests/testdisplay - real 3m12,026s - user 0m1,920s - sys 0m1,241s + real 0m14,681s + user 0m3,135s + sys 0m1,340s Cc: Martin Peres <martin.peres@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-10-16tests: Skip testdisplay when KMS is disabledJosé Roberto de Souza
This test should be skiped when KMS is disabled. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-10-04igt: Check drmModeGetResources()Chris Wilson
If KMS is not supported on the device, drmModeGetResources() will return NULL, often this is an indication that we should not attempt to run the test. Although it would be preferred to use something like igt_require_display() as the canonical check and assert that drmModeGetResources() did not hit an error, it is not always practical as the tests do not utilize the common igt_display abstraction. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-02-01lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctxMaarten Lankhorst
This will allow support for NV12 in the future, where igt_get_cairo_ctx will return a RGB image to draw with, which will be converted in igt_put_cairo_ctx so tests don't have to add special support for NV12. This is the same as cairo_destroy + checking for errors, but not all tests use this correctly so it's better to have a single handler for it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-08build: Nuke #ifdef HAVE_CONFIG_H cargo-cultDaniel Vetter
We have it. Daniel Stone said the #ifdef HAVE_CONFIG_H comes from the X11 transition to the modular build, where in the imake -> modular build transition config.h wasn't universally available. Now we just make this a requirement (so yeah Android better generate one too). v2: Improve commit message a bit. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-03-10tests/testdisplay: Remove unused SPRITE_COLOR_KEYPetri Latvala
Unused since 99bdf4f0ff3e ("tests/testdisplay: Use cairo helpers to draw to plane") Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2016-07-26igt_kms: Remove kmstest_connector_config.crtc_idxMaarten Lankhorst
This is the same as using config.pipe because the order of crtcs will never change. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-05-19tests/testdisplay: Open DRM device with DRIVER_ANYTomeu Vizoso
So that this test can be run in drivers other than i915. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-05-19tests/testdisplay: Use cairo helpers to draw to planeTomeu Vizoso
Paint the color key with cairo, so the test doesn't have to map the BO by itself, which depends on the driver being tested. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-01-26lib/igt_kms, tests/testdisplay: allow probing of new connector modesJesse Barnes
Fixup some fallout from the connector probing changes so testdisplay -m will pick up newly hotplugged displays correctly. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org.
2016-01-08lib: Extract some common fb create+fill methods into helpersVille Syrjälä
Several tests do one or more of the following: * igt_create_fb() + igt_paint_test_pattern() * igt_create_color_fb() + igt_paint_test_pattern() * igt_create_fb() + igt_paint_image() Extract them into new helpers: igt_create_pattern_fb(), igt_create_color_pattern_fb(), igt_create_image_fb(). v2: Fix typos, and improve API docs (Thomas) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-12-04lib/kms+tests: Use cached connector stateDaniel Vetter
Speeds up testcases except for those where we want to exercise the probing itself. The only exceptions left where we do a full probe are - pm_rpm: We use it to make sure the kernel doesn't get things wrong with power domains, so we really want to exercise the full probe paths. And there the only place really is the specific validation done with the data gathered by get_drm_info. - kmstest_force_ functions: Newer kernels should be better at re-probing state when the force sysfs fields change, but better safe than sorry. v2: I also consolidated the start_n_modes and start_connectors while at it - move one of the fixup hunks to this patch that accidentally got misplaced (Thomas). Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-11-11Add missing noreturn attribute to various functionsThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-12Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()Ville Syrjälä
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Make gem_mmap__{cpu,gtt,wc}() assert on failureVille Syrjälä
Rename the current gem_mmap__{cpu,gtt,wc}() functions into __gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name that assert that the pointer is valid. Most callers will expect a valid pointer and shouldn't have to bother with failures. To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g' over the entire codebase. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09s/gem_mmap/gem_mmap__gtt/Ville Syrjälä
Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any point in having it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-09-25testdisplay: Fix segfault after first modeset failsAnder Conselvan de Oliveira
When testing all modes on a connector with a single mode, if the modeset fails, the code attempts to remove fb_info[-1], because old_fb still has the inital value of -1. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90625 Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14lib: load images from the data directory in igt_paint_imageThomas Wood
Update igt_paint_image so that it can read images from the package data directory. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14lib: use a critical warning when unable to open a data fileThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-02tests: install test programs to libexecJoonas Lahtinen
Install the test programs by default so that they can be packaged. Tested with the testdisplay test so that it still runs after the modifications as it depends on a data file to be present. Need to pass -r option to enable QR code display on success (PNG data file). Packaging is useful when building a complete software stack for a DUT from scratch. This should bring us closer to achieving a built-from-scratch testing workflow. Package maintainers can always decide to ignore the installed files. v2: - Install more tests including scripts and their data v3: - Add clarification to commit message about why we do this. (Chris Wilson & Thomas Wood) - Change libexec into pkglibexec to comply to standard (Thomas Wood) - Do not install $(common_files). (Thomas Wood) - Make it really obvious the installed files are tests by using tests directory name to avoid any confusion with packagers. v4: - Fixed commit message. v5: - Add file locator helper to retain backwards compatibility. (Thomas Wood) - Test with testdisplay -r option that draws the .png file. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-12testdisplay/skl: Add command line options for Yb/Yf tiled fbsDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-12tiling: Convert framebuffer helpers to use fb modifiersTvrtko Ursulin
This converts the IGT API only, underneath legacy set_tiling is still used. v2: One got away in kms_flip. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-06testdisplay: add a test descriptionThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06testdiplay: add a "--help" optionThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06testdisplay: ensure invalid long option exit status is non-zeroThomas Wood
The optopt variable is not set if an invalid long option is used, so check the current option character instead. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-29tests/testdisplay: Fix test status check fumbleDaniel Vetter
This is a regression from 4306538d1d3f60877866c39c9ca953cc5e541dae is the first bad commit commit 4306538d1d3f60877866c39c9ca953cc5e541dae Author: Daniel Vetter <daniel.vetter@ffwll.ch> AuthorDate: Thu Oct 2 11:18:20 2014 +0200 Commit: Daniel Vetter <daniel.vetter@ffwll.ch> CommitDate: Thu Oct 2 11:34:55 2014 +0200 tests: Sprinkle missing igt_exit() where needed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85582 Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-02tests: Sprinkle missing igt_exit() where needed.Daniel Vetter
Yay for breaking piles of tests. This regression has been introduced with commit 5782eca1e19e85a04ad402fa4094aa1b5f9c53ce Author: Tim Gore <tim.gore@intel.com> Date: Wed Oct 1 13:25:20 2014 +0100 lib/igt_core.c: disable lowmemorykiller during tests Cc: Tim Gore <tim.gore@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-05lib: move create_stereo_fb from testdisplay to igt_fbThomas Wood
Move create_stereo_fb from testdisplay to igt_create_stereo_fb in igt_fb so that it can be used in other tests. v2: update for new igt_create_fb API add parameters for format and tiling remove some old debug code Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-08-21testdisplay: Make the desired tiling mode an unsigned intDamien Lespiau
We may be able to scan out more tiling formats in the future. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-12lib/igt_kms: Simplify return value of kmstest_get_connector_configDaniel Vetter
A plain bool is enough. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: set_vt_graphics_mode is a low-level helperDaniel Vetter
So give it a kmstest_ prefix and shuffle it around a bit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-31testdisplay: ignore invalid subtest optionsThomas Wood
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-30testdisplay: set a non-zero exit code if getopt detected an errorThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-29testdisplay: Destroy the cairo context once the fb is paintedDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-25testdisplay: only set terminal attributes when in foreground process groupThomas Wood
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-06-13tests: run igt.cocciDaniel Vetter
Re-run with correct igt_fail rules. Again manually fixup missing includes for igt_core.h. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13tests: Don't use stderr for informational messagesDaniel Vetter
These should go to stdout instead. The next patch will clean this up with cocci, so no change from fprintf(stdout, to printf( here. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-12testdisplay: fix restoring termio at exitImre Deak
At normal exit in test_all_modes we don't restore the original termio, since g_io_channel_shutdown() closes the stdin fd and so the following tcsetattr on stdin will fail. We also don't restore the termio at signal exit. Fix both cases by installing an exit hanlder with a dup'ed stdin fd. Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-04-30lib: extract kmstest_set_connector_dpmsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26testdisplay: make termio unbufferedJesse Barnes
So hotkeys take effect immediately.
2014-03-26lib/igt_fb: setup font in igt_get_cairo_ctxDaniel Vetter
We always want the same boring one, so extract it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26lib/igt_fb: switch to igt_ prefix from kmstest_Daniel Vetter
Shorter and more in line with our general igt_ prefix for everything which isn't somehow intel or i915-gem or otherwise hw specific - these helpers here are all fully generic framebuffer handling functions based on kms + cairo. Well, the actual buffer alloc is done with i915 gem, but meh ;-) Two special cases: - bpp_depth_to_drm_format and drm_format_to_bpp completely lacked prefixes, so just add igt_. - write_fb was a bit misleading given that we have gem_write for uploading to buffers. Rename that to write_fb_to_png to make it crystal clear what this thing does even without looking at docs. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26lib/igt_kms: s/kmstest_create_fb2/kmstest_create_fb/Daniel Vetter
Simplify the name since the old _fb function is now gone. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26lib: remove kmstest_create_fbDaniel Vetter
Use the new-style function using drm fourcc codes instead everywhere. To easily use thew fourcc based interface also expose bpp_depth_to_drm_format from the library. Finally include drm_fourcc.h from the igt_kms.h header since pretty much everyone needs this now. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 1Daniel Vetter
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22tests|lib: remove assert.h includesDaniel Vetter
Only the igt core and non-test tools should have asserts to catch internal errors, tests and helper libraries should all user igt_asert instead. Fix things up where assert instead of igt_assert was used. One tiny step towards header sanity. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>