summaryrefslogtreecommitdiff
path: root/tests/testdisplay.c
AgeCommit message (Collapse)Author
2022-03-09igt/tests: Add support for Tile4(TileF) format to testdisplayMatt Roper
testdisplay is a great test for manual testing/debug of Tile-4; we just need an extra parameter to enable that tiling format. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Jeevan B <jeevan.b@intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
2021-10-11igt: s/tiling/modifier/ all overVille Syrjälä
Use a more reasonable variable name for modifiers. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-11igt: s/DRM_FORMAT_MOD_NONE/DRM_FORMAT_MOD_LINEAR/Ville Syrjälä
DRM_FORMAT_MOD_LINEAR is the more sensible name for DRM_FORMAT_MOD_NONE. Use the better name. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-07-15Nuke local versions of DRM_FORMAT and DRM_MODELucas De Marchi
Use the definition from kernel headers. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-07-15Remove local copies of I915 macrosLucas De Marchi
Just use the one from the kernel headers. Updated with: git grep -l LOCAL_I915 | \ xargs sed -i -e '/^#define LOCAL_I915/d' -e 's/LOCAL_\(I915[[:alnum:]_]*\)/\1/g' Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-01-30meson: Turn on -WerrorAshutosh Dixit
We can choose which compile warnings to enable, but once they are enabled treat all warnings as error. This enforces stricter checks against compile warnings creeping in. v2: Fix redefinition warning errors from i915/gem_userptr_blits v3: Fix the even more pedantic clang compilation v4: Do not alter whitespace in lib/tests/igt_describe! Note: clang does not build assembler/ Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-07-07lib/igt_fb: remove extra parameters from igt_put_cairo_ctxMelissa Wen
The function igt_put_cairo_ctx currently requires three parameters, but only one of them is used in it. This patch removes the useless parameters, making the code more readable and cohesive. It also applies the change to all occurrences of the function in the code. Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-12-04testdisplay: Make sure readlink() result is nul-terminatedPetri Latvala
A similar fix as in commit a70013186d30 ("tests/tools_test: Use readlink() properly"), zero-initialize and read sizeof minus one. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-12-03tests: remove igt_skip_on_simulation()Swati Sharma
Removing igt_skip_on_simulation() from tests since this feature is not supported anymore. v2: Rebase v3: Removed skip_on_simulation() from tests/dumb_buffer Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-24tests/testdisplay: Allow testing aspect ratiosVille Syrjälä
Add a new knob "-A" to enable the aspect ratio client cap and thus test modes with potentially different aspect ratios. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Simon Ser <simon.ser@intel.com>
2019-06-06testdisplay: use first available option valuesLucas De Marchi
Now that core options are set to 500 and above, start from the lowest values without causing problems with conflicts. This also rename the constants to follow the names from the core. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-05-27testdisplay: Nuke custom main functionPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
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>