summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
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-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-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>
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-08-24lib/kms: Add igt_rotation_90_or_270()Ville Syrjälä
Add a helper to simplify the 90/270 vs. 0/180 rotation checks. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Karthik B S <karthik.b.s@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-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-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-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>
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/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-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-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: 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-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-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_kms: drop EDID_LENGTH, replace with EDID_BLOCK_SIZESimon Ser
EDID_LENGTH is misleading because EDIDs are a variable size (they contain one or more 128-byte EDID blocks). This commit renames it to EDID_BLOCK_SIZE which makes it clear users need to call edid_get_size to get the total size. The declaration has also been moved to igt_edid. ("Size" has been chosen over "length" because it's clearer that it's a number of bytes, not a number of elements) Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-08-15lib/igt_kms: use struct edid instead of unsigned charSimon Ser
This has several advantages: * No more need to convert back and forth between these two (everybody should use struct edid, the exception being lib/tests/igt_edid which performs sanity checks) * Makes it clearer that users can call edid_get_size on a returned EDID blob * Improves type safety (it's more obvious is a random blob is used as an EDID) Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-08-06kms_content_protection: Content type supportRamalingam C
Adds a connector property called "CP_Content_Type" Content Type takes two values which classifies the content stream: Type 0: Stream that can be transmitted on HDCP1.4/HDCP2.2 Type 1: Stream that needs HDCP2.2 encryption only. So when Type 1 is set KMD is forced to enable HDCP2.2 only. For Type 0 request, Kernel chooses the highest capable HDCP version (v2.2) first. If that fails, then it fall back to the next available version(v1.4) before abondoning HDCP authentication attempts. Please note content_type is allowed to be updated when "Content Protection" is in UNDESIRED state. v2: s/cp_content_type/content_protection_type [danvet] v3: s/content_protection_type/HDCP Content Type [Pekka] v4: Rebased v5: Typos in the commit msg is fixed [Uma] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Link: https://patchwork.freedesktop.org/patch/315467/?series=57756&rev=10
2019-07-11lib/igt_kms: add igt_kms_get_3d_edidSimon Ser
This replaces kmstest_edid_add_3d. The previous code for generating CEA extensions can be removed. The old and new generated EDIDs are byte-to-byte equal. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-07-05lib/igt_kms: use igt_edid to generate a 4K EDIDSimon Ser
The new EDID has been byte-by-byte checked to be exactly the same as before. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-07-05lib/igt_kms: remove length parameter from kmstest_force_edidSimon Ser
Given an EDID, computing the size is trivial. Instead of having one size constant per EDID and hope the callers use the right one (ie. *not* EDID_LENGTH when there's an extension), we can make functions that take EDIDs compute the size if they need it. We have tests in lib/tests/igt_edid.c which assert the number of extensions present in the EDID anyway. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-06-10lib/igt_kms: generate an EDID suitable for DP audioSimon Ser
Prior to this commit, we were using the Chamelium's default EDID for DP audio. This relies on the fact that this EDID supports audio and has correct audio paremeters for our testing. Generating our own EDID is less error-prone and will allow us to test different audio parameters. v2: - Replace {HDMI,DP}_AUDIO_EDID_LENGTH with AUDIO_EDID_LENGTH (Arek) - Don't hardcode EDIDs array length (Arek) Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-06-06tests/kms_flip: Skip VBlank tests in modules without VBlankRodrigo Siqueira
The kms_flip test relies on VBlank support, and this situation may exclude some virtual drivers to take advantage of this set of tests. This commit adds a mechanism that checks if a module has VBlank. If the target module has VBlank support, kms_flip will run all the VBlank tests; otherwise, the VBlank tests will be skipped. Additionally, this commit improves the test coverage by checks if the function drmWaitVBlank() returns EOPNOTSUPP (i.e., no VBlank support). V7: Skip seq number checking and busy flip if the device doesn't support vblank V6: Set errno to zero before call drmWaitVBlank() (Chris Wilson) V5: Drop the DRM_VBLANK_NEXTONMISS (Chris Wilson) V4: Replace DRM_VBLANK_ABSOLUTE by DRM_VBLANK_RELATIVE and DRM_VBLANK_NEXTONMISS V3: Add documentation (Daniel Vetter) V2: Add new branch coverage to check if VBlank is enabled or not and update commit message V1: Chris Wilson - Change function name from igt_there_is_vblank to kms_has_vblank - Move vblank function check from igt_aux to igt_kms - Utilizes memset in dummy_vbl variable - Directly return the result of drmWaitVBlank() Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
2019-06-04lib/igt_kms: introduce igt_kms_get_hdmi_audio_edidSimon Ser
This new function uses igt_edid to generate an EDID suitable for testing HDMI audio. It's imported from kms_chamelium with minor edits, it's used there and in kms_hdmi_inject. A (unexported for now) generate_hdmi_audio_edid function enables generation of EDIDs with arbitrary SAD and speaker blocks. This obsoletes kmstest_edid_add_audio. The sanity check for the HDMI audio EDID has been moved from lib/tests/igt_hdmi_inject.c to lib/tests/igt_edid.c. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-01tests/plane_lowres: Test each plane individuallyJosé Roberto de Souza
ICL has some many planes per pipe that it is causing this test to skip due bandwidth limitation when combined with 4K displays. The objective of this test is test the visibility of the planes when switching between high and low resolution, more information in the patch that added this test 12e34d8c909a ("tests/kms_plane_lowres: Plane visibility after atomic modesets"). So it was setting all the planes the tested pipe in the bottom left of the display using the height of high resolution, checking the visibility and then switching to the low resolution mode and checking again the visibility and now it is expected that all planes would be invisible. So to overcome ICL bandwidth issues, here it is testing each plane individually. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Mika Kahola <mika.kahola@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-01lib: Share the 1024x768 mode among testsJosé Roberto de Souza
Three test were duplicating this 1024x768 mode so lets move it to lib and share it. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-03-13lib/igt_kms: Add zpos plane property.Marius Vlad
Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2019-03-11lib/debugfs: Fix wraparound handling for crc frame counter checkVille Syrjälä
Deal with frame counter wraparound correcrtly. v2: Make the comparison functions available for everyone (Chris) Add some docs (gtk-doc seems obtuse so not 100% warning free) Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-04lib/igt_kms: Fix commits for planes with multiple possible CRTCsNicholas Kazlauskas
An igt_plane_t is defined per igt_pipe_t. It is treated as its own independent resource but DRM planes can be exposed to being used on a number of possible CRTCs - making it a shared resource. In IGT planes with multiple possible CRTCs are added to the plane list for each pipe that the plane supports. The internal state remains independent in IGT so when the same plane is modified for multiple pipes in a single commit the last pipe to modify it is the one whose state gets fully applied. This situation happens fairly often in practice - resetting the display at the start of the test before a commit will reset the CRTC ID and FB ID for each plane. For an example, consider the igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max test. This test will fail for any overlay plane exposed for multiple CRTCs. The test tries to set a framebuffer for pipe A but has all the other pipes reset the plane state in the same commit. If there are multiple pipes on the hardware then the last pipe will be the one to set all the plane properties. The driver will receive a commit with no overlay plane enabled since the last pipe set CRTC ID and FB ID to 0, disabling the plane. The reference CRC capture will be incorrect since not all the planes have been enabled and the subsequent CRC captures will not match, failing the test. The simplest (but hacky) fix to this problem is to only set the properties for the plane for the pipe that last had it bound. This patch introduces a global plane list on igt_display_t that keeps track of the pipe that pipe that last called igt_plane_set_fb. The properties for the plane will only be applied from that single pipe when commiting the state to DRM. No behavioral changes should be introduced by this patch for hardware whose planes are only ever exposed one CRTC. It would likely be best to eventually modify the igt_pipe_t plane list to be a list of pointers to planes instead (igt_plane_t**) instead of being the actual plane objects, but that can come later. Many areas of the code like to make use of the backpointer to the pipe on the plane which makes refactoring the code in that manner a little trickier. v2: Add igt_plane_set_fb, use igt_plane_t for global plane list (Daniel) v3: Leave TODO for filling in all state/props on global planes Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-02-26lib/igt_kms: Add helpers to count and iterate planes from outputPaul Kocialkowski
With helpers to count and iterate among planes of a given type from the pipe in place, we can use them with the current pipe for the output to make it possible for tests to use them (the pipe struct is not currently easily exposed to tests and exposing it adds unnecessary complexity). Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>