summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
AgeCommit message (Collapse)Author
2022-07-01lib/igt_kms: Add scaling filter propertySwati Sharma
Added "scaling filter" as pipe and plane property. v2: -Moved lib changes from 4/4 to 3/4 -Renaming filter enum v3: -fix indentation(juha) Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2022-06-15lib/igt_kms: Add a helper function to check Bigjoiner supportBhanuprakash Modem
Create a helper function to check that the system supports the given crtc/connector mode(s). Example: * Pipe-D won't support Bigjoiner, hence we can't use the connector modes greater than 5K on Pipe-D * To use 8K mode on a pipe, then the consecutive pipe must be free. The Kernel is expected to reject the invalid combo (which must be validated as a scenario separately). So, this helper function checks the validity of the combo to avoid failures. To use this helper, each individual subtest needs to set the @pipe to a specific @output by igt_output_set_pipe() and call this helper to check the validity of the combo. V2: * Rebase * Add support to handle fused pipes V3: * Reject the bigjoiner if the consecutive pipe is not available Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Manasi Navare <manasi.d.navare@intel.com> Reviewed-by: Karthik B S <karthik.b.s@intel.com>
2022-06-03lib/igt_kms: Call get_assigned_primary only if display is initializedJessica Zhang
Move code for getting the driver-assigned primary plane to before the `out` tag. This will avoid any crashes in cases where the display resources haven't been initialized. Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2022-06-01lib/igt_kms: Add helper functions to sort drm modesBhanuprakash Modem
Add helper function to sort drm modes based on the clock, resolution in both ascending & descending order. V2: * Minor changes V3: * Added documentaion for helper functions Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2022-05-30lib/igt_kms: Fix mixed declarations warningBhanuprakash Modem
Fix mixed declarations warning introduced by (58a5a2d5) [214/1052] Compiling C object lib/libigt-igt_kms_c.a.p/igt_kms.c.o ../lib/igt_kms.c: In function ‘igt_display_require’: ../lib/igt_kms.c:2468:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 2468 | igt_output_t *output = igt_get_single_output_for_pipe(display, i); | ^~~~~~~~~~~~ Cc: Jessica Zhang <quic_jesszhan@quicinc.com> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-05-27lib/igt_kms: Set pipe->plane_primary to driver-assigned primary plane when ↵Jessica Zhang
there are multiple possible primary planes Currently, IGT populates pipe->planes using possible_crtcs and assumes that the first primary plane it encounters is the one being actively used by the pipe. This is not always true in cases where there are multiple possible primary planes. This will cause problems whenever IGT calls drmModePageFlip since drmModePageFlip will use the primary plane assigned to the pipe by the driver to perform the page flip [1]. So a mismatch between the primary plane used by IGT and the driver can cause the page flip to fail. To fix this, let's implement a helper method to get the primary plane that's being assigned to the pipe by the driver. We can then call it during igt_display_require() and, if there's a mismatch between pipe->plane_primary and the assigned primary plane's index, we can swap the unused primary plane with the driver-assigned primary plane [1] https://gitlab.freedesktop.org/drm/msm/-/blob/msm-next/drivers/gpu/drm/drm_plane.c#L1234 Changes since v1: - Instead of swapping the pointers of the planes within the array, we can just change the value of pipe->plane_primary. Changes since v2: - Reverted `if (type == DRM_PLANE_TYPE_PRIMARY)` conditional then added a nested if statement to increment num_primary_planes if plane type is primary. Changes since v3: - Created helper method igt_pipe_has_valid_output and added a check for if pipe has valid output before getting the output of a pipe to get the assigned primary plane - Reverted back to using igt_swap to swap the order of the primary planes within the pipe->planes array. Some kms_* tests use igt_output_get_plane(output, 0) to get the primary plane, so this will avoid regressions in those tests. - Updated the plane->index of the primary planes that are being swapped. Suggested-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Mark Yacoub <markyacoub@chromium.org>
2022-05-26lib/kms: Replace libdrm connector name with outputSwati Sharma
Use libdrm connector name from output->name, instead of constructing it from drm resources. Suggested-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
2022-05-17lib/igt_kms: Add helper functions to read few debugfsBhanuprakash Modem
Add helper functions: - Read maximum bpc from connector debugfs - Read Current bpc from crtc debugfs - Compare/Assert if Current & Requested bpc are not equal V2: * New function to compare current & requested bpc Cc: Mark Yacoub <markyacoub@chromium.org> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
2022-03-28lib/igt_kms: commit only the primary plane which is preparedAbhinav Kumar
kms_atomic's test-only sub-test prepares only one primary plane but igt_plane_commit() tries to commit all the primary planes. For drivers having only one primary plane per display still work fine but when there is more than one primary plane, since FB_ID is not assigned for the second one, the API igt_primary_plane_commit_legacy() ends up calling the CRTC disable path incorrectly and hence failing the test. Since only one primary plane has been prepared, commit only that one by matching the primary_plane handle with the plane which has been passed. changes in v2: - compare the primary_plane and current plane's handle to determine whether the current plane is the primary plane instead of comparing the index Reviewed-by: Mark Yacoub <markyacoub@chromium.org> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
2021-10-18lib/kms: Introduce igt_output_preferred_vrefresh()Ville Syrjälä
Add a helper to query the output's preferred vertical refresh rate. Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-18lib/kms: Have igt_std_1024_mode_get() return a mode with specific refreshVille Syrjälä
Pass the desired refresh rate to igt_std_1024_mode_get(), and have it return a mode that will have said refresh rate. Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-18lib/kms: Have igt_std_1024_mode_get() return a copy of the modeVille Syrjälä
We want to provide override modes with different refresh rates. Start by making igt_std_1024_mode_get() return a copy rather than a pointer to the static const mode directly. And sprinkle the necessary free() calls, and some igt_memdups() into parallel codepaths, so we are consistnetly allocating and freeing everything. Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-09-21lib/kms: Add igt_plane_has_rotation()Ville Syrjälä
Probe the supported rotations for each plane from the kernel This should let us eliminate tons of hand rolled gen checks all over. Reviewed-by: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-07-22lib/igt_kms: Rename dp_dsc to dscBhanuprakash Modem
As HDMI also supports DSC, rename *dp_dsc* to *dsc* since it is no longer DP specific. Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com> Cc: Patnana Venkata Sai <venkata.sai.patnana@intel.com> Cc: Karthik B S <karthik.b.s@intel.com> Cc: Navare Manasi D <manasi.d.navare@intel.com> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Karthik B S <karthik.b.s@intel.com>
2021-07-19lib: Add helper functions to read/write dsc debugfsAnkit Nautiyal
Reuse code for reading and writing dsc debugfs and provide helper functions to get dsc related parameters in lib igt_kms. Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
2021-05-31Fixup clang compiler warnings.Maarten Lankhorst
Allows building cleanly with clang again. It complains about using invalid initialisers like char[][] = { 0 }. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-05-18lib/igt_kms: helper to override the mode on all connectorsBhanuprakash Modem
This helper will iterate through all connectors those have a pending_pipe != PIPE_NONE set by the test upto the point of calling this helper. And find the combination by using ATOMIC_TEST_ONLY then return to the test. This helper would override the mode on all connectors that will be modeset by the next igt_display_commit() call in the test. V2: * Remove MST specific logic (Daniel) V3: * Sort connector modes in descending order V4: * Fine tune the logic to reduce #of iterations (Ankit) * Update the documentation (Ankit) V5: * Fix function name to make it generic (Ankit) * Add support for legacy commit (Ankit) Cc: Imre Deak <imre.deak@intel.com> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2021-04-27lib: Put edid_ar_svds where it's usedPetri Latvala
edid_ar_svds was hiding in igt_chamelium instead of igt_kms where it's used, breaking IGT building when chamelium support was disabled. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Kunal Joshi <kunal1.joshi@intel.com> Reviewed-by: Kunal Joshi <kunal1.joshi@intel.com>
2021-04-26Added structures and functions to generate tiled edidsKunal Joshi
Generating the tiled edid which can be flashed on chamelium and added some functions to support the same. v2: No change. v3: No change. v4: No change. v5: No change. Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Navare Manasi D <manasi.d.navare@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-04-26Make basic chamelium function accessible to other testsKunal Joshi
There are many use case where we can integrate chamelium with other tests, Migrating some of basic chamelium functions to igt_chamelium lib to avoid Code rewriting. v2: Moved one more function reset_state from tests/kms_chamelium to lib/igt_chamelium. v3: - Shifted disabling of modeset to igt_kms - Replace connection_str with kmstest_connector_status_str (Petri) - Generalized require__connector_present (Petri) - Avoided using data_chamelium_t struct (Petri) v4: - Moved function to library (Petri) - Renamed some functions and added documentation (Petri) v6: - Documentation of functions(Petri) - Shifted function to igt_kms and renamed (Petri) Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-02-18lib/igt_kms: Decouple ioctl call logic for vblank waitSumera Priyadarsini
Extract the ioctl call logic in igt_wait_for_vblank_count() into a helper function, __igt_vblank_wait(). Adjust igt_assert() test in igt_wait_for_vblank_count() and igt_wait_for_vblank() accordingly. Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
2021-01-08lib/kms: Add fb damage clip plane propertyPankaj Bharadiya
FB_DAMAGE_CLIPS property is been in DRM for a while but was never added to IGT. Add support for FB_DAMAGE_CLIPS property so that kms tests can us it. Reviewed-by: Jose Roberto de Souza <jose.souza@intel.com> Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
2021-01-01lib/kms: Initialise 'full_pipe_mask'Chris Wilson
[165/997] Compiling C object lib/libigt-igt_kms_c.a.p/igt_kms.c.o ../lib/igt_kms.c:2507:4: warning: variable 'full_pipe_mask' is uninitialized when used here [-Wuninitialized] full_pipe_mask |= (1 << i); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-11-19lib/kms: Range check pipe before lookupChris Wilson
Make sure the lookup index is within the range of the table before accessing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-10-07tests: Remove kms_crtc_background_color testPankaj Bharadiya
BACKGROUND_COLOR property is not supported in kernel as of now. Following patch attempted to add support but never got merged due to lack of userspace support. https://patchwork.freedesktop.org/patch/333632/?series=67424&rev=1 This test case is always skipped, as it does not find the BACKGROUND_COLOR prop support hence remove it. Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Acked-by: Martin Peres <martin.peres@linux.intel.com> Acked-by: Matt Roper <matthew.d.roper@intel.com>
2020-09-30lib/igt_kms: Hook up connector dithering propLyude Paul
Nvidia display hardware provides a set of flexible dithering options for CRTCs. This dithering is actually noticeable in the CRC output for all available tap points, and can be seen as CRC values for identical frames cycling between either 2 or 4 values repeatedly (each one of these values is a different dithering phase applied to the source output). Of course, this is very likely to break tests using CRC readback since we don't expect the CRC to change if the source content hasn't changed. So, hook up support for configuring the dithering property and reset it to off from igt_display_reset() when applicable. Reviewed-by: Jeremy Cline <jcline@redhat.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2020-09-16lib/igt_kms: move some of the useful dump functions to igt_kmsAbhinav Kumar
Some of the functions inside the intel_dp_compliance are generic and can be used by other modules as well. Move these to the igt_kms lib. changes in v2: - add more documentation for the new APIs in the lib Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-09-04lib/igt_kms: Add writeback supportBrian Starkey
Add support in igt_kms for writeback connectors, with the ability to attach framebuffers. v8: Remove unnecessary fence cleanup on prepare commit. v5: Rebase and add DRM_CLIENT_CAP_WRITEBACK_CONNECTORS before drmModeGetResources() Signed-off-by: Brian Starkey <brian.starkey@arm.com> [rebased and updated to the latest igt style] Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> [rebased and updated to the latest igt style] Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Simon Ser <simon.ser@intel.com>
2020-07-21lib/kms: Convert pipe id flags for a vblank using crtc offsetMohammed Khajapasha
In i915 with non-contiguous pipes display, pipes always not same as crtc index in display pipes array. Hence reading pipe id flags for a vblank event using crtc offset. Example: With PIPE_A & PIPE_D enabled and PIPE_B & PIPE_C disabled configuration, pipe enum ids for pipe A & D are '0' and '3', and crtc offsets in mode config list for pipe A & D are '0' and '1' hence using crtc offset to read a vblank event for a pipe, as DRM vblank ioctl expect crtc offset for a pipe. v3: Addressed review comments for documentation <Hiler, Arkadiusz> Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-21lib/kms: Skip igt test cases for disabled display pipesMohammed Khajapasha
Skip igt test cases for disabled pipes. Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-21lib/igt_kms: Add igt_require_pipe() functionMohammed Khajapasha
Add igt_require_pipe() fn to check whether a pipe is enabled or not Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-21lib/igt_kms: Add support for display with non-contiguous pipesMohammed Khajapasha
Add support for non-contiguous pipe display by allocating upper bound pipes array for display. With non-contiguous pipes display, pipe mapping is always not same as crtc mapping, For i915 pipe is enum id of i915's crtc object and it is not equal to crtc offset of a pipe in mode config list. Hence allocating upper bound array for igt_pipe and reading pipe id using GET_PIPE_FROM_CRTC_ID ioctl. Example: With a non-contiguous pipes PIPE_A & PIPE_D are enabled, PIPE_C & PIPE_B disabled configuration, the pipe enum for PIPE_A & D will be '0' and '3' and crtc offsets are '0' & '1' in mode config list, to ordering crtcs in drm with enabled pipes allocating upper bound pipes array. v6: Updated commit description as per review comments <Hiler, Arkadiusz> Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-06-26lib: Use generic names for APIs that handle ueventsAnkit Nautiyal
The functions for handling uevents are named with "_hotplug" as suffix such as igt_watch_hotplug(). Earlier hotplug was the only uevent that was requested to be detected, but in fact, these APIs are generic and can be used for detecting other uevents too. Currently we have tests like kms_lease, kms_content_protection using the uevent handling infrastructure for detecting uevents other than hotplug. This patch renames the functions and replace the "_hotplug" suffix with "_uevents". v2: Rebase v3: Added changes in lib igt_chamelium.c, that was missed earlier. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Suggested-by: Ramalingam C <ramalingam.c@intel.com> Suggested-by: Hiler, Arkadiusz <arkadiusz.hiler@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-06-26lib/igt_kms: Add support for detecting connector eventsAnkit Nautiyal
Currently, the event_detect function checks the property val for "HOTPLUG" and "LEASE" both of which are set to '1' when these events are sent. This cannot be used for detecting connector events such as HDCP event as connector events are sent along with property to signify which property of which connector has changed. Connector ID and property id are provided along with "CONNECTOR" and "PROPERTY" as udev property-value pairs. Eg. for HDCP, the connector id of the connector whose hdcp status changed, and the property id of the ‘CONTENT_PROTECTION’ property are sent with uevent. This patch modifies the event_detect function to check multiple properties with different expected values. It also adds support to detect connector event for a given pair of connector and property ids. v2: Simplified the event_detect conditional statements. (Ram) Changed the api name for detecting connnector events. (Anshuman) Added check for "HOTPLUG" property value for connector events. v3: Used ARRAY_SIZE() instead of constants. (Ram) v4: Rebase Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-06-01tests/kms_fbcon_fbt: When restoring fbcon always set mode to text modeJosé Roberto de Souza
If by some reason or tests, this tests is executed and VT mode is already in KD_GRAPHICS the call to kmstest_set_vt_graphics_mode() will set orig_vt_mode as KD_GRAPHICS and when it was calling kmstest_restore_vt_mode() it would set KD_GRAPHICS again not returning to fbcon and causing the test to fail. As it can be seen here: (kms_fbcon_fbt:11004) igt_kms-DEBUG: VT: graphics mode set (mode was 0x1)" https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_499/fi-ehl-1/igt@kms_fbcon_fbt@fbc.html So here adding a new function to alaways set mode the KD_TEXT when we want to restore to fbcon. Reviewed-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2020-05-11lib/igt_kms: Make igt_display_require() + chamelium more robustArkadiusz Hiler
1. We don't reset Chamelium, as this generates extra unplug events if any of the ports is already connected which is often the case 2. We try to plug all the chamelium ports, it's a noop if they are already plugged 2. We wait for all the ports being connected: - if the port mapping is provided: wait for the ports to be connected - if there is no mapping: sleep(10) and hope for the best Cc: Petri Latvala <petri.latvala@intel.com> Cc: Imre Deak <imre.deak@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2020-04-15tests/kms_chamelium: Test HPD for different mode handling scenariosArkadiusz Hiler
The default scenario is now performing all hotplugs with modes disabled on all connectors. This is the quickest of the tests and represents userspace not caring about the new display (e.g. explicitly disabled). *-hpd-enable-disable-mode covers the most common userspace behavior where each hotplug event is accompanied by a corresponding enabling / disabling commit. *-hpd-with-enabled-mode explicitly targets the scenario where we have mode enabled and never disable it as we do hotplugs to reproduce the issue we see with TypeC connectors for ICL and TGL. v2: - refresh igt_display output state after reprobing - get mode and set pipe only after we have connector plugged in v3: fix VGA subtest names (Kunal) Cc: Kunal Joshi <kunal1.joshi@intel.com> Cc: Imre Deak <imre.deak@intel.com> Issue: https://gitlab.freedesktop.org/drm/intel/issues/323 Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Kunal Joshi <kunal1.joshi@intel.com>
2020-03-23lib/kms: Try to plug all Chamelium ports, abort if it failsArkadiusz Hiler
Using chamelium as a display for non-chamelium-aware test is challenging. The board can be left in multiple different states after kms_chamelium tests even though we have atexit() handlers and other measures which try to assure that all ports are plugged in. Sadly this is not 100% reliable. We also had a few boards hard hanging (happens very seldom) and requiring manual intervention. This leads to changes in the testing configuration - we may end up with any number of connectors plugged in which makes a lot of kms_ tests to flip between skip and pass depending on a run. In an attempt to make connectors state less random this patch makes igt_display_require() chamelium-aware. If chamelium is configured for given machine we try to reach it and make sure everything is plugged in. If we fail to do so we abort the execution because the testing configuration is an unknown. For machines without a configured chamelium this boils down to a nop. I have run a bunch of tests and measured how much time we spend in the Chamelium section of igt_display_require() (n = 1000) with chamelium configured: Min: 0.0030s Max: 0.0113s Avg: 0.0089s Median: 0.0089s With ~1000 of KMS subtests in a run it's only a mere 9s. This will however add a bit of extra execution time to test skips because of doing kmstest_set_vt_graphics_mode() and igt_display_require() before even checking whether Chamelium is configured. v2: do kmstest_set_vt_graphics_mode() before requiring display (Petri) Fixes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/20 Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-02-07lib/igt_kms: Add HDR_OUTPUT_METADATA connector propertyNicholas Kazlauskas
...and also reset it when resetting outputs since that can definitely affect CRC output on other tests when not reset. v2: rebase v3: rebase v4: updated doc for igt_display_reset [Petri] Cc: Leo Li <sunpeng.li@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
2020-02-07lib/igt_kms: Add max bpc connector propertyNicholas Kazlauskas
It's been in DRM for a while but was never added to IGT's internal list. This property should be reset along with other properties between tests since output color depth can affect CRC calculation... but it's not really feasible since it's driver specific for what the value should be reset to. v2: rebase v3: rebase Cc: Leo Li <sunpeng.li@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
2020-02-06lib/igt_kms: Add igt_reduce_format()Ville Syrjälä
Add a helper to reduce a pixel format to a "base" format. Ie. group all formats to some idea of classes based on the bits per pixel + component sizes etc. ignoring any component ordering. Let's us skip potentially redundant tests when all we might care about is testing each format "class" the once. v2: Add some docs (Chris) Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> #irc Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-12-04lib/igt_kms: Rework forced connector handlingVille Syrjälä
Let's use igt_connector_sysfs_open() for connector forcing. Since we're getting rid of the allcoated connector 'path' we'll change the tracking to use the connector type and type_id, and we'll chop things up a bit to make the code easier to follow. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-12-04lib/igt_kms: Don't leak fds when forcing connector multiple timesVille Syrjälä
Close the new sysfs directory fd when we've already forced the same connector previously. Currently we're leaking the fd. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-12-04lib/igt_kms: Add igt_connector_sysfs_open()Ville Syrjälä
Add a helper to open the sysfs directory for a connector. v2: Drop the useless kmstest_connector_dirname() return value check Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-11-29lib/igt_kms: Remove fragile display_info debugfs parsingVille Syrjälä
Relying on the specific layout of the display_info debugfs file is fragile. Any change in the file layout will likely result in test failure. Let's just get rid of it. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-11-29lib/kmstest_dumb_map_buffer: docs updateRamalingam C
Added the need for munmapping the returned pointer, after its usage. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-09-09lib/igt_kms: added tile property parserMadhumitha Tolakanahalli Pradeep
The tile property parser parses the connector tile property obtained from connector's Display ID block and set per connector. v2: Minor style changes (Simon) Cc: Manasi Navare <manasi.d.navare@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Simon Ser <simon.ser@intel.com> Cc: <madhumitha.tp@gmail.com> Signed-off-by: Madhumitha Tolakanahalli Pradeep <madhumitha.tolakanahalli.pradeep@intel.com> Reviewed-by: Simon Ser <simon.ser@intel.com>
2019-08-30lib/igt_kms: Remove stale restrictions for HSW/BDW HDMI connector forcingVille Syrjälä
We have no problems forcing HDMI connector status on HSW/BDW these days. Remove the bogus restriction. Also DP forcing doesn't really work on any platform because the kernel can't get the DPCD if there's nothing actually connected. So keep refusing DP forcing, and in fact extend it to all platforms. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Simon Ser <simon.ser@intel.com>
2019-08-15lib/igt_kms: add support for link-statusSimon Ser
This patch simply adds link-status to our list of properties. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
2019-08-15lib/igt_edid: merge edid_ext_update_cea_checksum into edid_update_checksumSimon Ser
Callers no longer need to call edid_ext_update_cea_checksum on each extension block. This makes it less error-prone to miss one block by mistake. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>