summaryrefslogtreecommitdiff
path: root/tests/kms_setmode.c
AgeCommit message (Collapse)Author
2019-03-11tests/kms_setmode: Validate the vbl sequence numbersVille Syrjälä
Make sure we haven't already passed the seq numbers we're requesting when doing the ts calibration. Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-11tests/kms_setmode: Request the initial vbl count with RELATIVE instead of ↵Ville Syrjälä
ABSOLUTE Asking for the initial vblank count by specifying and absolute vblank count of 0 doesn't make much sense. Switch to a relative query instead. v2: Drop the NEXTONMISS (Daniel) v3: Put back the NEXTONMISS (Chris) Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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-12tests: Always call igt_remove_fb without checking.Maarten Lankhorst
This cleans up the tests slightly. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Tested-by: Vidya Srinivas <vidya.srinivas@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-06-06tests/kms_setmode: Dynamic crtc/connector combinationsHarry Wentland
Create crtc/connector combinations based on actual adapter information obtained from drmModeRes. Also set MAX_CRTCs to 6 for AMD GPUs. Signed-off-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
2016-12-06igt/kms_setmode.c: Tweak timings check constantsDorota Czaplejewicz
Add explanations of the checks and note the way the constants were derived. Tweak the constants to reflect their purpose better.
2016-12-01Silence a bunch of "const discard" warningsChris Wilson
A few warnings of the form: gem_mmap_gtt.c: In function ‘copy_wc_page’: gem_mmap_gtt.c:480:16: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] __m128i *S = (const __m128i *)src; are no more. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-27igt/kms_setmode: Skip unconnected connectorsChris Wilson
Assuming that we can program any random unconnected output to a mode is nowadays false. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98547 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-25igt/kms_setmode: Adjust timing assertion from percentage to scanlineChris Wilson
The target is that we report the vblank time accurate to within a scanline (limit of the hw with which we can reliably compensate). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-25igt/kms_setmode: Test that the vblank interval matches the dotclockChris Wilson
As we allow userspace to set the dotclock, we should try to respect it! Userpsace will try to set its frametimings based upon the dotclock, so ideally it should match the measured vblank interval. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-24igt/kms_setmode: Clear all connectors before starting the testChris Wilson
Before we start trying random combinations of connectors and CRTCs, we should first ensure we have a blank slate so that if we only change a subset of the CRTC we do not conflict with a residual setup on the other CRTC. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-14tests: Open any driverTomeu Vizoso
For those tests that now pass on drivers other than i915, call drm_open_driver_master with DRIVER_ANY. Also do so from igt_enable_connectors. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-07tests/kms_setmode: Fix compilation warnings.Marius Vlad
kms_setmode.c:384:30: warning: declaration of ‘drm_fd’ shadows a global declaration [-Wshadow] kms_setmode.c:45:12: note: shadowed declaration is here static int drm_fd; kms_setmode.c:391:38: warning: passing argument 8 of ‘drmModeSetCrtc’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] ids, crtc->connector_count, &crtc->mode); Signed-off-by: Marius Vlad <marius.c.vlad@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-03-07tests/kms_setmode: Add tests when not stealing encoders on same crtc.Maarten Lankhorst
Excercise connector stealing harder. There is a border case in atomic currently where encoder stealing is not prevented on the same crtc when the encoder is not reassigned. The following testcase excercises that path and causes a OOPS on my system with nightly. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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-12tests/kms_setmode: Handle MST correctly.Maarten Lankhorst
There is a MST encoder for each crtc, and each MST connector will be connected to the encoder bound to that crtc. This breaks the kms_setmode assertion that is only 1 encoder per connector, so make an exception to that rule for displayport. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.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-08-14tests/kms_setmode: mark simple clone test as basicJesse Barnes
Should cover simple, single CRTC mode sets. Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-05-15lib: Add a user data pointer to the argument parsing functionsDamien Lespiau
It can be useful to have one of those to carry state between the handler parsing the options and the rest of the test. Right now the only thing we can do is to use global variables for that. 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>
2015-02-25lib: remove handled option arguments from argvThomas Wood
Remove options from argv that have been handled by getopt to allow additional non-option parameters to be processed in the test application. This fixes issues when using options such as --debug with tests that accept additional non-option parameters. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30test/kms, pm: use drm_open_any_masterImre Deak
These tests require DRM master right, so make sure they have it from the beginning. This gives an early indication if another DRM master is running and makes the given test skip (with a proper explanation of the reason) instead of exiting with error. Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-08-21kms_setmode: Adjust to the igt_create.*fb() APIDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-12lib/igt_kms: Simplify return value of kmstest_get_connector_default_modeDaniel Vetter
A plain bool is good enough, no need for fancy negative error values. 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-08-12lib/igt_kms: Unify pipe name helpersDaniel Vetter
And add api doc while at it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-23tests: remove unused getopt header includesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-05-14tests: Use igt macros moreDaniel Vetter
Often just folding together of the common if (cond) printf; abort|igt_skip|igt_fail; pattern. But in a few cases I've ripped out more since the igt macros will already print the condition and errno. A few tests where more work (like ripping out return codes en masse) is needed left as-is. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14tests: sprinkle igt loggingDaniel Vetter
All the cases that simply dump some debug information and couldn't be converted to some of the fancier macros. Some information output removed when it's redundant with the subtest status. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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: rename intel_gpu_tools.h to intel_io.hDaniel Vetter
With the header cleanup we can now give this header a suitable name, since it now really only contains register access and other I/O functions and assorted definitions. 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>
2014-03-05kms_setmode: Add clone-single-crtc subtestImre Deak
The clone-single-crtc will test various cloning scenarios. Currently it does limit the number of simultanously cloned connectors to the number of pipes in the system. That restriction can be lifted in the future if desired. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-12-31kmstest: Fix up lifetimes of cairo objectsChris Wilson
cairo_t is the short lived drawing context, whereas cairo_surface_t is the heavyweight object that persists and is also tied to underlying GEM objects. So make the kmstest API reflect the different weights and fix the lifetime and underlying object reference leaks. Based on the fix by Paulo Zanoni. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-11tests/kms_setmode: avoid 2 connectors on the same encoderPaulo Zanoni
Don't try to set modes on two connectors that share the same encoder. That will just fail. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68463 Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-12lib: Move kms stuff from drmtest.c over to igt_kms.cOscar Mateo
This makes cairo dependencies easier to handle. Otherwise, we would have to litter drmtest all over with "#ifndef ANDROID" Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> [danvet: Add missing _GNU_SOURCE to igt_kms.c and missing include to intel_sprite_on.c] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01lib: make igt_set_vt_graphics_mode never failDaniel Vetter
All tests agree that this is a letal failure, so no point to pass it back to callers. Also add some igt_require calls for the drm_fd where I've noticed that it's missing. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26tests/kms_setmode: don't save/restore vt graphics for dry-runImre Deak
Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-19tests: add kms_setmodeImre Deak
Iterate through all valid/invalid crtc/connector combinations. At the moment only clone configurations are tested as the single output cases are tested already by testdisplay. Also from combinations where all connectors are on the same crtc (clone-single-crtc) only those are tested that are invalid, as I haven't found any machine that supports these (have to be GT2 with dvo and vga output). For configurations with one crtc per connector the FBs are per-crtc atm. Signed-off-by: Imre Deak <imre.deak@intel.com>