tests/chamelium: Integrate the chamelium v3
Subsystems (2)
v2 cover tests/chamelium: Integrate the chamelium v3
Hi all,
This patch series introduces a new wrapper for the Chameleon v3 board, a testing tool used primarily for Chromebooks, but also by community members to increase test coverage of graphic devices. The Chameleon v3 is an upgrade from its predecessor, with the ability to emulate 2 HDMI and 2 DisplayPort devices, including MST devices.
The board can read and analyze any stream on the DisplayPort and HDMI cables, and even take captures, making it an ideal tool for testing hardware, driver, and user space behavior in specific situations, such as screen hotplugging and multiple MST screens. However, the changes between the v2 and v3, such as the addition of MST support and the removal of CRC for screen captures, would require significant modifications to the existing tests and wrappers.
To avoid this complexity and ensure that the Chameleon v3 is fully supported and the v2 is not broken, I wrote a new wrapper with simplicity and ease of use in mind. The Chameleon v3 wrapper should only manage the Chameleon itself, without the need for DRM displays, EDID caching/modifications, or state machines. This approach will make it easier for developers to use the Chameleon v3 and contribute to its development.
I will use this work to create many new tests (that will come in future series):
- MST managment
- Tiled displays emulation
- Suspend/Resume
- Hardware overlay planes
This series can be divided in multiple parts:
- PATCH 1-5: Adding few helpers to igt_kms
- PATCH 6-10: Add few helpers to minotor_edid
- PATCH 10-14: Split chamelium v2 and chamelium v3 support
- PATCH 15-18: Create a basic test listing available port on the chamelium
- PATCH 19-27: Add port mapping configuration and autodetection
- PATCH 28-38: Add basic EDID tests
- PATCH 39: Add documentation
As most of the series is preparation work, I sent all the patches today, but if required I can split the series in multiple smallest series.
---
Changes in v2:
- Mainly splitting and cleaning work since the RFC,
EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Louis Chauvet (39):
lib/igt_kms: Add a detect timeout value
lib/igt_kms: Add helper to wait for a specific status on a connector lib/igt_kms: Add function to list connected connectors
lib/igt_kms: Add helper to obtain a connector by its name or MST path lib/igt_kms: Add function to get valid pipe for specific output lib/monitor_edids: Add helper functions for using monitor_edid objects lib/monitor_edids: Add helper to get an EDID by its name lib/monitor_edids: Add helper to print all available EDID names lib/monitor_edids: Fix missing names in some monitor EDID lib/monitor_edids: Add new EDID for HDMI 4k
tests/chamelium: Extract Chamelium v2 tests into a separate directory lib/chamelium/v2: Extract chamelium v2 wrapper into its own directory lib/chamelium/v2: Modify build options to separate Chamelium v2 and v3 lib/chamelium/v3: Introduce the foundation for the Chamelium v3 wrapper lib/chamelium/v3: Introduce initialization and cleanup of Chamelium-related structures lib/chamelium/v3: Add method to discover Chamelium ports lib/chamelium/v3: Implement method to retrieve Chamelium port names tests/chamelium/v3: Implement a basic Chamelium v3 accessibility test lib/chamelium/v3: Implement Chamelium reinitialization via Reset RPC call lib/chamelium/v3: Implement methods for plugging Chamelium ports lib/chamelium/v3: Implement methods for managing Chamelium EDID lib/chamelium/v3: Implement Chamelium configuration parsing lib/chamelium/v3: Log port mapping for debugging purposes lib/chamelium/v3: Introduce new configuration format for MST support lib/chamelium/v3: Provide access to port_mapping via method call lib/chamelium/v3: Implement helper function to get port mapping from Chameleon port id lib/chamelium/v3: Implement helper function to retrieve connector from port mapping lib/chamelium/v3: Plug specific ports for all tests
lib/chamelium/v3: Implement Chamelium port autodetection algorithm lib/chamelium/v3: Add save option to avoid doing autodetection every time tests/chamelium/v3: Implement basic EDID handling test tests/chamelium/v3: Implement 4K EDID stress test
tests/chamelium/v3: Implement non-4K EDID stress test
lib/chamelium/v3: Implement method to discover video signal status tests/chamelium/v3: Implement test for DRM device resolution lib/chamelium/v3: Implement hot plug toggle scheduling method tests/chamelium/v3: Add test for display change detection during sleep tests/chamelium/v3: Add MST EDID reading test
docs: Add Chamelium v3
docs/chamelium.txt | 90 +-
docs/testplan/meson.build | 4 +-
lib/{ => chamelium/v2}/igt_chamelium.c | 2 +-
lib/{ => chamelium/v2}/igt_chamelium.h | 0
lib/{ => chamelium/v2}/igt_chamelium_stream.c | 2 +-
lib/{ => chamelium/v2}/igt_chamelium_stream.h | 0
lib/chamelium/v3/igt_chamelium.c | 1191 +++++++++++++++++++++++
lib/chamelium/v3/igt_chamelium.h | 89 ++
lib/igt.h | 6 +-
lib/igt_core.c | 3 +
lib/igt_kms.c | 287 +++++-
lib/igt_kms.h | 17 +
lib/meson.build | 16 +-
lib/monitor_edids/dp_edids.h | 3 +
lib/monitor_edids/hdmi_edids.h | 27 +-
lib/monitor_edids/monitor_edids_helper.c | 92 +-
lib/monitor_edids/monitor_edids_helper.h | 10 +-
lib/tests/meson.build | 8 +-
meson.build | 45 +-
meson_options.txt | 8 +-
tests/chamelium/{ => v2}/kms_chamelium_audio.c | 0
tests/chamelium/{ => v2}/kms_chamelium_color.c | 0
tests/chamelium/{ => v2}/kms_chamelium_edid.c | 2 +-
tests/chamelium/{ => v2}/kms_chamelium_frames.c | 0
tests/chamelium/{ => v2}/kms_chamelium_helper.c | 0
tests/chamelium/{ => v2}/kms_chamelium_helper.h | 0
tests/chamelium/{ => v2}/kms_chamelium_hpd.c | 0
tests/chamelium/v3/kms_chamelium_v3_basic.c | 30 +
tests/chamelium/v3/kms_chamelium_v3_edid.c | 419 ++++++++
tests/kms_color_helper.h | 2 +-
tests/kms_feature_discovery.c | 6 +-
tests/kms_tiled_display.c | 6 +-
tests/meson.build | 45 +-
33 files changed, 2348 insertions(+), 62 deletions(-)---
base-commit: 9683de1314f7fb9204fc4d8baf193a52adda9b59
change-id: 20240522-dev-remove-static-ports-9382ffbbf146
Best regards,
Signature · 1 line
Louis Chauvet <[email protected]>
PATCH v2 1/39 lib/igt_kms: Add a detect timeout value
Some tests need to wait for a specific connector status. In order to make the timeout customisable for each target, add an option in the configuration file.
--- lib/igt_core.c | 3 +++ lib/igt_kms.c | 24 ++++++++++++++++++++++++ lib/igt_kms.h | 9 +++++++++ 3 files changed, 36 insertions(+)
lib/igt_core.c +3 -0
@@ -260,6 +260,9 @@* # It is not mandatory and allows overriding default values. * [DUT] * SuspendResumeDelay=10 +* # The following option define the timeout for detection feature +* # (waiting for a connector status) +* DetectTimeout=10.0 * ]| * * Some specific configuration options may be used by specific parts of IGT,
lib/igt_kms.c +24 -0
@@ -57,6 +57,7 @@#include "intel_chipset.h" #include "igt_debugfs.h" #include "igt_device.h" +#include "igt_rc.h" #include "igt_sysfs.h" #include "sw_sync.h" #ifdef HAVE_CHAMELIUM
@@ -6662,3 +6663,26 @@ int get_num_scalers(int drm_fd, enum pipe pipe)return num_scalers; } + +/** +* igt_default_detect_timeout - Get the default timeout value for detection feature +* +* Some tests requires to wait for a specific connector status. This value will determine the +* timeout value for this waiting. +*/ +float igt_default_detect_timeout (void ) +{ +static double timeout =0.0 ; +static bool first_call = true; + +if (first_call) { +if (igt_key_file) + timeout =g_key_file_get_double (igt_key_file,"DUT" ,"DetectTimeout" ,NULL ); +else + timeout =DEFAULT_DETECT_TIMEOUT ; + + first_call = false; + } + +return timeout; +}
lib/igt_kms.h +9 -0
@@ -39,6 +39,13 @@#include "igt_fb.h" #include "ioctl_wrappers.h" +/** +* define DEFAULT_DETECT_TIMEOUT - Default timeout used for some detection functions +* +* It can be overiden by option DetectTimeout in the .igtrc file. +*/ +#define DEFAULT_DETECT_TIMEOUT 10.0 +/* Low-level helpers with kmstest_ prefix */ /**
@@ -1224,4 +1231,6 @@ bool igt_check_output_is_dp_mst(igt_output_t *output);int igt_get_dp_mst_connector_id (igt_output_t *output);int get_num_scalers (int drm_fd,enum pipe pipe); +float igt_default_detect_timeout (void ); +#endif /* __IGT_KMS_H__ */
Signature · 1 line
2.44.2
Re: [PATCH i-g-t v2 01/39] lib/igt_kms: Add a detect timeout value
Hi Louis,
Quoted 5 lines · Louis Chauvet
Some tests need to wait for a specific connector status. In order to make the timeout customisable for each target, add an option in the configuration file.
Signed-off-by Louis Chauvet <[email protected]>
Could you split this series into smaller chunks for easier review? +cc Vignesh
I also spotted one file with GPL licence, in IGT it should have MIT or at least 'GPL or MIT'
This particular patch LGTM,
Btw for patches which touch KMS libs please add few other kms developers, for example Bhanu and Juha-Pekka:
Regards,
Kamil
Quoted 88 lines
--- lib/igt_core.c | 3 +++ lib/igt_kms.c | 24 ++++++++++++++++++++++++ lib/igt_kms.h | 9 +++++++++ 3 files changed, 36 insertions(+)lib/igt_core.c +3
-0@@ -260,6 +260,9 @@* # It is not mandatory and allows overriding default values. * [DUT] * SuspendResumeDelay=10 +* # The following option define the timeout for detection feature +* # (waiting for a connector status) +* DetectTimeout=10.0 * ]| * * Some specific configuration options may be used by specific parts of IGT, lib/igt_kms.c +24
-0@@ -57,6 +57,7 @@#include "intel_chipset.h" #include "igt_debugfs.h" #include "igt_device.h" +#include "igt_rc.h" #include "igt_sysfs.h" #include "sw_sync.h" #ifdef HAVE_CHAMELIUM @@ -6662,3 +6663,26 @@ int get_num_scalers(int drm_fd, enum pipe pipe)return num_scalers; } + +/** +* igt_default_detect_timeout - Get the default timeout value for detection feature +* +* Some tests requires to wait for a specific connector status. This value will determine the +* timeout value for this waiting. +*/ +float igt_default_detect_timeout (void ) +{ +static double timeout =0.0 ; +static bool first_call = true; + +if (first_call) { +if (igt_key_file) + timeout =g_key_file_get_double (igt_key_file,"DUT" ,"DetectTimeout" ,NULL ); +else + timeout =DEFAULT_DETECT_TIMEOUT ; + + first_call = false; + } + +return timeout; +}lib/igt_kms.h +9
-0@@ -39,6 +39,13 @@#include "igt_fb.h" #include "ioctl_wrappers.h" +/** +* define DEFAULT_DETECT_TIMEOUT - Default timeout used for some detection functions +* +* It can be overiden by option DetectTimeout in the .igtrc file. +*/ +#define DEFAULT_DETECT_TIMEOUT 10.0 +/* Low-level helpers with kmstest_ prefix */ /** @@ -1224,4 +1231,6 @@ bool igt_check_output_is_dp_mst(igt_output_t *output);int igt_get_dp_mst_connector_id (igt_output_t *output);int get_num_scalers (int drm_fd,enum pipe pipe); +float igt_default_detect_timeout (void ); +#endif /* __IGT_KMS_H__ */ Signature · 2 lines
-- 2.44.2
Re: [PATCH i-g-t v2 01/39] lib/igt_kms: Add a detect timeout value
Quoted 10 lines · Kamil Konieczny
Hi Louis,
Quoted 5 lines · Louis Chauvet
Some tests need to wait for a specific connector status. In order to make the timeout customisable for each target, add an option in the configuration file.
Signed-off-by Louis Chauvet <[email protected]>Could you split this series into smaller chunks for easier review? +cc Vignesh
I will try to split and extract igt_kms and monitor_edids series at least. For the chamelium part I don't know yet.
Quoted 2 lines
I also spotted one file with GPL licence, in IGT it should have MIT or at least 'GPL or MIT'
I will fix it for the v2.
Quoted 2 lines
This particular patch LGTM,
Reviewed-by Kamil Konieczny <[email protected]>
Thanks!
Quoted 5 lines
Btw for patches which touch KMS libs please add few other kms developers, for example Bhanu and Juha-Pekka:
Cc Juha-Pekka Heikkila <[email protected]>Cc Bhanuprakash Modem <[email protected]>
Thanks for the information, I will add them!
Quoted 91 lines
Regards,
KamilQuoted 88 lines
--- lib/igt_core.c | 3 +++ lib/igt_kms.c | 24 ++++++++++++++++++++++++ lib/igt_kms.h | 9 +++++++++ 3 files changed, 36 insertions(+)lib/igt_core.c +3
-0@@ -260,6 +260,9 @@* # It is not mandatory and allows overriding default values. * [DUT] * SuspendResumeDelay=10 +* # The following option define the timeout for detection feature +* # (waiting for a connector status) +* DetectTimeout=10.0 * ]| * * Some specific configuration options may be used by specific parts of IGT, lib/igt_kms.c +24
-0@@ -57,6 +57,7 @@#include "intel_chipset.h" #include "igt_debugfs.h" #include "igt_device.h" +#include "igt_rc.h" #include "igt_sysfs.h" #include "sw_sync.h" #ifdef HAVE_CHAMELIUM @@ -6662,3 +6663,26 @@ int get_num_scalers(int drm_fd, enum pipe pipe)return num_scalers; } + +/** +* igt_default_detect_timeout - Get the default timeout value for detection feature +* +* Some tests requires to wait for a specific connector status. This value will determine the +* timeout value for this waiting. +*/ +float igt_default_detect_timeout (void ) +{ +static double timeout =0.0 ; +static bool first_call = true; + +if (first_call) { +if (igt_key_file) + timeout =g_key_file_get_double (igt_key_file,"DUT" ,"DetectTimeout" ,NULL ); +else + timeout =DEFAULT_DETECT_TIMEOUT ; + + first_call = false; + } + +return timeout; +}lib/igt_kms.h +9
-0@@ -39,6 +39,13 @@#include "igt_fb.h" #include "ioctl_wrappers.h" +/** +* define DEFAULT_DETECT_TIMEOUT - Default timeout used for some detection functions +* +* It can be overiden by option DetectTimeout in the .igtrc file. +*/ +#define DEFAULT_DETECT_TIMEOUT 10.0 +/* Low-level helpers with kmstest_ prefix */ /** @@ -1224,4 +1231,6 @@ bool igt_check_output_is_dp_mst(igt_output_t *output);int igt_get_dp_mst_connector_id (igt_output_t *output);int get_num_scalers (int drm_fd,enum pipe pipe); +float igt_default_detect_timeout (void ); +#endif /* __IGT_KMS_H__ */ Signature · 2 lines
-- 2.44.2
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 2/39 lib/igt_kms: Add helper to wait for a specific status on a connector
In reply to Louis ChauvetDuring testing with chamelium, it is frequent to wait for a specific connector status. This new helper is polling the DRM API to wait for this status. This allows detecting new status without notifier systems (which can fail if hot plug detection is not working properly on the device under test.
--- lib/igt_kms.c | 38 ++++++++++++++++++++++++++++++++++++++ lib/igt_kms.h | 3 +++ 2 files changed, 41 insertions(+)
lib/igt_kms.c +38 -0
@@ -6686,3 +6686,41 @@ float igt_default_detect_timeout(void)return timeout; } + +/** +* igt_wait_for_connector_status - Wait for at most @timeout that the connector @connector_id +* status become @drm_mode +* +* @drm_fd: drm file descriptor +* @connector_id: connector to monitor +* @timeout: maximum duration to wait, in second +* @drm_mode: mode to wait for, see enum drmModeConnection +* +* Returns: true when the status is reached, false if there is a timeout +*/ +bool igt_wait_for_connector_status (int drm_fd,unsigned int connector_id,double timeout, +int drm_mode) +{ +drmModeConnector *connector; +struct timespec start, end; + +if (timeout ==0.0 ) + timeout =igt_default_detect_timeout (); + +clock_gettime (CLOCK_MONOTONIC , &start); +clock_gettime (CLOCK_MONOTONIC , &end); + +while (igt_time_elapsed (&start, &end) <= timeout) { + connector =drmModeGetConnector (drm_fd, connector_id); +if (connector && connector->connection == drm_mode) { +free (connector); +return true; + } +free (connector); +clock_gettime (CLOCK_MONOTONIC , &end); + } + +igt_debug ("Timeout waiting for connection status %d on connector %d\n" , drm_mode, + connector_id); +return false; +}
lib/igt_kms.h +3 -0
@@ -1233,4 +1233,7 @@ int get_num_scalers(int drm_fd, enum pipe pipe);float igt_default_detect_timeout (void ); +bool igt_wait_for_connector_status (int drm_fd,unsigned int connector_id,double timeout, +int drm_mode); +#endif /* __IGT_KMS_H__ */
Signature · 1 line
2.44.2
PATCH v2 3/39 lib/igt_kms: Add function to list connected connectors
In reply to Louis ChauvetIntroduce the igt_get_connected_connectors() function, which returns a list of connector IDs that are currently connected according to DRM.
This function includes a timeout mechanism because connectors can be unplugged at any time. Also, especially with MST, the connector can be listed by drmModeGetResources() but not yet accessible with drmModeGetConnector().
--- lib/igt_kms.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/igt_kms.h | 1 + 2 files changed, 55 insertions(+)
lib/igt_kms.c +54 -0
@@ -6724,3 +6724,57 @@ bool igt_wait_for_connector_status(int drm_fd, unsigned int connector_id, double connector_id);return false; } + +/** +* igt_get_connected_connectors - List all connectors reported as CONNECTED by DRM. +* +* @drm_fd: DRM file description +* @connector_ids: out pointer for the list of connector ids connected. It must be freed by the +* caller. +* +* The returns value is the number of connectors +*/ +int igt_get_connected_connectors (int drm_fd,uint32_t **connector_ids) +{ +int connected_count =0 ; +drmModeResPtr resources; +struct timespec start, end; + + *connector_ids =malloc (0 ); + + resources =drmModeGetResources (drm_fd); +for (int j =0 ; j < resources->count_connectors; j++) { +drmModeConnectorPtr connector =NULL ; + + connector =drmModeGetConnector (drm_fd, resources->connectors[j]); +/* +* This time is required as sometimes some id in the connector list are not totally +* ready or can disappear +*/ +clock_gettime (CLOCK_MONOTONIC , &start); +clock_gettime (CLOCK_MONOTONIC , &end); +while (!connector && +igt_time_elapsed (&start, &end) <igt_default_detect_timeout ()) { + connector =drmModeGetConnector (drm_fd, resources->connectors[j]); +clock_gettime (CLOCK_MONOTONIC , &end); + } + +if (igt_time_elapsed (&start, &end) <igt_default_detect_timeout ()) { +igt_assert (connector); + +if (connector->connection ==DRM_MODE_CONNECTED ) { + *connector_ids =reallocarray (*connector_ids, + connected_count + +1 ,sizeof (**connector_ids)); +igt_assert (*connector_ids); + (*connector_ids)[connected_count] = resources->connectors[j]; + connected_count++; + } +drmModeFreeConnector (connector); + } + } +drmModeFreeResources (resources); + +return + connected_count; +}
lib/igt_kms.h +1 -0
@@ -1235,5 +1235,6 @@ float igt_default_detect_timeout(void);bool igt_wait_for_connector_status (int drm_fd,unsigned int connector_id,double timeout,int drm_mode); +int igt_get_connected_connectors (int drm_fd,uint32_t **connector_ids);#endif /* __IGT_KMS_H__ */
Signature · 1 line
2.44.2
PATCH v2 4/39 lib/igt_kms: Add helper to obtain a connector by its name or MST path
In reply to Louis ChauvetIntroduce the functions igt_get_connector_from_name() and igt_get_connector_id_from_mst_path(). These functions serve to retrieve the connector object using a connector name and a connector ID from its MST path, respectively.
Given that the connector id may not be consistent, especially with MST connectors, these functions are essential to recognize each connector even after system reboots and plug/unplug events.
The function igt_get_connector_id_from_name() is a convenient wrapper for igt_get_connector_from_name() to streamline its usage when the caller only requires the connector id.
--- lib/igt_kms.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/igt_kms.h | 3 ++ 2 files changed, 100 insertions(+)
lib/igt_kms.c +97 -0
@@ -6778,3 +6778,100 @@ int igt_get_connected_connectors(int drm_fd, uint32_t **connector_ids)return connected_count; } + +drmModeConnectorPtr igt_get_connector_from_name (int drm_fd,const char *port_name) +{ +drmModeResPtr res =drmModeGetResources (drm_fd); +struct timespec start, end; +int i; + +if (!res) +return 0 ; + +for (i =0 ; i < res->count_connectors; i++) { +char name[50 ]; + +drmModeConnectorPtr connector =drmModeGetConnector (drm_fd, res->connectors[i]); +/* +* This time is required as sometimes some id in the connector list are not totally +* ready or can disappear +*/ +clock_gettime (CLOCK_MONOTONIC , &start); +clock_gettime (CLOCK_MONOTONIC , &end); +while (!connector && +igt_time_elapsed (&start, &end) <igt_default_detect_timeout ()) { + connector =drmModeGetConnector (drm_fd, res->connectors[i]); +clock_gettime (CLOCK_MONOTONIC , &end); + } + +if (igt_time_elapsed (&start, &end) <igt_default_detect_timeout ()) { +igt_assert (connector); + +/* We have to generate the connector name on our own */ +snprintf (name,50 ,"%s-%u" , +kmstest_connector_type_str (connector->connector_type), + connector->connector_type_id); + +if (strcmp (port_name, name) ==0 ) { +drmModeFreeResources (res); +return connector; + } +drmModeFreeConnector (connector); + } + } +drmModeFreeResources (res); +return NULL ; +} + +/** +* igt_get_connector_id_from_name - Get a connector ID from a connector name +* @drm_fd: DRM file descriptor +* @port_name: Port name to find in the connector +* +* Returns 0 when no connector is found with the correct name +*/ +uint32_t igt_get_connector_id_from_name (int drm_fd,const char *port_name) +{ +drmModeConnectorPtr connector =igt_get_connector_from_name (drm_fd, port_name); + +if (connector) { +int connector_id = connector->connector_id; + +drmModeFreeConnector (connector); +return connector_id; + } +return 0 ; +} + +/** +* igt_get_connector_id_from_mst_path - Get a connector ID from a mst path +* @drm_fd: DRM file descriptor +* @mst_path: MST path to find in the connector +* +* Returns 0 when no connector is found with the correct mst path +*/ +uint32_t igt_get_connector_id_from_mst_path (int drm_fd,const void *mst_path) +{ +drmModeResPtr res =drmModeGetResources (drm_fd); +int i; + +if (!res) +return 0 ; + +for (i =0 ; i < res->count_connectors; i++) { +uint32_t connector_id = res->connectors[i]; + +drmModePropertyBlobPtr path_blob =kmstest_get_path_blob (drm_fd, connector_id); + +if (path_blob) { +if (strcmp (path_blob->data, mst_path) ==0 ) { +drmModeFreePropertyBlob (path_blob); +drmModeFreeResources (res); +return connector_id; + } +drmModeFreePropertyBlob (path_blob); + } + } +drmModeFreeResources (res); +return 0 ; +}
lib/igt_kms.h +3 -0
@@ -1236,5 +1236,8 @@ float igt_default_detect_timeout(void);bool igt_wait_for_connector_status (int drm_fd,unsigned int connector_id,double timeout,int drm_mode);int igt_get_connected_connectors (int drm_fd,uint32_t **connector_ids); +drmModeConnectorPtr igt_get_connector_from_name (int drm_fd,const char *port_name); +uint32_t igt_get_connector_id_from_name (int drm_fd,const char *port_name); +uint32_t igt_get_connector_id_from_mst_path (int drm_fd,const void *mst_path);#endif /* __IGT_KMS_H__ */
Signature · 1 line
2.44.2
PATCH v2 5/39 lib/igt_kms: Add function to get valid pipe for specific output
In reply to Louis ChauvetIntroduces a new function igt_get_pipe_for_output in igt_kms. The function is designed to retrieve a valid pipe for a specific output in a display.
--- lib/igt_kms.c | 19 +++++++++++++++++++ lib/igt_kms.h | 1 + 2 files changed, 20 insertions(+)
lib/igt_kms.c +19 -0
@@ -6875,3 +6875,22 @@ uint32_t igt_get_connector_id_from_mst_path(int drm_fd, const void *mst_path)drmModeFreeResources (res);return 0 ; } + +/** +* igt_get_pipe_for_output - Get a valid pipe for a specific output +* @display: display to fetch the pipes +* @output: output to use +*/ +enum pipe igt_get_pipe_for_output (igt_display_t *display, +igt_output_t *output) +{ +enum pipe pipe; + +for_each_pipe (display, pipe) { +if ((igt_output_is_connected ((output)) && + (output->config.valid_crtc_idx_mask & (1 << (pipe))))) +return pipe; + } + +igt_assert_f (false,"No pipe found for output %s\n" ,igt_output_name (output)); +}
lib/igt_kms.h +1 -0
@@ -1239,5 +1239,6 @@ int igt_get_connected_connectors(int drm_fd, uint32_t **connector_ids);drmModeConnectorPtr igt_get_connector_from_name (int drm_fd,const char *port_name);uint32_t igt_get_connector_id_from_name (int drm_fd,const char *port_name);uint32_t igt_get_connector_id_from_mst_path (int drm_fd,const void *mst_path); +enum pipe igt_get_pipe_for_output (igt_display_t *display,igt_output_t *output);#endif /* __IGT_KMS_H__ */
Signature · 1 line
2.44.2
PATCH v2 6/39 lib/monitor_edids: Add helper functions for using monitor_edid objects
In reply to Louis ChauvetIntroduce the functions edid_from_monitor_edid() and get_edids_for_connector_type(). The former converts a monitor_edid object to a struct edid, which can then be utilized by igt_kms helpers. The latter returns a list of monitor_edid objects for a specific connector with certain characteristics
--- lib/monitor_edids/monitor_edids_helper.c | 61 +++++++++++++++++++++++++++++++- lib/monitor_edids/monitor_edids_helper.h | 5 +++ 2 files changed, 65 insertions(+), 1 deletion(-)
lib/monitor_edids/monitor_edids_helper.c +60 -1
@@ -14,7 +14,10 @@#include <string.h> #include <assert.h> -#include "igt_core.h" +#include "igt.h" +#include "igt_edid.h" +#include "dp_edids.h" +#include "hdmi_edids.h" static uint8_t convert_hex_char_to_byte (char c) {
@@ -90,3 +93,59 @@ void free_chamelium_edid_from_monitor_edid(struct chamelium_edid *edid)free (edid); edid =NULL ; } + +struct edid *edid_from_monitor_edid (const monitor_edid *mon_edid) +{ +uint8_t *raw_edid; +size_t edid_size; +int i; + + edid_size =strlen (mon_edid->edid) /2 ;/* each ascii is a nibble. */ + raw_edid =malloc (edid_size); +igt_assert (raw_edid); + +for (i =0 ; i < edid_size; i++) { + raw_edid[i] =convert_hex_char_to_byte (mon_edid->edid[i *2 ]) <<4 | +convert_hex_char_to_byte (mon_edid->edid[i *2 +1 ]); + } + +if (edid_get_size ((struct edid *)raw_edid) > edid_size) { +uint8_t *new_edid; + +igt_warn ("The edid size stored in the raw edid is shorter than the edid stored in the table." ); + new_edid =realloc (raw_edid,edid_get_size ((struct edid *)raw_edid)); +igt_assert (new_edid); + raw_edid = new_edid; + } + +return (struct edid *)raw_edid; +} + +struct monitor_edid *get_edids_for_connector_type (uint32_t type,size_t *count,bool four_k) +{ +if (four_k) { +switch (type) { +case DRM_MODE_CONNECTOR_DisplayPort: + *count =ARRAY_SIZE (DP_EDIDS_4K ); +return DP_EDIDS_4K ; +case DRM_MODE_CONNECTOR_HDMIA : + *count =ARRAY_SIZE (HDMI_EDIDS_4K ); +return HDMI_EDIDS_4K ; +default : +igt_assert_f (0 ,"No 4k EDID for the connector %s\n" , +kmstest_connector_type_str (type)); + } + }else { +switch (type) { +case DRM_MODE_CONNECTOR_DisplayPort: + *count =ARRAY_SIZE (DP_EDIDS_NON_4K ); +return DP_EDIDS_NON_4K ; +case DRM_MODE_CONNECTOR_HDMIA : + *count =ARRAY_SIZE (HDMI_EDIDS_NON_4K ); +return HDMI_EDIDS_NON_4K ; +default : +igt_assert_f (0 ,"No EDID for the connector %s\n" , +kmstest_connector_type_str (type)); + } + } +}
lib/monitor_edids/monitor_edids_helper.h +5 -0
@@ -12,6 +12,8 @@#define TESTS_CHAMELIUM_MONITOR_EDIDS_MONITOR_EDIDS_HELPER_H_ #include <stdint.h> +#include <stddef.h> +#include <stdbool.h> #include "igt_chamelium.h"
@@ -30,4 +32,7 @@ get_chameleon_edid_from_monitor_edid(struct chamelium *chamelium, const monitor_edid *edid);void free_chamelium_edid_from_monitor_edid (struct chamelium_edid *edid); +struct edid *edid_from_monitor_edid (const monitor_edid *monitor_edid); +struct monitor_edid *get_edids_for_connector_type (uint32_t type,size_t *count,bool four_k); +#endif /* TESTS_CHAMELIUM_MONITOR_EDIDS_MONITOR_EDIDS_HELPER_H_ */
Signature · 1 line
2.44.2
PATCH v2 7/39 lib/monitor_edids: Add helper to get an EDID by its name
In reply to Louis ChauvetFor testing specific EDID, it is useful to be able to retrieve an EDID by a verbose name.
--- lib/monitor_edids/dp_edids.h | 3 +++ lib/monitor_edids/hdmi_edids.h | 3 +++ lib/monitor_edids/monitor_edids_helper.c | 21 +++++++++++++++++++++ lib/monitor_edids/monitor_edids_helper.h | 1 + 4 files changed, 28 insertions(+)
lib/monitor_edids/dp_edids.h +3 -0
@@ -194,4 +194,7 @@ monitor_edid DP_EDIDS_NON_4K[] = { }; +const int DP_EDID_NON_4K_COUNT =ARRAY_SIZE (DP_EDIDS_NON_4K ); +const int DP_EDID_4K_COUNT =ARRAY_SIZE (DP_EDIDS_4K ); +#endif /* TESTS_CHAMELIUM_MONITOR_EDIDS_DP_EDIDS_H_ */
lib/monitor_edids/hdmi_edids.h +3 -0
@@ -604,4 +604,7 @@ monitor_edid HDMI_EDIDS_NON_4K[] = { "1620582c2500baac4200009e0000006b" }, }; +const int HDMI_EDID_4K_COUNT =ARRAY_SIZE (HDMI_EDIDS_4K ); +const int HDMI_EDID_NON_4K_COUNT =ARRAY_SIZE (HDMI_EDIDS_NON_4K ); +#endif /* TESTS_CHAMELIUM_MONITOR_EDIDS_HDMI_EDIDS_H_ */
lib/monitor_edids/monitor_edids_helper.c +21 -0
@@ -19,6 +19,16 @@#include "dp_edids.h" #include "hdmi_edids.h" +struct { +struct monitor_edid *edid_list; +int list_size; +}ALL_EDIDS [] = { + {DP_EDIDS_NON_4K ,DP_EDID_NON_4K_COUNT }, + {DP_EDIDS_4K ,DP_EDID_4K_COUNT }, + {HDMI_EDIDS_NON_4K ,HDMI_EDID_NON_4K_COUNT }, + {HDMI_EDIDS_4K ,HDMI_EDID_4K_COUNT }, +}; +static uint8_t convert_hex_char_to_byte (char c) {if (c >='0' && c <='9' )
@@ -149,3 +159,14 @@ struct monitor_edid *get_edids_for_connector_type(uint32_t type, size_t *count, } } } + +struct edid *get_edid_by_name (char *name) +{ +for (int i =0 ; i <ARRAY_SIZE (ALL_EDIDS ); i++) { +for (int j =0 ; j <ALL_EDIDS [i].list_size; j++) { +if (strcmp (ALL_EDIDS [i].edid_list[j].name, name) ==0 ) +return edid_from_monitor_edid (&ALL_EDIDS [i].edid_list[j]); + } + } +return NULL ; +}
lib/monitor_edids/monitor_edids_helper.h +1 -0
@@ -34,5 +34,6 @@ void free_chamelium_edid_from_monitor_edid(struct chamelium_edid *edid);struct edid *edid_from_monitor_edid (const monitor_edid *monitor_edid);struct monitor_edid *get_edids_for_connector_type (uint32_t type,size_t *count,bool four_k); +struct edid *get_edid_by_name (char *name);#endif /* TESTS_CHAMELIUM_MONITOR_EDIDS_MONITOR_EDIDS_HELPER_H_ */
Signature · 1 line
2.44.2
PATCH v2 8/39 lib/monitor_edids: Add helper to print all available EDID names
In reply to Louis ChauvetDuring the chamelium v3 configuration, it may be required to know the list of supported EDID names, so add an helper to print them.
--- lib/monitor_edids/monitor_edids_helper.c | 10 ++++++++++ lib/monitor_edids/monitor_edids_helper.h | 2 ++ 2 files changed, 12 insertions(+)
lib/monitor_edids/monitor_edids_helper.c +10 -0
@@ -170,3 +170,13 @@ struct edid *get_edid_by_name(char *name) }return NULL ; } + +void list_edid_names (enum igt_log_level level) +{ +for (int i =0 ; i <ARRAY_SIZE (ALL_EDIDS ); i++) { +for (int j =0 ; j <ALL_EDIDS [i].list_size; j++) { +igt_log (IGT_LOG_DOMAIN , level," - \"%s\"\n" , +ALL_EDIDS [i].edid_list[j].name); + } + } +}
lib/monitor_edids/monitor_edids_helper.h +2 -0
@@ -15,6 +15,7 @@#include <stddef.h> #include <stdbool.h> +#include "igt_core.h" #include "igt_chamelium.h" /* Max Length can be increased as needed, when new EDIDs are added. */
@@ -35,5 +36,6 @@ void free_chamelium_edid_from_monitor_edid(struct chamelium_edid *edid);struct edid *edid_from_monitor_edid (const monitor_edid *monitor_edid);struct monitor_edid *get_edids_for_connector_type (uint32_t type,size_t *count,bool four_k);struct edid *get_edid_by_name (char *name); +void list_edid_names (enum igt_log_level level);#endif /* TESTS_CHAMELIUM_MONITOR_EDIDS_MONITOR_EDIDS_HELPER_H_ */
Signature · 1 line
2.44.2
PATCH v2 9/39 lib/monitor_edids: Fix missing names in some monitor EDID
In reply to Louis ChauvetSome HDMI EDID did not have a good name identifier. Add one to avoid confusion.
--- lib/monitor_edids/hdmi_edids.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/monitor_edids/hdmi_edids.h +3 -3
@@ -241,7 +241,7 @@ monitor_edid HDMI_EDIDS_NON_4K[] = {"33333633493056465320000000fc0044" "454c4c20323430354650570a000000fd" "00384c1e5111000a20202020202000e9" }, - { .name = "`", + { .name = "DEL_DELL_2407WFP_HDMI", .edid ="00ffffffffffff0010ac17a053575930" "0511010380342178eeee91a3544c9926" "0f5054a54b008180a940714fb3000101"
@@ -438,7 +438,7 @@ monitor_edid HDMI_EDIDS_NON_4K[] = {"60350000003200001c011d8018711c16" "20582c2500c48e2100009e0000000000" "0000000000000000000000000000000a" }, - { .name = "", + { .name = "GSM_50294_M3704C_HDMI", .edid ="00ffffffffffff001e6d76c401010101" "2514010380522e78eaac27a355499b25" "10474aa1080081807140614045403140"
@@ -490,7 +490,7 @@ monitor_edid HDMI_EDIDS_NON_4K[] = {"5011000a202020202020000000fc0048" "50205a5232343430770a2020000000ff" "00434e34333132303836580a2020007f" }, - { .name = "", + { .name = "HWP_10582_HP_ZR2440w_HDMI", .edid ="00ffffffffffff0022f0562901010101" "0b170103803420782afc81a4554d9d25" "125054210800d1c081c0814081809500"
Signature · 1 line
2.44.2
PATCH v2 10/39 lib/monitor_edids: Add new EDID for HDMI 4k
In reply to Louis ChauvetAdd EDID for the HDMI screen LG HDR 4K.
--- lib/monitor_edids/hdmi_edids.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
lib/monitor_edids/hdmi_edids.h +17 -1
@@ -49,7 +49,23 @@ monitor_edid HDMI_EDIDS_4K[] = {"5E00A0A0A0295030203500C48F210000" "1EEF5100A0F070198030203500C48F21" "00001E000000000000000000000000A8" }, - + { .name = "4K_GSM_LG_HDR_4K_HDMI", + .edid ="00ffffffffffff001e6d4f77c75f1500" +"0521010380462878ea7ba1ae4f44a926" +"0c5054210800d1c06140454001010101" +"010101010101a0cb0046f0703e802010" +"3500b9882100001a000000fd00283c1e" +"873c000a202020202020000000fc004c" +"472048445220344b0a202020000000ff" +"003330354d414e4a43335a37350a01e4" +"0203427223090707830100004d010304" +"10121f202261605f5e5d6d030c001000" +"b83c20006001020367d85dc401788003" +"e30f0003e2006ae305c000e606050159" +"5952a36600a0f0701f8030203500b988" +"2100001a565e00a0a0a0295030203500" +"b9882100001a023a801871382d40582c" + "4500b9882100001a00000000000000af" }, };monitor_edid HDMI_EDIDS_NON_4K [] = {
Signature · 1 line
2.44.2
PATCH v2 11/39 tests/chamelium: Extract Chamelium v2 tests into a separate directory
In reply to Louis ChauvetIn preparation for Chamelium v3, the Chamelium v2 tests have been moved to their own directory.
The two Chamelium versions have different sets of functionality (audio, MST, CRC computation, etc.). Since most of the tests will need to be rewritten to work with Chamelium v3, it is simpler to create new ones for v3 to avoid breaking the existing tests.
The following complexities necessitate a thorough rework of the existing v2 tests:
- Not all ports are discoverable in v3 (MST ports are not physical ports, but they can have EDID, be plugged, etc.), and they can change over time.
- The v3 is unable to perform CRC computation.
- Not all ports can be plugged at once, which is a feature used by the existing v2 wrapper to set up the Chamelium.
---
tests/chamelium/{ => v2}/kms_chamelium_audio.c | 0
tests/chamelium/{ => v2}/kms_chamelium_color.c | 0
tests/chamelium/{ => v2}/kms_chamelium_edid.c | 0
tests/chamelium/{ => v2}/kms_chamelium_frames.c | 0
tests/chamelium/{ => v2}/kms_chamelium_helper.c | 0
tests/chamelium/{ => v2}/kms_chamelium_helper.h | 0
tests/chamelium/{ => v2}/kms_chamelium_hpd.c | 0
tests/meson.build | 10 +++++-----
8 files changed, 5 insertions(+), 5 deletions(-)tests/chamelium/v2/kms_chamelium_audio.c renamed from tests/chamelium/kms_chamelium_audio.c +0 -0
tests/chamelium/v2/kms_chamelium_color.c renamed from tests/chamelium/kms_chamelium_color.c +0 -0
tests/chamelium/v2/kms_chamelium_edid.c renamed from tests/chamelium/kms_chamelium_edid.c +0 -0
tests/chamelium/v2/kms_chamelium_frames.c renamed from tests/chamelium/kms_chamelium_frames.c +0 -0
tests/chamelium/v2/kms_chamelium_helper.c renamed from tests/chamelium/kms_chamelium_helper.c +0 -0
tests/chamelium/v2/kms_chamelium_helper.h renamed from tests/chamelium/kms_chamelium_helper.h +0 -0
tests/chamelium/v2/kms_chamelium_hpd.c renamed from tests/chamelium/kms_chamelium_hpd.c +0 -0
tests/meson.build +5 -5
@@ -342,11 +342,11 @@ extra_sources = { 'dumb_buffer': ['dumb_buffer.c' ], 'testdisplay': [ 'testdisplay_hotplug.c' ], 'kms_color': [ 'kms_color_helper.c' ], - 'kms_chamelium_audio': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ], + 'kms_chamelium_audio': [ join_paths ('chamelium', 'v2', 'kms_chamelium_helper.c') ], 'kms_chamelium_color': [ 'kms_color_helper.c' ], - 'kms_chamelium_edid': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ], - 'kms_chamelium_frames': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ], - 'kms_chamelium_hpd': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ], + 'kms_chamelium_edid': [ join_paths ('chamelium', 'v2', 'kms_chamelium_helper.c') ], + 'kms_chamelium_frames': [ join_paths ('chamelium', 'v2', 'kms_chamelium_helper.c') ], + 'kms_chamelium_hpd': [ join_paths ('chamelium', 'v2', 'kms_chamelium_helper.c') ], 'kms_dsc': [ join_paths ('intel', 'kms_dsc_helper.c') ], 'kms_psr2_sf': [ join_paths ('intel', 'kms_dsc_helper.c') ], }
@@ -422,7 +422,7 @@ endforeach if chamelium.found() foreach prog : chamelium_progs testexe = executable(prog, - [join_paths('chamelium', prog + '.c')] + extra_sources.get(prog, []), + [join_paths('chamelium', 'v2', prog + '.c')] + extra_sources.get(prog, []), dependencies : test_deps + extra_dependencies.get(prog, []), install_dir : libexecdir, install_rpath : libexecdir_rpathdir,
Signature · 1 line
2.44.2
PATCH v2 12/39 lib/chamelium/v2: Extract chamelium v2 wrapper into its own directory
In reply to Louis ChauvetIn preparation for the Chamelium v3, the support for Chamelium v2 is being extracted into its own directory.
The two Chamelium versions have different sets of functionality (audio, MST, CRC computation, etc.). As the current wrapper is already complex, extracting the v2 part into its own directory allows for the v3 wrapper to be written without breaking any existing tests or complicating the existing code.
The current identified complexities that necessitate a thorough rework of the existing v2 wrapper are:
- Not all ports are discoverable in v3 (MST ports are not physical ports, but they can have EDID, be plugged, etc.), and they can change over time.
- The v3 is unable to perform CRC computation, so many tests must be rewritten or adapted to work.
- Not all ports can be plugged at once, which is a feature used by the existing v2 wrapper to set up the Chamelium.
---
lib/{ => chamelium/v2}/igt_chamelium.c | 2 +-
lib/{ => chamelium/v2}/igt_chamelium.h | 0
lib/{ => chamelium/v2}/igt_chamelium_stream.c | 2 +-
lib/{ => chamelium/v2}/igt_chamelium_stream.h | 0
lib/igt.h | 4 ++--
lib/igt_kms.c | 2 +-
lib/meson.build | 5 ++++-
lib/monitor_edids/monitor_edids_helper.h | 2 +-
tests/chamelium/v2/kms_chamelium_edid.c | 2 +-
tests/kms_feature_discovery.c | 2 +-
10 files changed, 12 insertions(+), 9 deletions(-)lib/chamelium/v2/igt_chamelium.c renamed from lib/igt_chamelium.c +1 -1
@@ -37,7 +37,7 @@#include <pixman.h> #include <cairo.h> -#include "igt_chamelium.h" +#include "chamelium/v2/igt_chamelium.h" #include "igt_core.h" #include "igt_aux.h" #include "igt_edid.h"
lib/chamelium/v2/igt_chamelium.h renamed from lib/igt_chamelium.h +0 -0
lib/chamelium/v2/igt_chamelium_stream.c renamed from lib/igt_chamelium_stream.c +1 -1
@@ -33,7 +33,7 @@#include <sys/types.h> #include <sys/socket.h> -#include "igt_chamelium_stream.h" +#include "chamelium/v2/igt_chamelium_stream.h" #include "igt_core.h" #include "igt_rc.h"
lib/chamelium/v2/igt_chamelium_stream.h renamed from lib/igt_chamelium_stream.h +0 -0
lib/igt.h +2 -2
@@ -45,8 +45,8 @@#ifdef HAVE_CHAMELIUM #include "igt_alsa.h" #include "igt_audio.h" -#include "igt_chamelium.h" -#include "igt_chamelium_stream.h" +#include "chamelium/v2/igt_chamelium.h" +#include "chamelium/v2/igt_chamelium_stream.h" #endif #include "instdone.h" #include "intel_batchbuffer.h"
lib/igt_kms.c +1 -1
@@ -61,7 +61,7 @@#include "igt_sysfs.h" #include "sw_sync.h" #ifdef HAVE_CHAMELIUM -#include "igt_chamelium.h" +#include "chamelium/v2/igt_chamelium.h" #endif /**
lib/meson.build +4 -1
@@ -190,7 +190,10 @@ endif if chamelium.found() lib_deps += chamelium - lib_sources += [ 'igt_chamelium.c', 'igt_chamelium_stream.c' ] + lib_sources += [ + 'chamelium/v2/igt_chamelium.c', + 'chamelium/v2/igt_chamelium_stream.c' + ] lib_sources += 'monitor_edids/monitor_edids_helper.c' endif
lib/monitor_edids/monitor_edids_helper.h +1 -1
@@ -16,7 +16,7 @@#include <stdbool.h> #include "igt_core.h" -#include "igt_chamelium.h" +#include "chamelium/v2/igt_chamelium.h" /* Max Length can be increased as needed, when new EDIDs are added. */ #define EDID_NAME_MAX_LEN 28
tests/chamelium/v2/kms_chamelium_edid.c +1 -1
@@ -41,7 +41,7 @@#include "config.h" #include "igt.h" -#include "igt_chamelium.h" +#include "chamelium/v2/igt_chamelium.h" #include "igt_edid.h" #include "igt_eld.h" #include "igt_vc4.h"
tests/kms_feature_discovery.c +1 -1
@@ -36,7 +36,7 @@#include "igt.h" #ifdef HAVE_CHAMELIUM -#include "igt_chamelium.h" +#include "chamelium/v2/igt_chamelium.h" #endif #include "igt_kms.h" #include "igt_psr.h"
Signature · 1 line
2.44.2
PATCH v2 13/39 lib/chamelium/v2: Modify build options to separate Chamelium v2 and v3
In reply to Louis ChauvetRename the Chamelium option to "chamelium_v2" in preparation for the introduction of the v3 wrapper. Additionally, rename the "HAVE_CHAMELIUM" define to prevent conflicts when v3 is introduced.
--- docs/testplan/meson.build | 4 ++-- lib/igt.h | 2 +- lib/igt_kms.c | 4 ++-- lib/meson.build | 4 ++-- lib/tests/meson.build | 4 ++-- meson.build | 30 +++++++++++++++--------------- meson_options.txt | 4 ++-- tests/kms_color_helper.h | 2 +- tests/kms_feature_discovery.c | 4 ++-- tests/kms_tiled_display.c | 6 +++--- tests/meson.build | 8 ++++---- 11 files changed, 36 insertions(+), 36 deletions(-)
docs/testplan/meson.build +2 -2
@@ -21,8 +21,8 @@ if build_tests build_info += 'Will Check if documentation is in sync with testlist' check_testlist = [ '--check-testlist', '--igt-build-path', build_root ] - if not chamelium.found() - warning('WARNING: Will not check if documentation is in sync for KMS as chamelium is disabled') + if not chamelium_v2.found() + warning('WARNING: Will not check if documentation is in sync for KMS as chamelium v2 is disabled') else kms_check_testlist = check_testlist endif
lib/igt.h +1 -1
@@ -42,7 +42,7 @@#include "igt_sizes.h" #include "igt_stats.h" #include "igt_dsc.h" -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 #include "igt_alsa.h" #include "igt_audio.h" #include "chamelium/v2/igt_chamelium.h"
lib/igt_kms.c +2 -2
@@ -60,7 +60,7 @@#include "igt_rc.h" #include "igt_sysfs.h" #include "sw_sync.h" -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 #include "chamelium/v2/igt_chamelium.h" #endif
@@ -2883,7 +2883,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)if (!resources) goto out; -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 {struct chamelium *chamelium;
lib/meson.build +2 -2
@@ -188,8 +188,8 @@ if alsa.found() lib_sources += 'igt_alsa.c' endif -if chamelium.found() - lib_deps += chamelium +if chamelium_v2.found() + lib_deps += chamelium_v2 lib_sources += [ 'chamelium/v2/igt_chamelium.c', 'chamelium/v2/igt_chamelium_stream.c'
lib/tests/meson.build +2 -2
@@ -34,8 +34,8 @@ lib_fail_tests = [ lib_tests_deps = igt_deps -if chamelium.found() - lib_deps += chamelium +if chamelium_v2.found() + lib_deps += chamelium_v2 lib_tests += 'igt_audio' endif
meson.build +15 -15
@@ -86,7 +86,7 @@ foreach cc_arg : cc_args endif endforeach -build_chamelium = get_option('chamelium') +build_chamelium_v2 = get_option('chamelium_v2') build_docs = get_option('docs') build_tests = not get_option('tests').disabled() build_xe = not get_option('xe_driver').disabled()
@@ -172,28 +172,28 @@ if not xmlrpc.found() and xmlrpc_cmd.found() endif endif -if build_chamelium.enabled() and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) +if build_chamelium_v2.enabled() and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) error('Chamelium build forced and required dependency xmlrpc not found') endif -gsl = dependency('gsl', required : build_chamelium) -alsa = dependency('alsa', required : build_chamelium) -libcurl = dependency('libcurl', required : build_chamelium) +gsl = dependency('gsl', required : build_chamelium_v2) +alsa = dependency('alsa', required : build_chamelium_v2) +libcurl = dependency('libcurl', required : build_chamelium_v2) if xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found() and gsl.found() and alsa.found() and libcurl.found() - config.set('HAVE_CHAMELIUM', 1) - chamelium = declare_dependency(dependencies : [ - xmlrpc, - xmlrpc_util, - xmlrpc_client, - gsl, - alsa, - ]) + config.set('HAVE_CHAMELIUM_V2', 1) + chamelium_v2 = declare_dependency(dependencies : [ + xmlrpc, + xmlrpc_util, + xmlrpc_client, + gsl, + alsa, + ]) else - chamelium = disabler() + chamelium_v2 = disabler() endif -build_info += 'Build Chamelium test: @0@'.format(chamelium.found()) +build_info += 'Build Chamelium v2 test: @0@'.format(chamelium_v2.found()) pthreads = dependency('threads') math = cc.find_library('m')
meson_options.txt +2 -2
@@ -8,9 +8,9 @@ option('overlay_backends', choices : [ 'auto', 'x', 'xv' ], description : 'Overlay backends to enable') -option('chamelium', +option('chamelium_v2', type : 'feature', - description : 'Build Chamelium test') + description : 'Build Chamelium v2 test') option('valgrind', type : 'feature',
tests/kms_color_helper.h +1 -1
@@ -57,7 +57,7 @@ typedef struct {uint32_t color_depth;uint64_t degamma_lut_size;uint64_t gamma_lut_size; -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 struct chamelium *chamelium;struct chamelium_port **ports;int port_count;
tests/kms_feature_discovery.c +2 -2
@@ -35,7 +35,7 @@*/ #include "igt.h" -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 #include "chamelium/v2/igt_chamelium.h" #endif #include "igt_kms.h"
@@ -140,7 +140,7 @@ igt_main { } } -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 igt_describe ("Make sure that Chamelium is configured and reachable." ); igt_subtest("chamelium") { struct chamelium *chamelium =
tests/kms_tiled_display.c +3 -3
@@ -82,7 +82,7 @@ typedef struct {struct timeval first_ts;int linetime_us; -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 struct chamelium *chamelium;struct chamelium_port **ports;int port_count;
@@ -394,7 +394,7 @@ static bool got_all_page_flips(data_t *data)return true; } -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 static void test_with_chamelium (data_t *data) {int i, count =0 ;
@@ -607,7 +607,7 @@ igt_maintest_cleanup (&data); } -#ifdef HAVE_CHAMELIUM +#ifdef HAVE_CHAMELIUM_V2 igt_describe ("Make sure the Tiled CRTCs are synchronized and we get " "page flips for all tiled CRTCs in one vblank (executes on chamelium)." ); igt_subtest_f("basic-test-pattern-with-chamelium") {
tests/meson.build +4 -4
@@ -316,7 +316,7 @@ intel_xe_progs = [ 'xe_sysfs_scheduler', ] -chamelium_progs = [ +chamelium_v2_progs = [ 'kms_chamelium_audio', 'kms_chamelium_color', 'kms_chamelium_edid',
@@ -419,8 +419,8 @@ foreach prog : intel_progs endif endforeach -if chamelium.found() - foreach prog : chamelium_progs +if chamelium_v2.found() + foreach prog : chamelium_v2_progs testexe = executable(prog, [join_paths('chamelium', 'v2', prog + '.c')] + extra_sources.get(prog, []), dependencies : test_deps + extra_dependencies.get(prog, []),
@@ -438,7 +438,7 @@ if chamelium.found() output : name + '.testlist') endif endforeach - test_deps += chamelium + test_deps += chamelium_v2 endif subdir('amdgpu')
Signature · 1 line
2.44.2
PATCH v2 14/39 lib/chamelium/v3: Introduce the foundation for the Chamelium v3 wrapper
In reply to Louis ChauvetAdds a build option to enable building the Chamelium v3 wrapper.
--- lib/chamelium/v3/igt_chamelium.c | 9 +++++++++ lib/chamelium/v3/igt_chamelium.h | 8 ++++++++ lib/igt_kms.c | 8 ++++++++ lib/meson.build | 7 +++++++ lib/tests/meson.build | 4 ++++ meson.build | 17 ++++++++++++++++- meson_options.txt | 4 ++++ tests/meson.build | 25 +++++++++++++++++++++++++ 8 files changed, 81 insertions(+), 1 deletion(-)
lib/chamelium/v3/igt_chamelium.c new file +9 -0
@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <igt_core.h> +#include "igt_chamelium.h" + +void chamelium_v3_init (void ) +{ +igt_info ("Using chamelium v3\n" ); +}
lib/chamelium/v3/igt_chamelium.h new file +8 -0
@@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef V3_IGT_CHAMELIUM_H +#define V3_IGT_CHAMELIUM_H + +void chamelium_v3_init (void ); + +#endif //V3_IGT_CHAMELIUM_H
lib/igt_kms.c +8 -0
@@ -2883,7 +2883,14 @@ void igt_display_require(igt_display_t *display, int drm_fd)if (!resources) goto out; +/* +* FIXME: Dirty hack to avoid those lines when chamelium v3 is used +* +* Must be replaced with a configuration file information, so the end user can choose if the +* chamelium must be connected or not. +*/ #ifdef HAVE_CHAMELIUM_V2 +#ifndef HAVE_CHAMELIUM_V3 { struct chamelium *chamelium;
@@ -2898,6 +2905,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)chamelium_deinit_rpc_only (chamelium); } } +#endif #endif igt_require_f(resources->count_crtcs <= IGT_MAX_PIPES,
lib/meson.build +7 -0
@@ -197,6 +197,13 @@ if chamelium_v2.found() lib_sources += 'monitor_edids/monitor_edids_helper.c' endif +if chamelium_v3.found() + lib_deps += chamelium_v3 + lib_sources += [ + 'chamelium/v3/igt_chamelium.c', + ] +endif + if libprocps.found() lib_deps += libprocps else
lib/tests/meson.build +4 -0
@@ -39,6 +39,10 @@ if chamelium_v2.found() lib_tests += 'igt_audio' endif +if chamelium_v3.found() + lib_deps += chamelium_v3 +endif + foreach lib_test : lib_tests exec = executable(lib_test, lib_test + '.c', install : false, dependencies : igt_deps)
meson.build +16 -1
@@ -87,6 +87,7 @@ foreach cc_arg : cc_args endforeach build_chamelium_v2 = get_option('chamelium_v2') +build_chamelium_v3 = get_option('chamelium_v3') build_docs = get_option('docs') build_tests = not get_option('tests').disabled() build_xe = not get_option('xe_driver').disabled()
@@ -172,7 +173,7 @@ if not xmlrpc.found() and xmlrpc_cmd.found() endif endif -if build_chamelium_v2.enabled() and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) +if (build_chamelium_v2.enabled() or build_chamelium_v3.enabled()) and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) error('Chamelium build forced and required dependency xmlrpc not found') endif
@@ -195,6 +196,20 @@ endif build_info += 'Build Chamelium v2 test: @0@'.format(chamelium_v2.found()) + +if xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found() and libcurl.found() + config.set('HAVE_CHAMELIUM_V3', 1) + chamelium_v3 = declare_dependency(dependencies : [ + xmlrpc, + xmlrpc_util, + xmlrpc_client, + gsl, + alsa, + ]) +else + chamelium_v3 = disabler() +endif + pthreads = dependency('threads') math = cc.find_library('m') realtime = cc.find_library('rt')
meson_options.txt +4 -0
@@ -12,6 +12,10 @@ option('chamelium_v2', type : 'feature', description : 'Build Chamelium v2 test') +option('chamelium_v3', + type : 'feature', + description : 'Build Chamelium v3 tests') + option('valgrind', type : 'feature', description : 'Build with support for valgrind annotations')
tests/meson.build +25 -0
@@ -324,6 +324,9 @@ chamelium_v2_progs = [ 'kms_chamelium_hpd', ] +chamelium_v3_progs = [ +] + test_deps = [ igt_deps ] if libdrm_nouveau.found()
@@ -441,6 +444,28 @@ if chamelium_v2.found() test_deps += chamelium_v2 endif +if chamelium_v3.found() + foreach prog : chamelium_v3_progs + testexe = executable(prog, + [join_paths('chamelium', 'v3', prog + '.c')], + dependencies : test_deps, + install_dir : libexecdir, + install_rpath : libexecdir_rpathdir, + install : true) + test_list += prog + test_executables += testexe + name = prog.split('/').get(-1) + if not meson.is_cross_build() + testlist_files += custom_target(name + '.testlist', + build_by_default : true, + command : [testexe, '--show-testlist'], + capture : true, + output : name + '.testlist') + endif + endforeach + test_deps += chamelium_v3 +endif + subdir('amdgpu') subdir('msm')
Signature · 1 line
2.44.2
Re: [PATCH i-g-t v2 14/39] lib/chamelium/v3: Introduce the foundation for the Chamelium v3 wrapper
Hi Louis,
Quoted 75 lines · Louis Chauvet
Adds a build option to enable building the Chamelium v3 wrapper.
Signed-off-by Louis Chauvet <[email protected]>--- lib/chamelium/v3/igt_chamelium.c | 9 +++++++++ lib/chamelium/v3/igt_chamelium.h | 8 ++++++++ lib/igt_kms.c | 8 ++++++++ lib/meson.build | 7 +++++++ lib/tests/meson.build | 4 ++++ meson.build | 17 ++++++++++++++++- meson_options.txt | 4 ++++ tests/meson.build | 25 +++++++++++++++++++++++++ 8 files changed, 81 insertions(+), 1 deletion(-)lib/chamelium/v3/igt_chamelium.c new file +9
-0@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <igt_core.h> +#include "igt_chamelium.h" + +void chamelium_v3_init (void ) +{ +igt_info ("Using chamelium v3\n" ); +}lib/chamelium/v3/igt_chamelium.h new file +8
-0@@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef V3_IGT_CHAMELIUM_H +#define V3_IGT_CHAMELIUM_H + +void chamelium_v3_init (void ); + +#endif //V3_IGT_CHAMELIUM_H lib/igt_kms.c +8
-0@@ -2883,7 +2883,14 @@ void igt_display_require(igt_display_t *display, int drm_fd)if (!resources) goto out; +/* +* FIXME: Dirty hack to avoid those lines when chamelium v3 is used +* +* Must be replaced with a configuration file information, so the end user can choose if the +* chamelium must be connected or not. +*/ #ifdef HAVE_CHAMELIUM_V2 +#ifndef HAVE_CHAMELIUM_V3 { struct chamelium *chamelium;@@ -2898,6 +2905,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)chamelium_deinit_rpc_only (chamelium); } } +#endif #endif igt_require_f(resources->count_crtcs <= IGT_MAX_PIPES,lib/meson.build +0
-0
lib/meson.build if chamelium_v2.found() · line 204
Quoted 8 lines
lib/meson.build +5
-0@@ -197,6 +197,13 @@ if chamelium_v2.found() lib_sources += 'monitor_edids/monitor_edids_helper.c' endif +if chamelium_v3.found() + lib_deps += chamelium_v3 + lib_sources += [ + 'chamelium/v3/igt_chamelium.c', + ]
We need to add "lib_sources += 'monitor_edids/monitor_edids_helper.c'" to fix undefined reference to error.
Quoted 44 lines
lib/meson.build +2
-0+endif + if libprocps.found() lib_deps += libprocps elselib/tests/meson.build +4
-0@@ -39,6 +39,10 @@ if chamelium_v2.found() lib_tests += 'igt_audio' endif +if chamelium_v3.found() + lib_deps += chamelium_v3 +endif + foreach lib_test : lib_tests exec = executable(lib_test, lib_test + '.c', install : false, dependencies : igt_deps)meson.build +2
-1@@ -87,6 +87,7 @@ foreach cc_arg : cc_args endforeach build_chamelium_v2 = get_option('chamelium_v2') +build_chamelium_v3 = get_option('chamelium_v3') build_docs = get_option('docs') build_tests = not get_option('tests').disabled() build_xe = not get_option('xe_driver').disabled()@@ -172,7 +173,7 @@ if not xmlrpc.found() and xmlrpc_cmd.found() endif endif -if build_chamelium_v2.enabled() and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) +if (build_chamelium_v2.enabled() or build_chamelium_v3.enabled()) and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) error('Chamelium build forced and required dependency xmlrpc not found') endif@@ -195,6 +196,20 @@ endif build_info += 'Build Chamelium v2 test: @0@'.format(chamelium_v2.found())
meson.build endif · line 207
Quoted 10 lines
meson.build +9
-0+ +if xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found() and libcurl.found() + config.set('HAVE_CHAMELIUM_V3', 1) + chamelium_v3 = declare_dependency(dependencies : [ + xmlrpc, + xmlrpc_util, + xmlrpc_client, + gsl, + alsa,
gsl and alsa can be removed for v3?
Quoted 57 lines
meson.build +5
-0+ ]) +else + chamelium_v3 = disabler() +endif + pthreads = dependency('threads') math = cc.find_library('m') realtime = cc.find_library('rt')meson_options.txt +4
-0@@ -12,6 +12,10 @@ option('chamelium_v2', type : 'feature', description : 'Build Chamelium v2 test') +option('chamelium_v3', + type : 'feature', + description : 'Build Chamelium v3 tests') + option('valgrind', type : 'feature', description : 'Build with support for valgrind annotations')tests/meson.build +18
-0@@ -324,6 +324,9 @@ chamelium_v2_progs = [ 'kms_chamelium_hpd', ] +chamelium_v3_progs = [ +] + test_deps = [ igt_deps ] if libdrm_nouveau.found()@@ -441,6 +444,28 @@ if chamelium_v2.found() test_deps += chamelium_v2 endif +if chamelium_v3.found() + foreach prog : chamelium_v3_progs + testexe = executable(prog, + [join_paths('chamelium', 'v3', prog + '.c')], + dependencies : test_deps, + install_dir : libexecdir, + install_rpath : libexecdir_rpathdir, + install : true) + test_list += prog + test_executables += testexe + name = prog.split('/').get(-1) + if not meson.is_cross_build() + testlist_files += custom_target(name + '.testlist', + build_by_default : true, + command : [testexe, '--show-testlist'],
tests/meson.build if chamelium_v2.found() · line 471
Quoted 10 lines
tests/meson.build +7
-0+ capture : true, + output : name + '.testlist') + endif + endforeach + test_deps += chamelium_v3 +endif + subdir('amdgpu') subdir('msm')
Regards,
Vignesh
Re: [PATCH i-g-t v2 14/39] lib/chamelium/v3: Introduce the foundation for the Chamelium v3 wrapper
Quoted 81 lines · Vignesh Raman
Hi Louis,
Quoted 78 lines · Louis Chauvet
Adds a build option to enable building the Chamelium v3 wrapper.
Signed-off-by Louis Chauvet <[email protected]>--- lib/chamelium/v3/igt_chamelium.c | 9 +++++++++ lib/chamelium/v3/igt_chamelium.h | 8 ++++++++ lib/igt_kms.c | 8 ++++++++ lib/meson.build | 7 +++++++ lib/tests/meson.build | 4 ++++ meson.build | 17 ++++++++++++++++- meson_options.txt | 4 ++++ tests/meson.build | 25 +++++++++++++++++++++++++ 8 files changed, 81 insertions(+), 1 deletion(-)lib/chamelium/v3/igt_chamelium.c new file +9
-0@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <igt_core.h> +#include "igt_chamelium.h" + +void chamelium_v3_init (void ) +{ +igt_info ("Using chamelium v3\n" ); +}lib/chamelium/v3/igt_chamelium.h new file +8
-0@@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef V3_IGT_CHAMELIUM_H +#define V3_IGT_CHAMELIUM_H + +void chamelium_v3_init (void ); + +#endif //V3_IGT_CHAMELIUM_H lib/igt_kms.c +8
-0@@ -2883,7 +2883,14 @@ void igt_display_require(igt_display_t *display, int drm_fd)if (!resources) goto out; +/* +* FIXME: Dirty hack to avoid those lines when chamelium v3 is used +* +* Must be replaced with a configuration file information, so the end user can choose if the +* chamelium must be connected or not. +*/ #ifdef HAVE_CHAMELIUM_V2 +#ifndef HAVE_CHAMELIUM_V3 { struct chamelium *chamelium;@@ -2898,6 +2905,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)chamelium_deinit_rpc_only (chamelium); } } +#endif #endif igt_require_f(resources->count_crtcs <= IGT_MAX_PIPES,lib/meson.build +0
-0@@ -197,6 +197,13 @@ if chamelium_v2.found() lib_sources += 'monitor_edids/monitor_edids_helper.c' endif
Quoted 8 lines
lib/meson.build if chamelium_v2.found() · line 204
Quoted 5 lines
lib/meson.build +5
-0+if chamelium_v3.found() + lib_deps += chamelium_v3 + lib_sources += [ + 'chamelium/v3/igt_chamelium.c', + ]We need to add "
lib_sources+= 'monitor_edids/monitor_edids_helper.c'" to fix undefined reference to error.
Will be fixed for v2.
Quoted 45 lines
Quoted 45 lines
lib/meson.build +2
-0+endif + if libprocps.found() lib_deps += libprocps elselib/tests/meson.build +4
-0@@ -39,6 +39,10 @@ if chamelium_v2.found() lib_tests += 'igt_audio' endif +if chamelium_v3.found() + lib_deps += chamelium_v3 +endif + foreach lib_test : lib_tests exec = executable(lib_test, lib_test + '.c', install : false, dependencies : igt_deps)meson.build +2
-1@@ -87,6 +87,7 @@ foreach cc_arg : cc_args endforeach build_chamelium_v2 = get_option('chamelium_v2') +build_chamelium_v3 = get_option('chamelium_v3') build_docs = get_option('docs') build_tests = not get_option('tests').disabled() build_xe = not get_option('xe_driver').disabled()@@ -172,7 +173,7 @@ if not xmlrpc.found() and xmlrpc_cmd.found() endif endif -if build_chamelium_v2.enabled() and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) +if (build_chamelium_v2.enabled() or build_chamelium_v3.enabled()) and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) error('Chamelium build forced and required dependency xmlrpc not found') endif@@ -195,6 +196,20 @@ endif build_info += 'Build Chamelium v2 test: @0@'.format(chamelium_v2.found())
Quoted 11 lines
meson.build endif · line 207
Quoted 9 lines
meson.build +9
-0+ +if xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found() and libcurl.found() + config.set('HAVE_CHAMELIUM_V3', 1) + chamelium_v3 = declare_dependency(dependencies : [ + xmlrpc, + xmlrpc_util, + xmlrpc_client, + gsl, + alsa,gsl and alsa can be removed for v3?
Yes, I missed it, thanks!
Quoted 70 lines
Quoted 57 lines
meson.build +5
-0+ ]) +else + chamelium_v3 = disabler() +endif + pthreads = dependency('threads') math = cc.find_library('m') realtime = cc.find_library('rt')meson_options.txt +4
-0@@ -12,6 +12,10 @@ option('chamelium_v2', type : 'feature', description : 'Build Chamelium v2 test') +option('chamelium_v3', + type : 'feature', + description : 'Build Chamelium v3 tests') + option('valgrind', type : 'feature', description : 'Build with support for valgrind annotations')tests/meson.build +18
-0@@ -324,6 +324,9 @@ chamelium_v2_progs = [ 'kms_chamelium_hpd', ] +chamelium_v3_progs = [ +] + test_deps = [ igt_deps ] if libdrm_nouveau.found()@@ -441,6 +444,28 @@ if chamelium_v2.found() test_deps += chamelium_v2 endif +if chamelium_v3.found() + foreach prog : chamelium_v3_progs + testexe = executable(prog, + [join_paths('chamelium', 'v3', prog + '.c')], + dependencies : test_deps, + install_dir : libexecdir, + install_rpath : libexecdir_rpathdir, + install : true) + test_list += prog + test_executables += testexe + name = prog.split('/').get(-1) + if not meson.is_cross_build() + testlist_files += custom_target(name + '.testlist', + build_by_default : true, + command : [testexe, '--show-testlist'],tests/meson.build if chamelium_v2.found() · line 471
Quoted 10 lines
tests/meson.build +7
-0+ capture : true, + output : name + '.testlist') + endif + endforeach + test_deps += chamelium_v3 +endif + subdir('amdgpu') subdir('msm')Regards,
Vignesh
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 15/39 lib/chamelium/v3: Introduce initialization and cleanup of Chamelium-related structures
In reply to Louis ChauvetIn preparation for utilizing the Chamelium in tests, this commit introduces a few helper functions to read the Chamelium configuration from a file and initialize RPC-related structures.
--- lib/chamelium/v3/igt_chamelium.c | 148 ++++++++++++++++++++++++++++++++++++++- lib/chamelium/v3/igt_chamelium.h | 39 ++++++++++- 2 files changed, 183 insertions(+), 4 deletions(-)
lib/chamelium/v3/igt_chamelium.c +145 -3
@@ -1,9 +1,151 @@// SPDX-License-Identifier: GPL-2.0 -#include <igt_core.h> +#include <xmlrpc-c/base.h> +#include <xmlrpc-c/client.h> +#include "igt_chamelium.h" +#include "igt_core.h" +#include "igt_rc.h" + +#define CHAMELIUM_CONFIG_SECTION "Chameliumv3" +#define CHAMELIUM_CONFIG_URL "URL" + +struct igt_chamelium_v3 { +xmlrpc_env env; +xmlrpc_client *client; +char *url; + +struct igt_list_head port_mapping; +}; + +/** +* chamelium_v3_port_mapping_alloc - Allocate a port mapping with some default values +* +* @port_mapping: port mapping to free. The caller must remove the element from the list. +*/ +static struct chamelium_v3_port_mapping *chamelium_v3_port_mapping_alloc (void ) +{ +struct chamelium_v3_port_mapping *port_mapping =malloc (sizeof (*port_mapping)); + +igt_assert (port_mapping); + port_mapping->connector_name =NULL ; + port_mapping->mst_path =NULL ; + port_mapping->port_id =0 ; + port_mapping->parent_id =0 ; + port_mapping->is_children = false; +return port_mapping; +} -void chamelium_v3_init (void ) +/** +* chamelium_v3_port_mapping_free - Free memory assiciated with a port mapping +* +* @port_mapping: port mapping to free. The caller must remove the element from the list. +*/ +static void chamelium_v3_port_mapping_free (struct chamelium_v3_port_mapping *port_mapping) { -igt_info ("Using chamelium v3\n" ); +if (port_mapping->connector_name) +free (port_mapping->connector_name); +if (port_mapping->mst_path) +free (port_mapping->mst_path); +free (port_mapping); } + +/** +* chamelium_v3_init() - Initialize the RPC connexion with a chamelium +* +* @url: URL to connect to the chamelium +* +* Returns a igt_chamelium_v3 pointer, which must be freed by chamelium_v3_uninit. +*/ +struct igt_chamelium_v3 *chamelium_v3_init (char *url) +{ +struct igt_chamelium_v3 *chamelium =malloc (sizeof (struct igt_chamelium_v3 )); +struct xmlrpc_clientparms clientparms; +struct xmlrpc_curl_xportparms curlparms; + +if (!chamelium) +return NULL ; + +memset (chamelium,0 ,sizeof (*chamelium)); +memset (&clientparms,0 ,sizeof (clientparms)); +memset (&curlparms,0 ,sizeof (curlparms)); + +/* curl's timeout is in milliseconds */ + curlparms.timeout =10 *1000 ; + + clientparms.transport ="curl" ; + clientparms.transportparmsP = &curlparms; + clientparms.transportparm_size =XMLRPC_CXPSIZE (timeout); + +/* Setup the libxmlrpc context */ +xmlrpc_env_init (&chamelium->env); +xmlrpc_client_setup_global_const (&chamelium->env); +xmlrpc_client_create (&chamelium->env,XMLRPC_CLIENT_NO_FLAGS ,PACKAGE , +PACKAGE_VERSION , &clientparms,0 , &chamelium->client); +if (chamelium->env.fault_occurred) { +igt_debug ("Failed to init xmlrpc: %s\n" , + chamelium->env.fault_string); + goto error; + } + + chamelium->url =strdup (url); +IGT_INIT_LIST_HEAD (&chamelium->port_mapping); + +return chamelium; +error: +chamelium_v3_uninit (chamelium); +return NULL ; +} + +/** +* chamelium_v3_init_from_config() - Initialize the RPC connexion with a chamelium from the config +* file +* +* Returns a igt_chamelium_v3 pointer, which must be freed by chamelium_v3_uninit. +*/ +struct igt_chamelium_v3 *chamelium_v3_init_from_config (void ) +{ +struct igt_chamelium_v3 *chamelium; +GError *error =NULL ; +char *url; + +if (!igt_key_file) { +igt_debug ("No configuration file available for chamelium\n" ); +return NULL ; + } + + url =g_key_file_get_string (igt_key_file,CHAMELIUM_CONFIG_SECTION ,CHAMELIUM_CONFIG_URL , + &error); +if (!url) { +igt_debug ("Couldn't read chamelium URL from config file: %s\n" , error->message); +return false; + } + + chamelium =chamelium_v3_init (url); +free (url); +return chamelium; +} + +/** +* chamelium_v3_uninit() - Free the resources used by a chamelium +* +* @chamelium: The Chamelium instance to free +* +* Frees the resources used by a connection to the chamelium that was set up +* with chamelium_rpc_init(). +*/ +void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium) +{ +struct chamelium_v3_port_mapping *port_mapping, *tmp_port_mapping; + +/* Destroy any mapping we created to make sure we don't leak them */ +igt_list_for_each_entry_safe (port_mapping, tmp_port_mapping, &chamelium->port_mapping, + link) { +chamelium_v3_port_mapping_free (port_mapping); + } +xmlrpc_client_destroy (chamelium->client); +xmlrpc_env_clean (&chamelium->env); +free (chamelium->url); +free (chamelium); +} +
lib/chamelium/v3/igt_chamelium.h +38 -1
@@ -3,6 +3,43 @@#ifndef V3_IGT_CHAMELIUM_H #define V3_IGT_CHAMELIUM_H -void chamelium_v3_init (void ); +#include <stdint.h> + +#include "igt_list.h" + +struct igt_chamelium_v3 ; +typedef uint32_t chamelium_v3_port_id ; + +/** struct chamelium_v3_port_mapping - Represent a mapping between a DRM connector and a port on +* the chamelium +* +* @port_id: Chamelium port ID. +* @connector_name: DRM connector name, used to identify the connector in DRM, mutually exclusive +* with @mst_path +* @mst_path: MST path property, used to identify the connector in DRM, mutually exclusive with +* @mst_path +* @is_children: Used to indicate that this chamelium port is a children and can't be plugged alone +* @parent_id: Used when @is_children is true to point to the correct parent in chamelium +* @link: Linked list structure +*/ +struct chamelium_v3_port_mapping { +chamelium_v3_port_id port_id; + +/* For normal DRM connector */ +char *connector_name; + +/* For MST connector */ +char *mst_path; +bool is_children; +chamelium_v3_port_id parent_id; + +/* Implementation details */ +struct igt_list_head link; +}; + +struct igt_chamelium_v3 *chamelium_v3_init (char *url); +struct igt_chamelium_v3 *chamelium_v3_init_from_config (void ); + +void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium);#endif //V3_IGT_CHAMELIUM_H
Signature · 1 line
2.44.2
PATCH v2 16/39 lib/chamelium/v3: Add method to discover Chamelium ports
In reply to Louis ChauvetSince Chamelium v3 ports can change (recently added MST ports, for example), they need to be discovered to prevent using an incorrect port.
This commit introduces the RPC calls GetSupportedPorts, IsMst, and GetChildren to list all ports, check if a port is MST-capable, and fetch the child ports of MST ports, respectively.
--- lib/chamelium/v3/igt_chamelium.c | 133 +++++++++++++++++++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 6 ++ 2 files changed, 139 insertions(+)
lib/chamelium/v3/igt_chamelium.c +133 -0
@@ -149,3 +149,136 @@ void chamelium_v3_uninit(struct igt_chamelium_v3 *chamelium)free (chamelium); } +/** +* __chamelium_rpc - Call a remote function on the chamelium +* +* @chamelium: Chamelium to call the function on +* @method_name: RPC endpoint name +* @format_str: RPC parameters description +* @...: RPC parameters +* +* Returns a xmlrpc_value that contains the call result. +*/ +static xmlrpc_value *__chamelium_rpc (struct igt_chamelium_v3 *chamelium, +const char *method_name, +const char *format_str, + ...) +{ +xmlrpc_value *res; +va_list va_args; + +if (chamelium->env.fault_occurred) { +xmlrpc_env_clean (&chamelium->env); +xmlrpc_env_init (&chamelium->env); + } +va_start (va_args, format_str); +xmlrpc_client_call2f_va (&chamelium->env, chamelium->client, + chamelium->url, method_name, format_str, &res, + va_args); +va_end (va_args); +igt_assert_f (!chamelium->env.fault_occurred, +"Chamelium RPC call[%s] failed: %s\n" , method_name, + chamelium->env.fault_string); +return res; +} + +/* +* For the RPC calls, please refer to the python code [1] for documentation. +* +* [1]: https://chromium.googlesource.com/chromiumos/platform/chameleon/+/refs/heads/main/v3/chameleond/v3.py +*/ + +/** +* chamelium_v3_get_supported_ports - Get the list of ports on the chamelium +* +* @chamelium: Chamelium to get the ports from +* @port_ids: Out pointer for the list of port ids +* +* Returns the number of element stored in @port_ids. The caller must free this pointer when not +* used anymore. +*/ +int chamelium_v3_get_supported_ports (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id **port_ids) +{ +xmlrpc_value *res, *res_port; +int port_count, i; + +igt_assert (port_ids); + +igt_debug ("RPC GetSupportedPorts()\n" ); + res =__chamelium_rpc (chamelium,"GetSupportedPorts" ,"()" ); + + port_count =xmlrpc_array_size (&chamelium->env, res); + *port_ids =calloc (port_count,sizeof (**port_ids)); + +for (i =0 ; i < port_count; i++) { +xmlrpc_array_read_item (&chamelium->env, res, i, &res_port); +xmlrpc_read_int (&chamelium->env, res_port, (int *)&(*port_ids)[i]); +xmlrpc_DECREF (res_port); + } +xmlrpc_DECREF (res); + +return port_count; +} + +/** +* chamelium_v3_get_supported_ports - Get the list of children port for a specific port on the +* chamelium +* +* @chamelium: Chamelium to get the ports from +* @port_id: Parent port id to get the children port from +* @port_ids: Out pointer for the list of port ids +* +* MST ports on the chamelium have children ports that can be plugged independently, but are always +* connected with a parent connector. +* +* Returns the number of element stored in @port_ids. The caller must free this pointer when not +* used anymore. +*/ +int chamelium_v3_get_children (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id, +chamelium_v3_port_id **port_ids) +{ +xmlrpc_value *res, *res_port; +int port_count, i; + +igt_debug ("RPC GetChildren(%d)\n" , port_id); + res =__chamelium_rpc (chamelium,"GetChildren" ,"(i)" , port_id); + + port_count =xmlrpc_array_size (&chamelium->env, res); + *port_ids =calloc (port_count,sizeof (**port_ids)); + +for (i =0 ; i < port_count; i++) { +xmlrpc_array_read_item (&chamelium->env, res, i, &res_port); +xmlrpc_read_int (&chamelium->env, res_port, (int *)&(*port_ids)[i]); +xmlrpc_DECREF (res_port); + } +xmlrpc_DECREF (res); + +return port_count; +} + +/** +* chamelium_v3_is_mst - Get the MST support for a specific port +* +* @chamelium: Chamelium to get the ports from +* @port_id: Port to get the support from +* +* Not all ports on the chamelium support MST. This functions allows checking if a specific port +* supports MST. +* +* Returns true if the @port_id supports MST. +*/ +bool chamelium_v3_is_mst (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id) +{ +xmlrpc_value *res; +xmlrpc_bool is_mst; + +igt_debug ("RPC IsMst(%d)\n" , port_id); + res =__chamelium_rpc (chamelium,"IsMst" ,"(i)" , port_id); + +xmlrpc_read_bool (&chamelium->env, res, &is_mst); + +xmlrpc_DECREF (res); + +return is_mst; +}
lib/chamelium/v3/igt_chamelium.h +6 -0
@@ -42,4 +42,10 @@ struct igt_chamelium_v3 *chamelium_v3_init_from_config(void);void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium); +int chamelium_v3_get_supported_ports (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id **port_ids); +int chamelium_v3_get_children (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id, +chamelium_v3_port_id **port_ids); +bool chamelium_v3_is_mst (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id); +#endif //V3_IGT_CHAMELIUM_H
Signature · 1 line
2.44.2
PATCH v2 17/39 lib/chamelium/v3: Implement method to retrieve Chamelium port names
In reply to Louis ChauvetChamelium ports have descriptive names associated with them. This commit introduces an RPC call to fetch these names, facilitating easier debugging and better understanding of the port configuration.
--- lib/chamelium/v3/igt_chamelium.c | 25 +++++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 1 + 2 files changed, 26 insertions(+)
lib/chamelium/v3/igt_chamelium.c +25 -0
@@ -282,3 +282,28 @@ bool chamelium_v3_is_mst(struct igt_chamelium_v3 *chamelium, chamelium_v3_port_ireturn is_mst; } + +/** +* chamelium_v3_get_port_name - Get the port name from its id +* +* @chamelium: Chamelium to get the ports from +* @port_id: Port to get the name +* +* Returns a string containing the port name for @port_id. The caller must free this pointer when +* not used anymore. +*/ +char *chamelium_v3_get_port_name (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id) +{ +xmlrpc_value *res; +char *port_name; + +igt_debug ("RPC GetPortName(%d)\n" , port_id); + res =__chamelium_rpc (chamelium,"GetPortName" ,"(i)" , port_id); + +xmlrpc_read_string (&chamelium->env, res, (const char **)&port_name); + +xmlrpc_DECREF (res); + +return port_name; +}
lib/chamelium/v3/igt_chamelium.h +1 -0
@@ -47,5 +47,6 @@ int chamelium_v3_get_supported_ports(struct igt_chamelium_v3 *chamelium,int chamelium_v3_get_children (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id,chamelium_v3_port_id **port_ids);bool chamelium_v3_is_mst (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id); +char *chamelium_v3_get_port_name (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id);#endif //V3_IGT_CHAMELIUM_H
Signature · 1 line
2.44.2
PATCH v2 18/39 tests/chamelium/v3: Implement a basic Chamelium v3 accessibility test
In reply to Louis ChauvetUtilizing the RPC calls introduced earlier, this commit adds a simple test to verify if the Chamelium v3 device is accessible.
--- tests/chamelium/v3/kms_chamelium_v3_basic.c | 30 +++++++++++++++++++++++++++++ tests/meson.build | 1 + 2 files changed, 31 insertions(+)
tests/chamelium/v3/kms_chamelium_v3_basic.c new file +30 -0
@@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT + +#include <igt.h> +#include "chamelium/v3/igt_chamelium.h" + +igt_main +{ +struct igt_chamelium_v3 *chamelium; + +igt_describe ("Test if the chamelium can list all the ports." ); + igt_subtest("chamelium-list-ports") { +chamelium_v3_port_id *ports; +int port_count; + + chamelium =chamelium_v3_init_from_config (); + + port_count =chamelium_v3_get_supported_ports (chamelium, &ports); + +for (int i =0 ; i < port_count; i++) { +char *name =chamelium_v3_get_port_name (chamelium, ports[i]); + +igt_info ("Port %d: name: %s\n" , ports[i], name); +free (name); + } + +free (ports); + +chamelium_v3_uninit (chamelium); + } +}
tests/meson.build +1 -0
@@ -325,6 +325,7 @@ chamelium_v2_progs = [ ] chamelium_v3_progs = [ + 'kms_chamelium_v3_basic', ] test_deps = [ igt_deps ]
Signature · 1 line
2.44.2
PATCH v2 19/39 lib/chamelium/v3: Implement Chamelium reinitialization via Reset RPC call
In reply to Louis ChauvetIntroduce the Reset RPC function to reinitialize the Chamelium, ensuring it returns to a known state. This feature is particularly useful for testing and debugging purposes.
--- lib/chamelium/v3/igt_chamelium.c | 16 ++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 1 + 2 files changed, 17 insertions(+)
lib/chamelium/v3/igt_chamelium.c +16 -0
@@ -188,6 +188,22 @@ static xmlrpc_value *__chamelium_rpc(struct igt_chamelium_v3 *chamelium,* [1]: https://chromium.googlesource.com/chromiumos/platform/chameleon/+/refs/heads/main/v3/chameleond/v3.py */ +/** +* chamelium_v3_reset - Reset the chamelium +* +* @chamelium: Chamelium to reset +* +* Reset the chamelium to a know state (no plugged ports, no EDID applied...). +* +* Note: The current chamelium firmware does not reset scheduled hot plug, this may cause issue in +* some situations. +*/ +void chamelium_v3_reset (struct igt_chamelium_v3 *chamelium) +{ +igt_debug ("RPC Reset()\n" ); +xmlrpc_DECREF (__chamelium_rpc (chamelium,"Reset" ,"()" )); +} +/** * chamelium_v3_get_supported_ports - Get the list of ports on the chamelium *
lib/chamelium/v3/igt_chamelium.h +1 -0
@@ -42,6 +42,7 @@ struct igt_chamelium_v3 *chamelium_v3_init_from_config(void);void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium); +void chamelium_v3_reset (struct igt_chamelium_v3 *chamelium);int chamelium_v3_get_supported_ports (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id **port_ids); int chamelium_v3_get_children(struct igt_chamelium_v3 *chamelium, chamelium_v3_port_id port_id,
Signature · 1 line
2.44.2
PATCH v2 20/39 lib/chamelium/v3: Implement methods for plugging Chamelium ports
In reply to Louis ChauvetIntroduce two new RPC calls, Plug and PlugWithChildren, to manage Chamelium port connections. The Plug method enables plugging physical ports (HDMI1/2, DP1/2), while the PlugWithChildren method allows plugging MST connectors (DP1 and its MST children).
--- lib/chamelium/v3/igt_chamelium.c | 51 ++++++++++++++++++++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 4 ++++ 2 files changed, 55 insertions(+)
lib/chamelium/v3/igt_chamelium.c +51 -0
@@ -323,3 +323,54 @@ char *chamelium_v3_get_port_name(struct igt_chamelium_v3 *chamelium,return port_name; } + +/** +* chamelium_v3_plug - Emulate a plug action on a specific port id +* +* @chamelium: Chamelium to get the ports from +* @port_id: Port to plug +* +* Emulate a connection action on the chamelium. It should have the same effect as physically +* plugging a connector. +* +* Note: The current chamelium have some issue with port 1: the plug/unplug action does not seems to +* works reliably. However, it works fine with port 5 (same physical connector, but use a different +* component to emulate MST). +*/ +void chamelium_v3_plug (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id) +{ +igt_debug ("RPC Plug(%d)\n" , port_id); +xmlrpc_DECREF (__chamelium_rpc (chamelium,"Plug" ,"(i)" , port_id)); +} + +/** +* chamelium_v3_plug_with_children - Emulate a plug action on a specific port with MST children +* +* @chamelium: Chamelium to get the ports from +* @port_id: Parent port for MST +* @children: List of children port to plug. It must not include the parent port id. +* @children_port_count: Number of ports in @children +* +* Emulate a connection action on the chamelium using a MST device. The parent connector will always +* be plugged. +* +* The children pointer is not freed by this function and must be managed by the caller. +*/ +void chamelium_v3_plug_with_children (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id,chamelium_v3_port_id *children, +size_t children_port_count) +{ +xmlrpc_value *tmp; +xmlrpc_value *children_array =xmlrpc_array_new (&chamelium->env); + +for (int i =0 ; i < children_port_count; i++) { + tmp =xmlrpc_int_new (&chamelium->env, (int ) children[i]); +xmlrpc_array_append_item (&chamelium->env, children_array, tmp); +xmlrpc_DECREF (tmp); + } + +igt_debug ("RPC PlugWithChildren(%d, ...)\n" , port_id); +xmlrpc_DECREF (__chamelium_rpc (chamelium,"PlugWithChildren" ,"(iA)" , port_id, + children_array)); +xmlrpc_DECREF (children_array); +}
lib/chamelium/v3/igt_chamelium.h +4 -0
@@ -49,5 +49,9 @@ int chamelium_v3_get_children(struct igt_chamelium_v3 *chamelium, chamelium_v3_p chamelium_v3_port_id **port_ids);bool chamelium_v3_is_mst (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id);char *chamelium_v3_get_port_name (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id); +void chamelium_v3_plug (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id); +void chamelium_v3_plug_with_children (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id,chamelium_v3_port_id *children, +size_t children_port_count);#endif //V3_IGT_CHAMELIUM_H
Signature · 1 line
2.44.2
PATCH v2 21/39 lib/chamelium/v3: Implement methods for managing Chamelium EDID
In reply to Louis ChauvetIntroduce functionality to apply different EDIDs to each Chamelium port. This includes uploading EDIDs and assigning identifiers for applying them to specific connectors. This feature allows for greater flexibility in configuring and testing display setups.
--- lib/chamelium/v3/igt_chamelium.c | 47 +++++++++++++++++++++++++++++++++++++++- lib/chamelium/v3/igt_chamelium.h | 8 +++++++ 2 files changed, 54 insertions(+), 1 deletion(-)
lib/chamelium/v3/igt_chamelium.c +46 -1
@@ -364,7 +364,7 @@ void chamelium_v3_plug_with_children(struct igt_chamelium_v3 *chamelium,xmlrpc_value *children_array =xmlrpc_array_new (&chamelium->env);for (int i =0 ; i < children_port_count; i++) { - tmp =xmlrpc_int_new (&chamelium->env, (int ) children[i]); + tmp =xmlrpc_int_new (&chamelium->env, (int )children[i]);xmlrpc_array_append_item (&chamelium->env, children_array, tmp);xmlrpc_DECREF (tmp); }
@@ -374,3 +374,48 @@ void chamelium_v3_plug_with_children(struct igt_chamelium_v3 *chamelium, children_array));xmlrpc_DECREF (children_array); } + +/** +* chamelium_v3_create_edid - Upload an EDID to the chamelium +* +* @chamelium: Chamelium to get the ports from +* @edid: EDID to upload +* +* Upload an EDID to the chamelium. The returned value must then be used with +* chamelium_v3_apply_edid to associate this EDID with a port. +* +* If you prefer to not upload, the chamelium already has a default EDID that you can apply by using +* the value CHAMELIUM_V3_EDID_DEFAULT. +*/ +chamelium_edid_id chamelium_v3_create_edid (struct igt_chamelium_v3 *chamelium, +const struct edid *edid) +{ +xmlrpc_value *res; +chamelium_edid_id edid_id; + +igt_debug ("RPC CreateEdid(...)\n" ); + res =__chamelium_rpc (chamelium,"CreateEdid" ,"(6)" , + edid,edid_get_size (edid)); +xmlrpc_read_int (&chamelium->env, res, &edid_id); +xmlrpc_DECREF (res); + +return edid_id; +} + +/** +* chamelium_v3_apply_edid - Set an EDID to a specific port +* +* @chamelium: Chamelium to get the ports from +* @port_id: Port to apply the EDID +* @edid_id: EDID to apply +* +* Apply a specific EDID to a port. The @edid_id is the value returned by a call to +* chamelium_v3_create_edid. For simplicity you can also use CHAMELIUM_V3_EDID_DEFAULT to use the +* default EDID. +*/ +void chamelium_v3_apply_edid (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id,chamelium_edid_id edid_id) +{ +igt_debug ("RPC ApplyEdid(%d, %d)\n" , port_id, edid_id); +xmlrpc_DECREF (__chamelium_rpc (chamelium,"ApplyEdid" ,"(ii)" , port_id, edid_id)); +}
lib/chamelium/v3/igt_chamelium.h +8 -0
@@ -5,10 +5,14 @@#include <stdint.h> +#include "igt_edid.h" #include "igt_list.h" struct igt_chamelium_v3 ;typedef uint32_t chamelium_v3_port_id ; +typedef int chamelium_edid_id ; + +#define CHAMELIUM_V3_EDID_DEFAULT 0/** struct chamelium_v3_port_mapping - Represent a mapping between a DRM connector and a port on * the chamelium
@@ -53,5 +57,9 @@ void chamelium_v3_plug(struct igt_chamelium_v3 *chamelium, chamelium_v3_port_idvoid chamelium_v3_plug_with_children (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id,chamelium_v3_port_id *children,size_t children_port_count); +chamelium_edid_id chamelium_v3_create_edid (struct igt_chamelium_v3 *chamelium, +const struct edid *edid); +void chamelium_v3_apply_edid (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id, +chamelium_edid_id edid_id);#endif //V3_IGT_CHAMELIUM_H
Signature · 1 line
2.44.2
PATCH v2 22/39 lib/chamelium/v3: Implement Chamelium configuration parsing
In reply to Louis ChauvetThe mapping between DRM connectors and Chamelium ports can differ among setups. To avoid using a time-consuming algorithm for auto-detecting the configuration, this commit introduces parsing of the port mapping from a configuration file. The format used is the same as in Chamelium v2.
--- lib/chamelium/v3/igt_chamelium.c | 72 ++++++++++++++++++++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 2 ++ 2 files changed, 74 insertions(+)
lib/chamelium/v3/igt_chamelium.c +72 -0
@@ -10,6 +10,9 @@#define CHAMELIUM_CONFIG_SECTION "Chameliumv3"#define CHAMELIUM_CONFIG_URL "URL" +#define CHAMELIUM_V2_CONFIG_PREFIX "Chamelium" +#define CHAMELIUM_V2_CONFIG_PORT_ID "ChameliumPortID" +struct igt_chamelium_v3 {xmlrpc_env env;xmlrpc_client *client;
@@ -126,6 +129,75 @@ struct igt_chamelium_v3 *chamelium_v3_init_from_config(void)return chamelium; } +/** +* chamelium_v3_fill_port_mapping_from_config_v2() - Read the configuration file using the chamelium +* v2 format +* +* @chamelium: chamelium to store the port mapping into +* +* Read the configuration file to search a chamelium configuration, using the Cv2 format. It will +* ignore any malformed entry. +*/ +static void chamelium_v3_fill_port_mapping_from_config_v2 (struct igt_chamelium_v3 *chamelium) +{ +char **group_list; + +igt_assert (igt_key_file); + + group_list =g_key_file_get_groups (igt_key_file,NULL ); +for (int group_idx =0 ; group_list[group_idx]; group_idx++) { +if (strstr (group_list[group_idx],CHAMELIUM_V2_CONFIG_PREFIX ":" )) { +struct chamelium_v3_port_mapping *port_mapping =NULL ; +GError *error =NULL ; +char *port_name_str = + group_list[group_idx] + (sizeof (CHAMELIUM_V2_CONFIG_PREFIX ":" ) -1 ); + + errno =0 ; + + port_mapping =chamelium_v3_port_mapping_alloc (); + port_mapping->connector_name =strdup (port_name_str); + +if (g_key_file_has_key (igt_key_file, group_list[group_idx], +CHAMELIUM_V2_CONFIG_PORT_ID ,NULL )) { + port_mapping->port_id =g_key_file_get_integer (igt_key_file, + group_list[group_idx], +CHAMELIUM_V2_CONFIG_PORT_ID , + &error); +if (error) { +igt_info ("Skipping malformed entry %s: %s\n" , + group_list[group_idx], error->message); +chamelium_v3_port_mapping_free (port_mapping); + }else { +igt_list_add (&port_mapping->link, &chamelium->port_mapping); + } + }else { +igt_warn ("Skipping malformed entry %s: Missing " +CHAMELIUM_V2_CONFIG_PORT_ID "\n" , + group_list[group_idx]); +chamelium_v3_port_mapping_free (port_mapping); + } + +if (error) +free (error); + } + +free (group_list[group_idx]); + } +free (group_list); +} + +/** +* chamelium_v3_fill_port_mapping() - Read the configuration file and fill the port_mapping +* structure. +* +* @chamelium: chamelium to store the port mapping into +*/ +void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium) +{ +if (igt_key_file) +chamelium_v3_fill_port_mapping_from_config_v2 (chamelium); +} +/** * chamelium_v3_uninit() - Free the resources used by a chamelium *
lib/chamelium/v3/igt_chamelium.h +2 -0
@@ -44,6 +44,8 @@ struct chamelium_v3_port_mapping {struct igt_chamelium_v3 *chamelium_v3_init (char *url);struct igt_chamelium_v3 *chamelium_v3_init_from_config (void ); +void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium); +void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium);void chamelium_v3_reset (struct igt_chamelium_v3 *chamelium);
Signature · 1 line
2.44.2
PATCH v2 23/39 lib/chamelium/v3: Log port mapping for debugging purposes
In reply to Louis ChauvetPort mapping is crucial information when attempting to understand why a test is failing, as issues may arise from incorrect mapping. This commit adds logging of the actual port mapping to aid in debugging and problem resolution.
--- lib/chamelium/v3/igt_chamelium.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
lib/chamelium/v3/igt_chamelium.c +23 -0
@@ -186,6 +186,27 @@ static void chamelium_v3_fill_port_mapping_from_config_v2(struct igt_chamelium_vfree (group_list); } +/** +* chamelium_v3_port_mapping_info_list() - Display the current configured port mapping for the +* chamelium +* +* @chamelium: chamelium to read the port mapping from +*/ +static void chamelium_v3_port_mapping_info_list (struct igt_list_head *head) +{ +struct chamelium_v3_port_mapping *tmp, *pos; + +igt_list_for_each_entry_safe (pos, tmp, head, link) { +if (pos->mst_path) +igt_info ("\t%s: port_id=%d parent_id=%d is_children=%d\n" , + pos->mst_path, pos->port_id, pos->parent_id, pos->is_children); +else +igt_info ("\t%s: port_id=%d parent_id=%d is_children=%d\n" , + pos->connector_name, pos->port_id, pos->parent_id, + pos->is_children); + } +} +/** * chamelium_v3_fill_port_mapping() - Read the configuration file and fill the port_mapping * structure.
@@ -196,6 +217,8 @@ void chamelium_v3_fill_port_mapping(struct igt_chamelium_v3 *chamelium) {if (igt_key_file)chamelium_v3_fill_port_mapping_from_config_v2 (chamelium); + +chamelium_v3_port_mapping_info_list (&chamelium->port_mapping); }/**
Signature · 1 line
2.44.2
PATCH v2 24/39 lib/chamelium/v3: Introduce new configuration format for MST support
In reply to Louis ChauvetThe current Chamelium v2 configuration format does not accommodate MST usage. To maintain compatibility with existing configuration files, this commit introduces a new format with a distinct prefix for Chamelium v3 port mapping.
Support for the Chamelium v2 format is retained to facilitate the transition between Chamelium v2 and v3. The v2 format will be used if the v3 format is not present in the file.
--- lib/chamelium/v3/igt_chamelium.c | 126 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 3 deletions(-)
lib/chamelium/v3/igt_chamelium.c +123 -3
@@ -13,6 +13,11 @@#define CHAMELIUM_V2_CONFIG_PREFIX "Chamelium"#define CHAMELIUM_V2_CONFIG_PORT_ID "ChameliumPortID" +#define CHAMELIUM_V3_CONFIG_PORT_NAME "PortName" +#define CHAMELIUM_V3_CONFIG_MST_PATH "MstPath" +#define CHAMELIUM_V3_CONFIG_PARENT_ID "ChameliumParentID" +#define CHAMELIUM_V3_CONFIG_AUTODETECT_SAVE "ChameliumAutodetectSave" +struct igt_chamelium_v3 {xmlrpc_env env;xmlrpc_client *client;
@@ -172,7 +177,7 @@ static void chamelium_v3_fill_port_mapping_from_config_v2(struct igt_chamelium_v } }else {igt_warn ("Skipping malformed entry %s: Missing " -CHAMELIUM_V2_CONFIG_PORT_ID "\n" , +CHAMELIUM_V2_CONFIG_PORT_ID "\n" , group_list[group_idx]);chamelium_v3_port_mapping_free (port_mapping); }
@@ -186,6 +191,115 @@ static void chamelium_v3_fill_port_mapping_from_config_v2(struct igt_chamelium_vfree (group_list); } +/** +* chamelium_v3_fill_port_mapping_from_config_v2() - Read the configuration file using the chamelium +* v3 format +* +* @chamelium: chamelium to store the port mapping into +* +* Read the configuration file to search a chamelium configuration, using the Cv3 format. It will +* ignore any malformed entry. +*/ +static void chamelium_v3_fill_port_mapping_from_config_v3 (struct igt_chamelium_v3 *chamelium) +{ +char **group_list; + +igt_assert (igt_key_file); + + group_list =g_key_file_get_groups (igt_key_file,NULL ); +for (int group_idx =0 ; group_list[group_idx]; group_idx++) { +if (strstr (group_list[group_idx],CHAMELIUM_CONFIG_SECTION ":" )) { +struct chamelium_v3_port_mapping *port_mapping =NULL ; +uint32_t chamelium_port_id; +char *tmp_end; +GError *error =NULL ; +char *chamelium_port_id_str = + group_list[group_idx] + (sizeof (CHAMELIUM_CONFIG_SECTION ":" ) -1 ); + + errno =0 ; + chamelium_port_id =strtoul (chamelium_port_id_str, &tmp_end,0 ); + +if (chamelium_port_id_str == tmp_end) { +igt_warn ("Failed to read config file, expecting [" +CHAMELIUM_CONFIG_SECTION ":<int>], found %s\n" , + group_list[group_idx]); + goto exit_loop; + }else if (errno ==ERANGE ) { +igt_warn ("Range error during parsing of number, expecting \"%.*s\", strtolu returned %d" , + (int )(tmp_end - chamelium_port_id_str), + chamelium_port_id_str, chamelium_port_id); + goto exit_loop; + } + + port_mapping =chamelium_v3_port_mapping_alloc (); + port_mapping->port_id = chamelium_port_id; + +if (g_key_file_has_key (igt_key_file, group_list[group_idx], +CHAMELIUM_V3_CONFIG_PORT_NAME ,NULL )) { + port_mapping->connector_name =g_key_file_get_string (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_PORT_NAME , + &error); +if (error) { +igt_info ("Skipping malformed entry %s: %s\n" , + group_list[group_idx], error->message); + goto exit_loop; + } + } + +if (g_key_file_has_key (igt_key_file, group_list[group_idx], +CHAMELIUM_V3_CONFIG_MST_PATH ,NULL )) { + port_mapping->mst_path =g_key_file_get_string (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_MST_PATH , + &error); +if (error) { +igt_warn ("Skipping malformed entry %s: %s\n" , + group_list[group_idx], error->message); + goto exit_loop; + } + } + +if (g_key_file_has_key (igt_key_file, group_list[group_idx], +CHAMELIUM_V3_CONFIG_PARENT_ID ,NULL )) { + port_mapping->parent_id =g_key_file_get_integer (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_PARENT_ID , + &error); + port_mapping->is_children = true; +if (error) { +igt_warn ("Skipping malformed entry %s: %s\n" , + group_list[group_idx], + error->message); + goto exit_loop; + } + } + +if (port_mapping->is_children && !port_mapping->mst_path) { +igt_warn ("If the port have a " CHAMELIUM_V3_CONFIG_PARENT_ID +", it must also have an " CHAMELIUM_V3_CONFIG_MST_PATH +". Skipping malformed entry %s.\n" , + group_list[group_idx]); + goto exit_loop; + } + +igt_list_add (&port_mapping->link, &chamelium->port_mapping); + +if (error) +free (error); +continue ; +exit_loop: +if (error) +free (error); +if (port_mapping) +chamelium_v3_port_mapping_free (port_mapping); + } + +free (group_list[group_idx]); + } +free (group_list); +} +/** * chamelium_v3_port_mapping_info_list() - Display the current configured port mapping for the * chamelium
@@ -212,11 +326,17 @@ static void chamelium_v3_port_mapping_info_list(struct igt_list_head *head)* structure. * * @chamelium: chamelium to store the port mapping into +* +* It will read the configuration file searching for a Cv3 configuration. If this configuration does +* not exist or is empty, it will try to read a Cv2 configuration. */ void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium) { -if (igt_key_file) -chamelium_v3_fill_port_mapping_from_config_v2 (chamelium); +if (igt_key_file) { +chamelium_v3_fill_port_mapping_from_config_v3 (chamelium); +if (igt_list_length (&chamelium->port_mapping) ==0 ) +chamelium_v3_fill_port_mapping_from_config_v2 (chamelium); + }chamelium_v3_port_mapping_info_list (&chamelium->port_mapping); }
Signature · 1 line
2.44.2
PATCH v2 25/39 lib/chamelium/v3: Provide access to port_mapping via method call
In reply to Louis ChauvetSince the chamelium_rpc structure is private, this commit introduces a method to access the port mapping.
--- lib/chamelium/v3/igt_chamelium.c | 5 +++++ lib/chamelium/v3/igt_chamelium.h | 1 + 2 files changed, 6 insertions(+)
lib/chamelium/v3/igt_chamelium.c +5 -0
@@ -364,6 +364,11 @@ void chamelium_v3_uninit(struct igt_chamelium_v3 *chamelium)free (chamelium); } +struct igt_list_head *chamelium_v3_get_port_mapping (struct igt_chamelium_v3 *chamelium) +{ +return &chamelium->port_mapping; +} +/** * __chamelium_rpc - Call a remote function on the chamelium *
lib/chamelium/v3/igt_chamelium.h +1 -0
@@ -45,6 +45,7 @@ struct igt_chamelium_v3 *chamelium_v3_init(char *url);struct igt_chamelium_v3 *chamelium_v3_init_from_config (void );void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium); +struct igt_list_head *chamelium_v3_get_port_mapping (struct igt_chamelium_v3 *chamelium);void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium);
Signature · 1 line
2.44.2
PATCH v2 26/39 lib/chamelium/v3: Implement helper function to get port mapping from Chameleon port id
In reply to Louis ChauvetIntroduces a new helper function in the Chameleon V3 wrapper to retrieve the port mapping from a Chameleon port id. This function is useful for certain tests, such as when listing MST children, as it simplifies the process of obtaining the port mapping based on the Chameleon port id.
--- lib/chamelium/v3/igt_chamelium.c | 23 +++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-)
lib/chamelium/v3/igt_chamelium.c +23 -0
@@ -341,6 +341,29 @@ void chamelium_v3_fill_port_mapping(struct igt_chamelium_v3 *chamelium)chamelium_v3_port_mapping_info_list (&chamelium->port_mapping); } +/** +* chamelium_v3_get_port_mapping_for_chamelium_port_id() - Get a port mapping from a chamelium port +* id +* +* @chamelium: Chamelium to search the port ID +* @port_id: Port ID to search for +* +* Returns the pointer to a port mapping +*/ +struct chamelium_v3_port_mapping * +chamelium_v3_get_port_mapping_for_chamelium_port_id (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id) +{ +struct chamelium_v3_port_mapping *port_mapping, *tmp; + +igt_list_for_each_entry_safe (port_mapping, tmp, &chamelium->port_mapping, link) { +if (port_mapping->port_id == port_id) +return port_mapping; + } + +return NULL ; +} +/** * chamelium_v3_uninit() - Free the resources used by a chamelium *
lib/chamelium/v3/igt_chamelium.h +3 -1
@@ -46,7 +46,9 @@ struct igt_chamelium_v3 *chamelium_v3_init_from_config(void);void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium);struct igt_list_head *chamelium_v3_get_port_mapping (struct igt_chamelium_v3 *chamelium); - +struct chamelium_v3_port_mapping * +chamelium_v3_get_port_mapping_for_chamelium_port_id (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id);void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium);void chamelium_v3_reset (struct igt_chamelium_v3 *chamelium);
Signature · 1 line
2.44.2
PATCH v2 27/39 lib/chamelium/v3: Implement helper function to retrieve connector from port mapping
In reply to Louis ChauvetThis commit introduces a helper function that utilizes igt_kms helpers to easily obtain the connector object from a given port mapping in Chamelium, simplifying the process for users.
--- lib/chamelium/v3/igt_chamelium.c | 43 ++++++++++++++++++++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 7 +++++++ 2 files changed, 50 insertions(+)
lib/chamelium/v3/igt_chamelium.c +43 -0
@@ -5,6 +5,7 @@#include "igt_chamelium.h" #include "igt_core.h" +#include "igt_kms.h" #include "igt_rc.h" #define CHAMELIUM_CONFIG_SECTION "Chameliumv3"
@@ -392,6 +393,48 @@ struct igt_list_head *chamelium_v3_get_port_mapping(struct igt_chamelium_v3 *chareturn &chamelium->port_mapping; } +/** +* chamelium_v3_port_mapping_get_connector - Get a drm connector from a port mapping +* +* @port_mapping: Port mapping to retrieve the connector from +* @drm_fd: drm file descriptor to use when requesting the connector +* +* This function only works with non-MST port mapping. +* +* Returns a drm connector that must be freed with drmModeConnectorFree when not needed anymore. +* A null pointer means that the connector can't be found. +*/ +drmModeConnectorPtr +chamelium_v3_port_mapping_get_connector (const struct chamelium_v3_port_mapping *port_mapping, +int drm_fd) +{ +if (port_mapping->mst_path) { +igt_warn ("Directly getting a connector from its MST path is not supported" ); +return NULL ; + }else { +return igt_get_connector_from_name (drm_fd, port_mapping->connector_name); + } +} + +/** +* chamelium_v3_port_mapping_get_connector_id - Get a drm connector id from a port mapping +* +* @port_mapping: Port mapping to retrieve the connector id from +* @drm_fd: drm file descriptor to use when requesting the connector id +* +* Returns a drm connector id that represent the port mapping given in parameter. A connector id of +* zero means that the connector is not found. +*/ +uint32_t +chamelium_v3_port_mapping_get_connector_id (const struct chamelium_v3_port_mapping *port_mapping, +int drm_fd) +{ +if (port_mapping->mst_path) +return igt_get_connector_id_from_mst_path (drm_fd, port_mapping->mst_path); +else +return igt_get_connector_id_from_name (drm_fd, port_mapping->connector_name); +} +/** * __chamelium_rpc - Call a remote function on the chamelium *
lib/chamelium/v3/igt_chamelium.h +7 -0
@@ -49,6 +49,13 @@ struct igt_list_head *chamelium_v3_get_port_mapping(struct igt_chamelium_v3 *chastruct chamelium_v3_port_mapping *chamelium_v3_get_port_mapping_for_chamelium_port_id (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id); +uint32_t +chamelium_v3_port_mapping_get_connector_id (const struct chamelium_v3_port_mapping *port_mapping, +int drm_fd); +drmModeConnectorPtr +chamelium_v3_port_mapping_get_connector (const struct chamelium_v3_port_mapping *port_mapping, +int drm_fd); +void chamelium_v3_uninit (struct igt_chamelium_v3 *chamelium);void chamelium_v3_reset (struct igt_chamelium_v3 *chamelium);
Signature · 1 line
2.44.2
PATCH v2 28/39 lib/chamelium/v3: Plug specific ports for all tests
In reply to Louis ChauvetAs the chamelium v3 does not support plugging all ports at the same time, something is required to identify which port must be plugged during non-chamelium specific tests.
Add two options in port configuration:
- ConnectOnAnyTest: force this port to be plugged during any test
- EDID: Set a specific EDID for this port
--- lib/chamelium/v3/igt_chamelium.c | 19 ++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 7 +++++ lib/igt_kms.c | 55 +++++++++++++++++++++++++++++++++++----- 3 files changed, 74 insertions(+), 7 deletions(-)
lib/chamelium/v3/igt_chamelium.c +19 -0
@@ -18,6 +18,8 @@#define CHAMELIUM_V3_CONFIG_MST_PATH "MstPath"#define CHAMELIUM_V3_CONFIG_PARENT_ID "ChameliumParentID"#define CHAMELIUM_V3_CONFIG_AUTODETECT_SAVE "ChameliumAutodetectSave" +#define CHAMELIUM_V3_CONFIG_CONNECT_ON_ANY_TEST "ConnectOnAnyTest" +#define CHAMELIUM_V3_CONFIG_EDID "EDID"struct igt_chamelium_v3 {xmlrpc_env env;
@@ -234,6 +236,23 @@ static void chamelium_v3_fill_port_mapping_from_config_v3(struct igt_chamelium_v port_mapping =chamelium_v3_port_mapping_alloc (); port_mapping->port_id = chamelium_port_id; + port_mapping->connect_on_any_test =g_key_file_get_boolean (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_CONNECT_ON_ANY_TEST , +NULL ); + +if (g_key_file_has_key (igt_key_file, group_list[group_idx], +CHAMELIUM_V3_CONFIG_EDID ,NULL )) { + port_mapping->edid_name =g_key_file_get_string (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_EDID , + &error); +if (error) { +igt_info ("Skipping malformed entry %s: %s\n" , + group_list[group_idx], error->message); + goto exit_loop; + } + }if (g_key_file_has_key (igt_key_file, group_list[group_idx],CHAMELIUM_V3_CONFIG_PORT_NAME ,NULL )) {
lib/chamelium/v3/igt_chamelium.h +7 -0
@@ -18,6 +18,9 @@ typedef int chamelium_edid_id;* the chamelium * * @port_id: Chamelium port ID. +* @connect_on_any_test: if true, this port will be connected, even for tests that are not +* chamelium-specific +* @edid_name: When using @connect_on_any_test, set this specific EDID to the port * @connector_name: DRM connector name, used to identify the connector in DRM, mutually exclusive * with @mst_path * @mst_path: MST path property, used to identify the connector in DRM, mutually exclusive with
@@ -29,6 +32,10 @@ typedef int chamelium_edid_id;struct chamelium_v3_port_mapping {chamelium_v3_port_id port_id; +/* Using chamelium to emulate a display */ +bool connect_on_any_test; +char *edid_name; +/* For normal DRM connector */ char *connector_name;
lib/igt_kms.c +48 -7
74 lines not on this page · raw message
Signature · 1 line
2.44.2
Re: [PATCH i-g-t v2 28/39] lib/chamelium/v3: Plug specific ports for all tests
Hi Louis,
Quoted 82 lines · Louis Chauvet
As the chamelium v3 does not support plugging all ports at the same time, something is required to identify which port must be plugged during non-chamelium specific tests.
Add two options in port configuration:
- ConnectOnAnyTest: force this port to be plugged during any test
- EDID: Set a specific EDID for this portSigned-off-by Louis Chauvet <[email protected]>--- lib/chamelium/v3/igt_chamelium.c | 19 ++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 7 +++++ lib/igt_kms.c | 55 +++++++++++++++++++++++++++++++++++----- 3 files changed, 74 insertions(+), 7 deletions(-)lib/chamelium/v3/igt_chamelium.c +19
-0@@ -18,6 +18,8 @@#define CHAMELIUM_V3_CONFIG_MST_PATH "MstPath"#define CHAMELIUM_V3_CONFIG_PARENT_ID "ChameliumParentID"#define CHAMELIUM_V3_CONFIG_AUTODETECT_SAVE "ChameliumAutodetectSave" +#define CHAMELIUM_V3_CONFIG_CONNECT_ON_ANY_TEST "ConnectOnAnyTest" +#define CHAMELIUM_V3_CONFIG_EDID "EDID"struct igt_chamelium_v3 {xmlrpc_env env;@@ -234,6 +236,23 @@ static void chamelium_v3_fill_port_mapping_from_config_v3(struct igt_chamelium_v port_mapping =chamelium_v3_port_mapping_alloc (); port_mapping->port_id = chamelium_port_id; + port_mapping->connect_on_any_test =g_key_file_get_boolean (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_CONNECT_ON_ANY_TEST , +NULL ); + +if (g_key_file_has_key (igt_key_file, group_list[group_idx], +CHAMELIUM_V3_CONFIG_EDID ,NULL )) { + port_mapping->edid_name =g_key_file_get_string (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_EDID , + &error); +if (error) { +igt_info ("Skipping malformed entry %s: %s\n" , + group_list[group_idx], error->message); + goto exit_loop; + } + }if (g_key_file_has_key (igt_key_file, group_list[group_idx],CHAMELIUM_V3_CONFIG_PORT_NAME ,NULL )) {lib/chamelium/v3/igt_chamelium.h +7
-0@@ -18,6 +18,9 @@ typedef int chamelium_edid_id;* the chamelium * * @port_id: Chamelium port ID. +* @connect_on_any_test: if true, this port will be connected, even for tests that are not +* chamelium-specific +* @edid_name: When using @connect_on_any_test, set this specific EDID to the port * @connector_name: DRM connector name, used to identify the connector in DRM, mutually exclusive * with @mst_path * @mst_path: MST path property, used to identify the connector in DRM, mutually exclusive with @@ -29,6 +32,10 @@ typedef int chamelium_edid_id;struct chamelium_v3_port_mapping {chamelium_v3_port_id port_id; +/* Using chamelium to emulate a display */ +bool connect_on_any_test; +char *edid_name; +/* For normal DRM connector */ char *connector_name;lib/igt_kms.c +0
-0
lib/igt_kms.c line 53
Quoted 5 lines
lib/igt_kms.c +2
-0@@ -49,6 +49,8 @@#include <time.h> #include <i915_drm.h> +#include <chamelium/v3/igt_chamelium.h> +#include <monitor_edids/monitor_edids_helper.h>
Should this be in ifdef HAVE_CHAMELIUM_V3 ?
Quoted 28 lines
lib/igt_kms.c +6
-7#include "drmtest.h" #include "igt_kms.h" @@ -2883,14 +2885,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)if (!resources) goto out; -/* -* FIXME: Dirty hack to avoid those lines when chamelium v3 is used -* -* Must be replaced with a configuration file information, so the end user can choose if the -* chamelium must be connected or not. -*/ #ifdef HAVE_CHAMELIUM_V2 -#ifndef HAVE_CHAMELIUM_V3 {struct chamelium *chamelium;@@ -2906,6 +2901,52 @@ void igt_display_require(igt_display_t *display, int drm_fd) } }#endif + +#ifdef HAVE_CHAMELIUM_V3 + { +struct igt_chamelium_v3 *chamelium =chamelium_v3_init_from_config (); + +if (chamelium) {
lib/igt_kms.c void igt_display_require(igt_display_t *display, int drm_fd) · line 2919
Quoted 10 lines
lib/igt_kms.c +10
-0+struct chamelium_v3_port_mapping *mapping, *tmp; + +chamelium_v3_reset (chamelium); +chamelium_v3_fill_port_mapping (chamelium); + +igt_list_for_each_entry_safe (mapping, tmp, +chamelium_v3_get_port_mapping (chamelium), + link) { +if (mapping->connect_on_any_test && !chamelium_v3_is_mst (chamelium, mapping->port_id)) { +int edid_id =CHAMELIUM_DEFAULT_EDID ;
Need to use CHAMELIUM_V3_EDID_DEFAULT from lib/chamelium/v3/igt_chamelium.h.
Quoted 4 lines
lib/igt_kms.c +4
-0+ +igt_info ("Plugging port %s\n" , mapping->connector_name); +if (mapping->edid_name) { +struct edid *edid =get_edid_by_name (mapping->edid_name);
lib/igt_kms.c void igt_display_require(igt_display_t *display, int drm_fd) · line 2933
Quoted 10 lines
lib/igt_kms.c +10
-0+ +if (edid) + edid_id =chamelium_v3_create_edid (chamelium, + edid); +else +igt_warn ("Impossible to find an edid named \"%s\". Available names:\n" , + mapping->edid_name); +list_edid_names (IGT_LOG_WARN ); + } +if (edid_id ==CHAMELIUM_DEFAULT_EDID )
Same as above.
Quoted 10 lines
lib/igt_kms.c +9
-0+igt_info ("\tUsing default EDID\n" ); + else + igt_info("\tUsing edid: %s\n", mapping->edid_name); + +chamelium_v3_apply_edid (chamelium, mapping->port_id, + edid_id); +chamelium_v3_plug (chamelium, mapping->port_id); + igt_require(igt_wait_for_connector_status(drm_fd, + chamelium_v3_port_mapping_get_connector_id(mapping, drm_fd),
lib/igt_kms.c void igt_display_require(igt_display_t *display, int drm_fd) · line 2952
Quoted 10 lines
lib/igt_kms.c +7
-0+igt_default_detect_timeout (), + DRM_MODE_CONNECTED)); + } + } +chamelium_v3_uninit (chamelium); + } + }#endif igt_require_f(resources->count_crtcs <= IGT_MAX_PIPES,
Regards,
Vignesh
Re: [PATCH i-g-t v2 28/39] lib/chamelium/v3: Plug specific ports for all tests
Quoted 87 lines · Vignesh Raman
Hi Louis,
Quoted 84 lines · Louis Chauvet
As the chamelium v3 does not support plugging all ports at the same time, something is required to identify which port must be plugged during non-chamelium specific tests.
Add two options in port configuration:
- ConnectOnAnyTest: force this port to be plugged during any test
- EDID: Set a specific EDID for this portSigned-off-by Louis Chauvet <[email protected]>--- lib/chamelium/v3/igt_chamelium.c | 19 ++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 7 +++++ lib/igt_kms.c | 55 +++++++++++++++++++++++++++++++++++----- 3 files changed, 74 insertions(+), 7 deletions(-)lib/chamelium/v3/igt_chamelium.c +19
-0@@ -18,6 +18,8 @@#define CHAMELIUM_V3_CONFIG_MST_PATH "MstPath"#define CHAMELIUM_V3_CONFIG_PARENT_ID "ChameliumParentID"#define CHAMELIUM_V3_CONFIG_AUTODETECT_SAVE "ChameliumAutodetectSave" +#define CHAMELIUM_V3_CONFIG_CONNECT_ON_ANY_TEST "ConnectOnAnyTest" +#define CHAMELIUM_V3_CONFIG_EDID "EDID"struct igt_chamelium_v3 {xmlrpc_env env;@@ -234,6 +236,23 @@ static void chamelium_v3_fill_port_mapping_from_config_v3(struct igt_chamelium_v port_mapping =chamelium_v3_port_mapping_alloc (); port_mapping->port_id = chamelium_port_id; + port_mapping->connect_on_any_test =g_key_file_get_boolean (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_CONNECT_ON_ANY_TEST , +NULL ); + +if (g_key_file_has_key (igt_key_file, group_list[group_idx], +CHAMELIUM_V3_CONFIG_EDID ,NULL )) { + port_mapping->edid_name =g_key_file_get_string (igt_key_file, + group_list[group_idx], +CHAMELIUM_V3_CONFIG_EDID , + &error); +if (error) { +igt_info ("Skipping malformed entry %s: %s\n" , + group_list[group_idx], error->message); + goto exit_loop; + } + }if (g_key_file_has_key (igt_key_file, group_list[group_idx],CHAMELIUM_V3_CONFIG_PORT_NAME ,NULL )) {lib/chamelium/v3/igt_chamelium.h +7
-0@@ -18,6 +18,9 @@ typedef int chamelium_edid_id;* the chamelium * * @port_id: Chamelium port ID. +* @connect_on_any_test: if true, this port will be connected, even for tests that are not +* chamelium-specific +* @edid_name: When using @connect_on_any_test, set this specific EDID to the port * @connector_name: DRM connector name, used to identify the connector in DRM, mutually exclusive * with @mst_path * @mst_path: MST path property, used to identify the connector in DRM, mutually exclusive with @@ -29,6 +32,10 @@ typedef int chamelium_edid_id;struct chamelium_v3_port_mapping {chamelium_v3_port_id port_id; +/* Using chamelium to emulate a display */ +bool connect_on_any_test; +char *edid_name; +/* For normal DRM connector */ char *connector_name;lib/igt_kms.c +0
-0@@ -49,6 +49,8 @@#include <time.h>
Quoted 5 lines
lib/igt_kms.c line 53
Quoted 3 lines
lib/igt_kms.c +2
-0#include <i915_drm.h> +#include <chamelium/v3/igt_chamelium.h> +#include <monitor_edids/monitor_edids_helper.h> Should this be in ifdef
HAVE_CHAMELIUM_V3?
Yes, those includes are not needed, thanks
Quoted 32 lines
Quoted 32 lines
lib/igt_kms.c +10
-7#include "drmtest.h" #include "igt_kms.h" @@ -2883,14 +2885,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)if (!resources) goto out; -/* -* FIXME: Dirty hack to avoid those lines when chamelium v3 is used -* -* Must be replaced with a configuration file information, so the end user can choose if the -* chamelium must be connected or not. -*/ #ifdef HAVE_CHAMELIUM_V2 -#ifndef HAVE_CHAMELIUM_V3 {struct chamelium *chamelium;@@ -2906,6 +2901,52 @@ void igt_display_require(igt_display_t *display, int drm_fd) } }#endif + +#ifdef HAVE_CHAMELIUM_V3 + { +struct igt_chamelium_v3 *chamelium =chamelium_v3_init_from_config (); + +if (chamelium) { +struct chamelium_v3_port_mapping *mapping, *tmp; + +chamelium_v3_reset (chamelium); +chamelium_v3_fill_port_mapping (chamelium);
Quoted 8 lines
lib/igt_kms.c void igt_display_require(igt_display_t *display, int drm_fd) · line 2919
Quoted 6 lines
lib/igt_kms.c +6
-0+ +igt_list_for_each_entry_safe (mapping, tmp, +chamelium_v3_get_port_mapping (chamelium), + link) { +if (mapping->connect_on_any_test && !chamelium_v3_is_mst (chamelium, mapping->port_id)) { +int edid_id =CHAMELIUM_DEFAULT_EDID ;Need to use
CHAMELIUM_V3_EDID_DEFAULTfromlib/chamelium/v3/igt_chamelium.h.
Yes, sorry!
Quoted 8 lines
Quoted 8 lines
lib/igt_kms.c +8
-0+ +igt_info ("Plugging port %s\n" , mapping->connector_name); +if (mapping->edid_name) { +struct edid *edid =get_edid_by_name (mapping->edid_name); + +if (edid) + edid_id =chamelium_v3_create_edid (chamelium, + edid);
Quoted 8 lines
lib/igt_kms.c void igt_display_require(igt_display_t *display, int drm_fd) · line 2933
Quoted 6 lines
lib/igt_kms.c +6
-0+else +igt_warn ("Impossible to find an edid named \"%s\". Available names:\n" , + mapping->edid_name); +list_edid_names (IGT_LOG_WARN ); + } +if (edid_id ==CHAMELIUM_DEFAULT_EDID )Same as above.
Fixed!
Quoted 23 lines
Quoted 10 lines
lib/igt_kms.c +9
-0+igt_info ("\tUsing default EDID\n" ); + else + igt_info("\tUsing edid: %s\n", mapping->edid_name); + +chamelium_v3_apply_edid (chamelium, mapping->port_id, + edid_id); +chamelium_v3_plug (chamelium, mapping->port_id); + igt_require(igt_wait_for_connector_status(drm_fd, + chamelium_v3_port_mapping_get_connector_id(mapping, drm_fd),lib/igt_kms.c void igt_display_require(igt_display_t *display, int drm_fd) · line 2952
Quoted 10 lines
lib/igt_kms.c +7
-0+igt_default_detect_timeout (), + DRM_MODE_CONNECTED)); + } + } +chamelium_v3_uninit (chamelium); + } + }#endif igt_require_f(resources->count_crtcs <= IGT_MAX_PIPES,Regards,
Vignesh
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 29/39 lib/chamelium/v3: Implement Chamelium port autodetection algorithm
In reply to Louis ChauvetTo streamline the usage of Chamelium, this commit introduces an autodetection algorithm. Please note that the algorithm may be somewhat slow, as it needs to identify each port individually.
Note for future contributors: As of now, the RPC call IsPhysicalConnected is known to be broken. Although it could potentially avoid testing all ports, it cannot be used at this time.
--- lib/chamelium/v3/igt_chamelium.c | 348 ++++++++++++++++++++++++++++++++++++++- lib/chamelium/v3/igt_chamelium.h | 2 +- lib/igt_kms.c | 2 +- 3 files changed, 349 insertions(+), 3 deletions(-)
lib/chamelium/v3/igt_chamelium.c +347 -1
@@ -7,6 +7,7 @@#include "igt_core.h" #include "igt_kms.h" #include "igt_rc.h" +#include "igt_kms.h" #define CHAMELIUM_CONFIG_SECTION "Chameliumv3"#define CHAMELIUM_CONFIG_URL "URL"
@@ -341,6 +342,330 @@ static void chamelium_v3_port_mapping_info_list(struct igt_list_head *head) } } +/** +* list_contains() - Search an element in the list +* +* @list: Pointer to the list to search into +* @list_len: Length of the list +* @value: Value to search in the list +* +* Returns true if @list contains @value +*/ +static bool list_contains (const uint32_t *list,int list_len,uint32_t value) +{ +igt_assert (list); +for (int i =0 ; i < list_len; i++) { +if (list[i] == value) +return true; + } +return false; +} + +/** +* get_list_diff() - Compute and return the difference between two lists +* +* @list_a: Pointer to the first list to compare +* @list_a_len: Length of the first list +* @list_b: Pointer to the second list to compare +* @list_b_len: Length of the second list +* @diff: Out pointer for the difference. Can be null to only count new elements. +* +* Returns the number of element which are in @list_a but not in @list_b. +*/ +static int +get_list_diff (const uint32_t *list_a,int list_a_len,const uint32_t *list_b,int list_b_len, +uint32_t **diff) +{ +int diff_len =0 ; + +igt_assert (list_a); +igt_assert (list_b); + +if (diff) + *diff =malloc (0 ); + +for (int i =0 ; i < list_a_len; i++) { +if (!list_contains (list_b, list_b_len, list_a[i])) { +if (diff) { + *diff =reallocarray (*diff, diff_len +1 ,sizeof (**diff)); +igt_assert (*diff); + (*diff)[diff_len] = list_a[i]; + } + + diff_len++; + } + } + +return diff_len; +} + +/** +* chamelium_v3_wait_for_new_connectors() - Wait for new connector to appear +* +* @list_a: Pointer to the first list to compare +* @list_a_len: Length of the first list +* @list_b: Pointer to the second list to compare +* @list_b_len: Length of the second list +* @diff: Out pointer for the difference. Can be null. +* +* Returns the number of element which differ between the two lists. +*/ +static int chamelium_v3_wait_for_new_connectors (uint32_t **newly_connected, +const uint32_t *already_connected, +int already_connected_count,int drm_fd) +{ +int newly_connected_count; +struct timespec start, end; + +igt_assert (newly_connected); +igt_assert (already_connected); +igt_assert (drm_fd); + +clock_gettime (CLOCK_MONOTONIC , &start); +clock_gettime (CLOCK_MONOTONIC , &end); +do { +if (*newly_connected) +free (*newly_connected); + newly_connected_count =igt_get_connected_connectors (drm_fd, newly_connected); +clock_gettime (CLOCK_MONOTONIC , &end); + }while (get_list_diff (*newly_connected, newly_connected_count, + already_connected, already_connected_count, +NULL ) ==0 && +igt_time_elapsed (&start, &end) <=igt_default_detect_timeout ()); + +return newly_connected_count; +} + +/** +* chamelium_v3_autodetect_non_mst_port() - Attempt to detect a port without MST +* +* @chamelium: Chamelium to use +* @drm_fd: drm file descriptor used to get the connected connectors +* @port: Chamlium port to use +* +* It will plug the chamelium @port and attempt to find a newly connected connector in DRM. It will +* add this mapping in the chamelium structure. +*/ +static void +chamelium_v3_autodetect_non_mst_port (struct igt_chamelium_v3 *chamelium,int drm_fd, +chamelium_v3_port_id port) +{ +int newly_connected_count, already_connected_count, diff_len; +uint32_t *newly_connected =NULL , *already_connected =NULL ; +struct chamelium_v3_port_mapping *mapping; +drmModeConnectorPtr connector; +char *port_name; +uint32_t *diff =NULL ; + + port_name =chamelium_v3_get_port_name (chamelium, port); +chamelium_v3_reset (chamelium); + +/* +* Hard sleep is required here as we don't know how long it will take for the device under +* test to properly detect the port disconnection. +*/ +sleep (igt_default_detect_timeout ()); + + already_connected_count =igt_get_connected_connectors (drm_fd, &already_connected); + +chamelium_v3_apply_edid (chamelium, port,0 ); +chamelium_v3_plug (chamelium, port); + + newly_connected_count =chamelium_v3_wait_for_new_connectors (&newly_connected, + already_connected, + already_connected_count, + drm_fd); + + diff_len =get_list_diff (newly_connected, newly_connected_count, + already_connected, already_connected_count, &diff); + +if (diff_len ==0 ) { +igt_info ("\t\t\tNo newly connected connector, assuming this port is not connected.\n" ); + }else if (diff_len >1 ) { +igt_info ("\t\t\tMore than one new connectors connected, this is not supported by autodetection.\n" ); + }else { +igt_info ("\t\t\tFound one connector (%d) connected to the port %d (%s)\n" , diff[0 ], + port, port_name); + + connector =drmModeGetConnector (drm_fd, diff[0 ]); +igt_assert (connector); + mapping =chamelium_v3_port_mapping_alloc (); + mapping->port_id = port; +igt_assert (asprintf (&mapping->connector_name,"%s-%u" , +kmstest_connector_type_str (connector->connector_type), + connector->connector_type_id) !=-1 ); +igt_list_add (&mapping->link, &chamelium->port_mapping); +drmModeFreeConnector (connector); + } + +free (already_connected); +free (newly_connected); +free (diff); +free (port_name); +} + +/** +* chamelium_v3_autodetect_mst_children_port() - Attempt to find the mapping between a children port +* and a MST path +* +* @chamelium: Chamelium to use +* @drm_fd: drm file descriptor to detect the connector +* @port: parent port of the children port +* @children: children port +* +* It will plug the chamelium @port and @children and attempt to find a newly connected connector in +* DRM. It will add this mapping in the chamelium structure. +*/ +static void +chamelium_v3_autodetect_mst_children_port (struct igt_chamelium_v3 *chamelium,int drm_fd, +chamelium_v3_port_id port,chamelium_v3_port_id children) +{ +struct chamelium_v3_port_mapping *mapping; +drmModePropertyBlobPtr path_blob; +struct timespec start, end; +uint32_t *newly_connected =NULL ; +char *port_name; + +igt_assert (chamelium); +igt_assert (drm_fd); + + port_name =chamelium_v3_get_port_name (chamelium, children); +chamelium_v3_reset (chamelium); +chamelium_v3_apply_edid (chamelium, port,0 ); +chamelium_v3_apply_edid (chamelium, children,0 ); +chamelium_v3_plug_with_children (chamelium, port, &children,1 ); + +/* +* Waiting for a connector not already in the mappings +*/ +clock_gettime (CLOCK_MONOTONIC , &start); +clock_gettime (CLOCK_MONOTONIC , &end); +while (igt_time_elapsed (&start, &end) <=igt_default_detect_timeout ()) { +if (newly_connected) +free (newly_connected); + +for (int i =0 ; i <igt_get_connected_connectors (drm_fd, &newly_connected); i++) { + path_blob =kmstest_get_path_blob (drm_fd, newly_connected[i]); + +if (path_blob) { +struct chamelium_v3_port_mapping *tmp, *pos; +bool found = false; + +igt_list_for_each_entry_safe (pos, tmp, &chamelium->port_mapping, + link) { +if (strcmp ((const char *)path_blob->data, pos->mst_path) + ==0 ) { + found = true; + } + } +if (!found) { +igt_info ("\t\t\tFound one children connector (%d) connected to the port %d (%s)\n" , + newly_connected[i], children, port_name); + + mapping =chamelium_v3_port_mapping_alloc (); + mapping->port_id = children; + mapping->is_children = true; + mapping->parent_id = port; + mapping->mst_path =strndup (path_blob->data, + path_blob->length); +drmModeFreePropertyBlob (path_blob); +igt_list_add (&mapping->link, &chamelium->port_mapping); +free (port_name); +return ; + } +drmModeFreePropertyBlob (path_blob); + } + } + +clock_gettime (CLOCK_MONOTONIC , &end); + } +free (port_name); +} + +/** +* chamelium_v3_autodetect_mst_children_port() - Attempt to find the mapping between a MST port, its +* children and their MST path +* +* @chamelium: Chamelium to use +* @drm_fd: drm file descriptor to detect the connector +* @port: MST port +* +* It will plug the chamelium @port and its children and attempt to find a mapping between them and +* a drm connector. It will add this mapping in the chamelium structure. +*/ +static void +chamelium_v3_autodetect_mst_port (struct igt_chamelium_v3 *chamelium,int drm_fd, +chamelium_v3_port_id port) +{ +int already_connected_count, newly_connected_count; +uint32_t *already_connected =NULL , *newly_connected =NULL ; +chamelium_v3_port_id *children_ports =NULL ; +struct chamelium_v3_port_mapping *mapping; +int diff_len, children_port_count; +drmModePropertyBlobPtr path_blob; +char *port_name; +uint32_t *diff =NULL ; + + port_name =chamelium_v3_get_port_name (chamelium, port); +chamelium_v3_reset (chamelium); + +/* +* Hard sleep is required here as we don't know how long it will take for the device under +* test to properly detect the port disconnection. +*/ +sleep (igt_default_detect_timeout ()); + + already_connected_count =igt_get_connected_connectors (drm_fd, &already_connected); + +chamelium_v3_apply_edid (chamelium, port,0 ); +chamelium_v3_plug (chamelium, port); + + newly_connected_count =chamelium_v3_wait_for_new_connectors (&newly_connected, + already_connected, + already_connected_count, + drm_fd); + + diff_len =get_list_diff (newly_connected, newly_connected_count, + already_connected, already_connected_count, + &diff); + +if (diff_len ==0 ) { +igt_info ("\t\t\tNo newly connected connector, assuming this port is not connected.\n" ); + }else if (diff_len >1 ) { +igt_info ("\t\t\tMore than one new connectors connected, this is not supported by autodetection.\n" ); + }else { +igt_info ("\t\t\tFound one connector (%d) connected to the port %d (%s). Autodetecting MST children...\n" , + diff[0 ], port, port_name); + path_blob =kmstest_get_path_blob (drm_fd, diff[0 ]); + +if (path_blob) { + mapping =chamelium_v3_port_mapping_alloc (); + mapping->port_id = port; + mapping->is_children = false; + mapping->mst_path =strndup (path_blob->data, path_blob->length); +drmModeFreePropertyBlob (path_blob); +igt_list_add (&mapping->link, &chamelium->port_mapping); + + children_port_count =chamelium_v3_get_children (chamelium, port, + &children_ports); + +for (int i =0 ; i < children_port_count; i++) { +chamelium_v3_autodetect_mst_children_port (chamelium, drm_fd, port, + children_ports[i]); + } + +free (children_ports); + }else { +igt_info ("\t\t\tNo PATH blob found for this connector. Assuming this DUT does not support MST and skip this port.\n" ); + } + } + +free (already_connected); +free (newly_connected); +free (diff); +free (port_name); +} +/** * chamelium_v3_fill_port_mapping() - Read the configuration file and fill the port_mapping * structure.
@@ -350,7 +675,7 @@ static void chamelium_v3_port_mapping_info_list(struct igt_list_head *head)* It will read the configuration file searching for a Cv3 configuration. If this configuration does * not exist or is empty, it will try to read a Cv2 configuration. */ -void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium) +void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium,int drm_fd) {if (igt_key_file) {chamelium_v3_fill_port_mapping_from_config_v3 (chamelium);
@@ -358,6 +683,27 @@ void chamelium_v3_fill_port_mapping(struct igt_chamelium_v3 *chamelium)chamelium_v3_fill_port_mapping_from_config_v2 (chamelium); } +if (igt_list_empty (&chamelium->port_mapping)) { +chamelium_v3_port_id *ports; +char *port_name; +int port_count; + +igt_info ("Chamelium configuration empty, autodetecting...\n" ); +igt_info ("\tAutodetect ports:\n" ); + ports =NULL ; + port_count =chamelium_v3_get_supported_ports (chamelium, &ports); +for (int i =0 ; i < port_count; i++) { + port_name =chamelium_v3_get_port_name (chamelium, ports[i]); +igt_info ("\t\tAutodetect port %d (%s)...\n" , ports[i], port_name); +if (!chamelium_v3_is_mst (chamelium, ports[i])) +chamelium_v3_autodetect_non_mst_port (chamelium, drm_fd, ports[i]); +else +chamelium_v3_autodetect_mst_port (chamelium, drm_fd, ports[i]); +free (port_name); + } +free (ports); + } +chamelium_v3_port_mapping_info_list (&chamelium->port_mapping); }
lib/chamelium/v3/igt_chamelium.h +1 -1
@@ -51,7 +51,7 @@ struct chamelium_v3_port_mapping {struct igt_chamelium_v3 *chamelium_v3_init (char *url);struct igt_chamelium_v3 *chamelium_v3_init_from_config (void ); -void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium); +void chamelium_v3_fill_port_mapping (struct igt_chamelium_v3 *chamelium,int drm_fd);struct igt_list_head *chamelium_v3_get_port_mapping (struct igt_chamelium_v3 *chamelium);struct chamelium_v3_port_mapping * chamelium_v3_get_port_mapping_for_chamelium_port_id(struct igt_chamelium_v3 *chamelium,
lib/igt_kms.c +1 -1
@@ -2910,7 +2910,7 @@ void igt_display_require(igt_display_t *display, int drm_fd)struct chamelium_v3_port_mapping *mapping, *tmp;chamelium_v3_reset (chamelium); -chamelium_v3_fill_port_mapping (chamelium); +chamelium_v3_fill_port_mapping (chamelium, drm_fd);igt_list_for_each_entry_safe (mapping, tmp, chamelium_v3_get_port_mapping(chamelium),
Signature · 1 line
2.44.2
PATCH v2 30/39 lib/chamelium/v3: Add save option to avoid doing autodetection every time
In reply to Louis ChauvetAutodetection algorithm is slow. To help writing configuration files, add an option save the configuration after an autodetection.
--- lib/chamelium/v3/igt_chamelium.c | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
lib/chamelium/v3/igt_chamelium.c +49 -0
@@ -666,6 +666,43 @@ chamelium_v3_autodetect_mst_port(struct igt_chamelium_v3 *chamelium, int drm_fd,free (port_name); } +static void chamelium_v3_save_mapping (struct igt_chamelium_v3 *chamelium) +{ +struct chamelium_v3_port_mapping *tmp, *pos; +char *key_file_loc =NULL ; +char *key_file_env =NULL ; + +igt_assert (chamelium); +igt_assert (igt_key_file); + +igt_list_for_each_entry_safe (pos, tmp, &chamelium->port_mapping, link) { +char *section_name =NULL ; + +asprintf (§ion_name,CHAMELIUM_CONFIG_SECTION ":%d" , pos->port_id); +igt_assert (section_name); + +if (pos->mst_path) { +g_key_file_set_string (igt_key_file, section_name, +CHAMELIUM_V3_CONFIG_MST_PATH , pos->mst_path); +g_key_file_set_integer (igt_key_file, section_name, +CHAMELIUM_V3_CONFIG_PARENT_ID , pos->parent_id); + }else { +g_key_file_set_string (igt_key_file, section_name, +CHAMELIUM_V3_CONFIG_PORT_NAME , pos->connector_name); + } + } + + key_file_env =getenv ("IGT_CONFIG_PATH" ); +if (key_file_env) { + key_file_loc = key_file_env; + }else { + key_file_loc =malloc (100 ); +snprintf (key_file_loc,100 ,"%s/.igtrc" ,g_get_home_dir ()); + } + +g_key_file_save_to_file (igt_key_file, key_file_loc,NULL ); +} +/** * chamelium_v3_fill_port_mapping() - Read the configuration file and fill the port_mapping * structure.
@@ -705,6 +742,18 @@ void chamelium_v3_fill_port_mapping(struct igt_chamelium_v3 *chamelium, int drm_ }chamelium_v3_port_mapping_info_list (&chamelium->port_mapping); + +if (igt_key_file) { +if (g_key_file_get_boolean (igt_key_file,CHAMELIUM_CONFIG_SECTION ,CHAMELIUM_V3_CONFIG_AUTODETECT_SAVE ,NULL )) { +/* +* Delete this option to avoid rewriting again the same configuration over +* existing config file +*/ +g_key_file_set_boolean (igt_key_file,CHAMELIUM_CONFIG_SECTION , +CHAMELIUM_V3_CONFIG_AUTODETECT_SAVE , false); +chamelium_v3_save_mapping (chamelium); + } + } }/**
Signature · 1 line
2.44.2
PATCH v2 31/39 tests/chamelium/v3: Implement basic EDID handling test
In reply to Louis ChauvetThis commit introduces a new Chamelium v3 test to validate the proper handling of EDID data. The test uploads a custom EDID to the Chamelium and then confirms that the EDID data can be accurately read back from the kernel.
This test is adapted from the v2 version.
--- tests/chamelium/v3/kms_chamelium_v3_edid.c | 95 ++++++++++++++++++++++++++++++ tests/meson.build | 1 + 2 files changed, 96 insertions(+)
tests/chamelium/v3/kms_chamelium_v3_edid.c new file +95 -0
@@ -0,0 +1,95 @@ +// SPDX-License-Identifier: MIT + +#include <igt.h> +#include "chamelium/v3/igt_chamelium.h" + +static void collect_and_compare_edid (int drm_fd, +const struct chamelium_v3_port_mapping *port_mapping, +const struct edid *edid) +{ +drmModePropertyBlobPtr edid_blob =NULL ; +uint64_t edid_blob_id; + +uint32_t connector_id =chamelium_v3_port_mapping_get_connector_id (port_mapping, drm_fd); + +/* Force refresh of properties */ +drmModeFreeConnector (drmModeGetConnector (drm_fd, connector_id)); +igt_assert (kmstest_get_property (drm_fd, connector_id, +DRM_MODE_OBJECT_CONNECTOR ,"EDID" ,NULL , + &edid_blob_id,NULL )); +igt_assert (edid_blob_id); + edid_blob =drmModeGetPropertyBlob (drm_fd, edid_blob_id); +igt_assert (edid_blob); +igt_assert (memcmp (edid, edid_blob->data,edid_get_size (edid)) ==0 ); + +drmModeFreePropertyBlob (edid_blob); +} + +static void upload_and_read_edid (int drm_fd,struct igt_chamelium_v3 *chamelium, +const struct chamelium_v3_port_mapping *port_mapping, +const struct edid *edid) +{ +uint32_t connector_id; + +int edid_id; + +chamelium_v3_reset (chamelium); + edid_id =chamelium_v3_create_edid (chamelium, edid); +chamelium_v3_apply_edid (chamelium, port_mapping->port_id, edid_id); +chamelium_v3_plug (chamelium, port_mapping->port_id); + + connector_id =chamelium_v3_port_mapping_get_connector_id (port_mapping, drm_fd); +igt_assert (igt_wait_for_connector_status (drm_fd, connector_id,10.0 , +DRM_MODE_CONNECTED )); + +collect_and_compare_edid (drm_fd, port_mapping, edid); +} + +static void igt_custom_edid_type_read (int drm_fd,struct igt_chamelium_v3 *chamelium, +struct chamelium_v3_port_mapping *port_mapping, +enum igt_custom_edid_type edid) +{ +upload_and_read_edid (drm_fd, chamelium, port_mapping,igt_kms_get_custom_edid (edid)); +} + +igt_main +{ +struct igt_chamelium_v3 *chamelium; +int drm_fd; + + igt_fixture { + chamelium =chamelium_v3_init_from_config (); +igt_assert (chamelium); + drm_fd =drm_open_driver (DRIVER_ANY ); +igt_assert (drm_fd); +chamelium_v3_fill_port_mapping (chamelium, drm_fd); + } + +igt_describe ("Read basic EDID from the chamelium." ); + igt_subtest_with_dynamic("edid-read-basic") { +struct chamelium_v3_port_mapping *port, *tmp; + +igt_list_for_each_entry_safe (port, tmp,chamelium_v3_get_port_mapping (chamelium), + link) { + igt_dynamic_f("port-%d", port->port_id) { +char *name; + +igt_require (!chamelium_v3_is_mst (chamelium, port->port_id)); + + name =chamelium_v3_get_port_name (chamelium, port->port_id); +igt_info ("Testing port %s (%s)\n" , port->connector_name, name); +free (name); + +igt_custom_edid_type_read (drm_fd, chamelium, port, +IGT_CUSTOM_EDID_BASE ); +igt_custom_edid_type_read (drm_fd, chamelium, port, +IGT_CUSTOM_EDID_ALT ); + } + } + } + + igt_fixture { +chamelium_v3_uninit (chamelium); +drm_close_driver (drm_fd); + } +}
tests/meson.build +1 -0
@@ -326,6 +326,7 @@ chamelium_v2_progs = [ chamelium_v3_progs = [ 'kms_chamelium_v3_basic', + 'kms_chamelium_v3_edid', ] test_deps = [ igt_deps ]
Signature · 1 line
2.44.2
PATCH v2 32/39 tests/chamelium/v3: Implement 4K EDID stress test
In reply to Louis ChauvetThis commit introduces helper functions to utilize monitor EDIDs and upload them to the Chamelium.
The existing EDID test has been enhanced to also test 4K screens. The current EDID database includes entries for HDMI and DP ports.
--- tests/chamelium/v3/kms_chamelium_v3_edid.c | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
tests/chamelium/v3/kms_chamelium_v3_edid.c +46 -0
@@ -1,6 +1,8 @@// SPDX-License-Identifier: MIT #include <igt.h> + +#include "monitor_edids/monitor_edids_helper.h" #include "chamelium/v3/igt_chamelium.h" static void collect_and_compare_edid(int drm_fd,
@@ -52,6 +54,21 @@ static void igt_custom_edid_type_read(int drm_fd, struct igt_chamelium_v3 *chameupload_and_read_edid (drm_fd, chamelium, port_mapping,igt_kms_get_custom_edid (edid)); } +static void edid_stress_resolution (int drm_fd,struct igt_chamelium_v3 *chamelium, +struct chamelium_v3_port_mapping *port_mapping, +monitor_edid edids_list[], +size_t edids_list_len) +{ +for (int i =0 ; i < edids_list_len; i++) { +struct edid *edid =edid_from_monitor_edid (&edids_list[i]); + +igt_info ("Testing out the EDID for %s\n" , +monitor_edid_get_name (&edids_list[i])); +upload_and_read_edid (drm_fd, chamelium, port_mapping, edid); +free (edid); + } +} + igt_main {struct igt_chamelium_v3 *chamelium;
@@ -88,6 +105,35 @@ igt_main } } +igt_describe ("Read many different 4k EDID from the chamelium" ); + igt_subtest_with_dynamic("edid-stress-4k") { +struct chamelium_v3_port_mapping *port, *tmp; + +igt_list_for_each_entry_safe (port, tmp,chamelium_v3_get_port_mapping (chamelium), + link) { + igt_dynamic_f("port-%d", port->port_id) { +drmModeConnectorPtr connector; +size_t edid_count =0 ; +char *name; + +igt_require (!chamelium_v3_is_mst (chamelium, port->port_id)); + + name =chamelium_v3_get_port_name (chamelium, port->port_id); +igt_info ("Testing port %s (%s)\n" , port->connector_name, name); +free (name); + + connector =chamelium_v3_port_mapping_get_connector (port, drm_fd); +igt_assert (connector); +edid_stress_resolution (drm_fd, chamelium, port, +get_edids_for_connector_type (connector->connector_type, + &edid_count, + true), + edid_count); +drmModeFreeConnector (connector); + } + } + } + igt_fixture {chamelium_v3_uninit (chamelium);drm_close_driver (drm_fd);
Signature · 1 line
2.44.2
PATCH v2 33/39 tests/chamelium/v3: Implement non-4K EDID stress test
In reply to Louis ChauvetThe existing EDID test has been enhanced to also test non-4K screens. The current EDID database includes entries for HDMI and DP ports.
--- tests/chamelium/v3/kms_chamelium_v3_edid.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
tests/chamelium/v3/kms_chamelium_v3_edid.c +29 -0
@@ -134,6 +134,35 @@ igt_main } } +igt_describe ("Read many different non-4k EDID from the chamelium" ); + igt_subtest_with_dynamic("edid-stress-non-4k") { +struct chamelium_v3_port_mapping *port, *tmp; + +igt_list_for_each_entry_safe (port, tmp,chamelium_v3_get_port_mapping (chamelium), + link) { + igt_dynamic_f("port-%d", port->port_id) { +drmModeConnectorPtr connector; +size_t edid_count =0 ; +char *name; + +igt_require (!chamelium_v3_is_mst (chamelium, port->port_id)); + + name =chamelium_v3_get_port_name (chamelium, port->port_id); +igt_info ("Testing port %s (%s)\n" , port->connector_name, name); +free (name); + + connector =chamelium_v3_port_mapping_get_connector (port, drm_fd); +igt_assert (connector); +edid_stress_resolution (drm_fd, chamelium, port, +get_edids_for_connector_type (connector->connector_type, + &edid_count, + false), + edid_count); +drmModeFreeConnector (connector); + } + } + } + igt_fixture {chamelium_v3_uninit (chamelium);drm_close_driver (drm_fd);
Signature · 1 line
2.44.2
PATCH v2 34/39 lib/chamelium/v3: Implement method to discover video signal status
In reply to Louis ChauvetThe Chamelium can record signals received on its ports. This commit introduces DetectResolution and WaitVideoInputStable RPC calls to utilize this functionality, allowing users to monitor and manage video signal status.
--- lib/chamelium/v3/igt_chamelium.c | 54 ++++++++++++++++++++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 5 +++- 2 files changed, 58 insertions(+), 1 deletion(-)
lib/chamelium/v3/igt_chamelium.c +54 -0
@@ -1119,3 +1119,57 @@ void chamelium_v3_apply_edid(struct igt_chamelium_v3 *chamelium,igt_debug ("RPC ApplyEdid(%d, %d)\n" , port_id, edid_id);xmlrpc_DECREF (__chamelium_rpc (chamelium,"ApplyEdid" ,"(ii)" , port_id, edid_id)); } + +/** +* chamelium_v3_port_get_resolution - Get the resolution of a signal on a specific port +* +* @chamelium: Chamelium to use +* @port_id: Port to fetch the resolution +* @x: Out parameter for the width of the signal +* @y: Out parameter for the height of the signal +*/ +void chamelium_v3_port_get_resolution (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id, +int *x,int *y) +{ +xmlrpc_value *res, *res_x, *res_y; + +igt_debug ("RPC DetectResolution(%d)\n" , port_id); + res =__chamelium_rpc (chamelium,"DetectResolution" ,"(i)" , + port_id); + +xmlrpc_array_read_item (&chamelium->env, res,0 , &res_x); +xmlrpc_array_read_item (&chamelium->env, res,1 , &res_y); +xmlrpc_read_int (&chamelium->env, res_x, x); +xmlrpc_read_int (&chamelium->env, res_y, y); + +xmlrpc_DECREF (res_x); +xmlrpc_DECREF (res_y); +xmlrpc_DECREF (res); +} + +/** +* chamelium_v3_port_wait_video_input_stable - Get the resolution of a signal on a specific port +* +* @chamelium: Chamelium to use +* @port_id: Port to fetch the resolution +* @timeout_secs: Timeout to wait before returning +* +* Returns true if a signal is properly detected by the chamelium on the port @port_id +*/ +bool chamelium_v3_port_wait_video_input_stable (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id, +int timeout_secs) +{ +xmlrpc_value *res; +xmlrpc_bool is_on; + +igt_debug ("RPC WaitVideoInputStable(%d, %d)\n" , port_id, timeout_secs); + res =__chamelium_rpc (chamelium,"WaitVideoInputStable" ,"(ii)" , + port_id, timeout_secs); + +xmlrpc_read_bool (&chamelium->env, res, &is_on); +xmlrpc_DECREF (res); + +return is_on; +}
lib/chamelium/v3/igt_chamelium.h +4 -1
@@ -80,5 +80,8 @@ chamelium_edid_id chamelium_v3_create_edid(struct igt_chamelium_v3 *chamelium, const struct edid *edid);void chamelium_v3_apply_edid (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id,chamelium_edid_id edid_id); - +void chamelium_v3_port_get_resolution (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id,int *x,int *y); +bool chamelium_v3_port_wait_video_input_stable (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id,int timeout_secs);#endif //V3_IGT_CHAMELIUM_H
Signature · 1 line
2.44.2
PATCH v2 35/39 tests/chamelium/v3: Implement test for DRM device resolution
In reply to Louis ChauvetThis commit introduces a new test to verify that the resolution listed and used by the DRM device is accurate according to the EDID.
The test is inspired by the v2 version.
--- tests/chamelium/v3/kms_chamelium_v3_edid.c | 104 +++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+)
tests/chamelium/v3/kms_chamelium_v3_edid.c +104 -0
@@ -69,6 +69,90 @@ static void edid_stress_resolution(int drm_fd, struct igt_chamelium_v3 *chameliu } } +static void edid_resolution_list (int drm_fd,struct igt_chamelium_v3 *chamelium, +struct chamelium_v3_port_mapping *port_mapping) +{ +int screen_res_w, screen_res_h; +drmModeConnector *connector; +chamelium_edid_id edid_id; +drmModeModeInfoPtr modes; +struct igt_fb fb = {0 }; +igt_display_t display; +bool is_video_stable; +igt_output_t *output; +igt_plane_t *primary; +int count_modes, i; +enum pipe pipe; +uint32_t connector_id; + +chamelium_v3_reset (chamelium); + + edid_id =chamelium_v3_create_edid (chamelium, +igt_kms_get_custom_edid (IGT_CUSTOM_EDID_BASE )); +chamelium_v3_apply_edid (chamelium, port_mapping->port_id, edid_id); + +chamelium_v3_plug (chamelium, port_mapping->port_id); + + connector_id =chamelium_v3_port_mapping_get_connector_id (port_mapping, drm_fd); +igt_assert (igt_wait_for_connector_status (drm_fd, connector_id,10.0 , +DRM_MODE_CONNECTED )); + + connector =chamelium_v3_port_mapping_get_connector (port_mapping, drm_fd); + modes = connector->modes; + count_modes = connector->count_modes; + +igt_display_require (&display, drm_fd); +igt_require (display.is_atomic); +igt_display_require_output (&display); + +for (i =0 ; i < count_modes; ++i) +igt_debug ("#%d %s %uHz\n" , i, modes[i].name, modes[i].vrefresh); + +for (i =0 ; i < count_modes; ++i) { +igt_info ("Testing #%d %s %uHz\n" , i, modes[i].name, + modes[i].vrefresh); + +igt_display_reset (&display); + + output =igt_output_from_connector (&display, connector); +igt_assert (output); + pipe =igt_get_pipe_for_output (&display, output); +igt_output_set_pipe (output, pipe); + +/* Set the screen mode with the one we chose. */ +igt_create_color_fb (drm_fd, modes[i].hdisplay, modes[i].vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR ,1 ,0 ,0 , &fb); + + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); +igt_assert (primary); + +igt_plane_set_fb (primary, &fb); +igt_fb_set_size (&fb, primary, modes[i].hdisplay, modes[i].vdisplay); +igt_plane_set_size (primary, modes[i].hdisplay, modes[i].vdisplay); + +igt_output_override_mode (output, &modes[i]); + +igt_display_commit2 (output->display,COMMIT_ATOMIC ); + + is_video_stable =chamelium_v3_port_wait_video_input_stable (chamelium, + port_mapping->port_id, +10 ); +igt_assert (is_video_stable); + +chamelium_v3_port_get_resolution (chamelium, port_mapping->port_id, &screen_res_w, + &screen_res_h); +igt_assert_eq (screen_res_w, modes[i].hdisplay); +igt_assert_eq (screen_res_h, modes[i].vdisplay); + +igt_remove_fb (drm_fd, &fb); + } + +igt_modeset_disable_all_outputs (&display); + +igt_display_fini (&display); +drmModeFreeConnector (connector); +} + igt_main {struct igt_chamelium_v3 *chamelium;
@@ -163,6 +247,26 @@ igt_main } } +igt_describe ("Set a basic EDID and check if resolution are correct" ); + igt_subtest_with_dynamic("edid-resolution-list") { +struct chamelium_v3_port_mapping *port, *tmp; + +igt_list_for_each_entry_safe (port, tmp,chamelium_v3_get_port_mapping (chamelium), + link) { + igt_dynamic_f("port-%d", port->port_id) { +char *name; + +igt_require (!chamelium_v3_is_mst (chamelium, port->port_id)); + + name =chamelium_v3_get_port_name (chamelium, port->port_id); +igt_info ("Testing port %s (%s)\n" , port->connector_name, name); +free (name); + +edid_resolution_list (drm_fd, chamelium, port); + } + } + } + igt_fixture {chamelium_v3_uninit (chamelium);drm_close_driver (drm_fd);
Signature · 1 line
2.44.2
PATCH v2 36/39 lib/chamelium/v3: Implement hot plug toggle scheduling method
In reply to Louis ChauvetThis commit adds a new method to the Chameleon V3 wrapper to schedule hot plug detect (HPD) toggle events. This feature is useful for testing suspend and resume behaviors, as it allows the simulation of device connection and disconnection events at specified times.
--- lib/chamelium/v3/igt_chamelium.c | 16 ++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 2 ++ 2 files changed, 18 insertions(+)
lib/chamelium/v3/igt_chamelium.c +16 -0
@@ -1173,3 +1173,19 @@ bool chamelium_v3_port_wait_video_input_stable(struct igt_chamelium_v3 *chameliureturn is_on; } + +/** +* chamelium_v3_schedule_hpd_toggle - Schedule an hotplug detect toggle +* +* @chamelium: Chamelium to use +* @port_id: Port to schedule the hpd toggle +* @delay_ms: Delay before triggering the toggle +* @end_level: HPD status after the toggle, where true is connected +*/ +void chamelium_v3_schedule_hpd_toggle (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id,int delay_ms,bool end_level) +{ +igt_debug ("RPC ScheduleHpdToggle(%d, %d, %d)\n" , port_id, delay_ms, end_level); +xmlrpc_DECREF (__chamelium_rpc (chamelium,"ScheduleHpdToggle" ,"(iib)" , port_id, + delay_ms, end_level)); +}
lib/chamelium/v3/igt_chamelium.h +2 -0
@@ -84,4 +84,6 @@ void chamelium_v3_port_get_resolution(struct igt_chamelium_v3 *chamelium, chamelium_v3_port_id port_id, int *x, int *y);bool chamelium_v3_port_wait_video_input_stable (struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id,int timeout_secs); +void chamelium_v3_schedule_hpd_toggle (struct igt_chamelium_v3 *chamelium, +chamelium_v3_port_id port_id,int delay_ms,bool end_level);#endif //V3_IGT_CHAMELIUM_H
Signature · 1 line
2.44.2
PATCH v2 37/39 tests/chamelium/v3: Add test for display change detection during sleep
In reply to Louis ChauvetThis commit introduces a new test for the Chameleon V3 display adapter to ensure that it properly detects display changes during sleep. The test verifies that if the display is disconnected/reconnected while the device is in sleep mode, the new display is correctly detected upon waking up.
This test is inspired by a similar test in the Chameleon V2 version.
--- tests/chamelium/v3/kms_chamelium_v3_edid.c | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)
tests/chamelium/v3/kms_chamelium_v3_edid.c +59 -0
@@ -153,6 +153,43 @@ static void edid_resolution_list(int drm_fd, struct igt_chamelium_v3 *chamelium,drmModeFreeConnector (connector); } +static void test_suspend_resume_edid_change (int drm_fd,struct igt_chamelium_v3 *chamelium, +struct chamelium_v3_port_mapping *port_mapping, +enum igt_suspend_state state, +enum igt_suspend_test test) +{ +chamelium_edid_id base_edid, alt_edid; +uint32_t connector_id; + +chamelium_v3_reset (chamelium); + + base_edid =chamelium_v3_create_edid (chamelium,igt_kms_get_base_edid ()); +igt_assert (base_edid); + alt_edid =chamelium_v3_create_edid (chamelium,igt_kms_get_alt_edid ()); +igt_assert (alt_edid); + +chamelium_v3_apply_edid (chamelium, port_mapping->port_id, base_edid); +chamelium_v3_plug (chamelium, port_mapping->port_id); + connector_id =chamelium_v3_port_mapping_get_connector_id (port_mapping, drm_fd); +igt_assert (igt_wait_for_connector_status (drm_fd, connector_id,10.0 , +DRM_MODE_CONNECTED )); +collect_and_compare_edid (drm_fd, port_mapping,igt_kms_get_base_edid ()); + +chamelium_v3_apply_edid (chamelium, port_mapping->port_id, alt_edid); + +// Schedule the hpd pulse during the sleep state +chamelium_v3_schedule_hpd_toggle (chamelium, port_mapping->port_id, +igt_get_autoresume_delay (state) *1000 /2 , + true); +igt_system_suspend_autoresume (state, test); + + connector_id =chamelium_v3_port_mapping_get_connector_id (port_mapping, drm_fd); +igt_assert (igt_wait_for_connector_status (drm_fd, connector_id,10.0 , +DRM_MODE_CONNECTED )); + +collect_and_compare_edid (drm_fd, port_mapping,igt_kms_get_alt_edid ()); +} + igt_main {struct igt_chamelium_v3 *chamelium;
@@ -267,6 +304,28 @@ igt_main } } +igt_describe ("Check if hotplug during sleeping are correctly handled" ); + igt_subtest_with_dynamic("edid-edid-suspend-mem") { +struct chamelium_v3_port_mapping *port, *tmp; + +igt_list_for_each_entry_safe (port, tmp,chamelium_v3_get_port_mapping (chamelium), + link) { + igt_dynamic_f("port-%d", port->port_id) { +char *name; + +igt_require (!chamelium_v3_is_mst (chamelium, port->port_id)); + + name =chamelium_v3_get_port_name (chamelium, port->port_id); +igt_info ("Testing port %s (%s)\n" , port->connector_name, name); +free (name); + +test_suspend_resume_edid_change (drm_fd, chamelium, port, +SUSPEND_STATE_MEM , +SUSPEND_TEST_NONE ); + } + } + } + igt_fixture {chamelium_v3_uninit (chamelium);drm_close_driver (drm_fd);
Signature · 1 line
2.44.2
PATCH v2 38/39 tests/chamelium/v3: Add MST EDID reading test
In reply to Louis ChauvetThis commit introduces a new test for the Chameleon V3 display adapter to ensure that EDID is correctly read from MST ports.
--- tests/chamelium/v3/kms_chamelium_v3_edid.c | 86 ++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+)
tests/chamelium/v3/kms_chamelium_v3_edid.c +86 -0
@@ -190,6 +190,70 @@ static void test_suspend_resume_edid_change(int drm_fd, struct igt_chamelium_v3collect_and_compare_edid (drm_fd, port_mapping,igt_kms_get_alt_edid ()); } +static void edid_mst (int drm_fd,struct igt_chamelium_v3 *chamelium,chamelium_v3_port_id port_id) +{ +const struct edid *edid =igt_kms_get_base_edid (); +chamelium_v3_port_id *children_port_ids; +struct chamelium_v3_port_mapping *chamelium_port_mapping; +drmModeResPtr res; +int edid_id; +int children_port_count =chamelium_v3_get_children (chamelium, port_id, + &children_port_ids); + +struct edid **modified_edids; + + modified_edids =calloc (children_port_count +1 ,sizeof (*modified_edids)); +igt_assert (modified_edids); + +for (int i =0 ; i <= children_port_count; i++) { + modified_edids[i] =malloc (edid_get_size (edid)); +memcpy (modified_edids[i], edid,edid_get_size (edid)); + modified_edids[i]->serial[0 ] = i; + modified_edids[i]->serial[1 ] = i; + modified_edids[i]->serial[2 ] = i; + modified_edids[i]->serial[3 ] = i; +edid_update_checksum (modified_edids[i]); + } + +chamelium_v3_reset (chamelium); + + edid_id =chamelium_v3_create_edid (chamelium, modified_edids[0 ]); +igt_assert (edid_id); +chamelium_v3_apply_edid (chamelium, port_id, edid_id); + +for (int i =0 ; i < children_port_count; i++) { + edid_id =chamelium_v3_create_edid (chamelium, modified_edids[i +1 ]); +igt_assert (edid_id); +chamelium_v3_apply_edid (chamelium, children_port_ids[i], edid_id); + } + +chamelium_v3_plug_with_children (chamelium, port_id, children_port_ids, + children_port_count); +sleep (3 ); + + res =drmModeGetResources (drm_fd); + + chamelium_port_mapping =chamelium_v3_get_port_mapping_for_chamelium_port_id (chamelium, + port_id); +igt_assert (chamelium_port_mapping); +igt_assert (chamelium_port_mapping->mst_path); +collect_and_compare_edid (drm_fd, chamelium_port_mapping, modified_edids[0 ]); +free (modified_edids[0 ]); + +for (int i =0 ; i < children_port_count; i++) { + chamelium_port_mapping =chamelium_v3_get_port_mapping_for_chamelium_port_id (chamelium, + children_port_ids[i]); +igt_assert (chamelium_port_mapping); +igt_assert (chamelium_port_mapping->mst_path); +collect_and_compare_edid (drm_fd, chamelium_port_mapping, modified_edids[i +1 ]); +free (modified_edids[i +1 ]); + } + +drmModeFreeResources (res); +free (modified_edids); +free (children_port_ids); +} + igt_main {struct igt_chamelium_v3 *chamelium;
@@ -326,6 +390,28 @@ igt_main } } +igt_describe ("Check if hotplug during sleeping are correctly handled" ); + igt_subtest_with_dynamic("DP-MST-edid-read") { +chamelium_v3_port_id *port_ids; +int port_count; + + port_count =chamelium_v3_get_supported_ports (chamelium, &port_ids); +for (int j =0 ; j < port_count; j++) { + igt_dynamic_f("port-%d", port_ids[j]) { +char *name; + +igt_require (chamelium_v3_is_mst (chamelium, port_ids[j])); + + name =chamelium_v3_get_port_name (chamelium, port_ids[j]); +igt_info ("Testing port %s\n" , name); +free (name); + +edid_mst (drm_fd, chamelium, port_ids[j]); + } + } +free (port_ids); + } + igt_fixture {chamelium_v3_uninit (chamelium);drm_close_driver (drm_fd);
Signature · 1 line
2.44.2
PATCH v2 39/39 docs: Add Chamelium v3
In reply to Louis ChauvetAdd documentation around the Chamelium v3, its new features and its capabilities.
--- docs/chamelium.txt | 90 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 7 deletions(-)
docs/chamelium.txt +83 -7
@@ -19,7 +19,10 @@ part of the ChromeOS effort under the name Chameleon and was later made external as part of the ChromiumOS effort, under the name Chamelium. A new Chamelium V3 (Cv3) was released in 2022, which is built with different -hardware while maintaining software backwards compatibility with v2. +hardware, using almost the same API with chamelium v2. Some features are not +present in the chamelium v3: plug all ports at the same time, take a screen +capture of a small part of the screen, audio recording... The main goal of the +Cv3 is to bring MST support. Chamelium V2 ------------
@@ -41,7 +44,7 @@ While the FPGA is used for logic control, the CPU runs daemons that allow the board to be controlled over the network via a XMLRPC interface. [Current limitation] Cv3 hardware uses an ITE chip which allows only 1 port to -be plugged in a time. This limitation will be fixed in the upcoming iteration. +be plugged in a time. This limitation will be fixed in the upcoming iteration. Chamelium V2 Documentation --------------------------
@@ -50,6 +53,12 @@ Documentation about the Chamelium is made available by Google through the ChromiumOS projet wiki: https://www.chromium.org/chromium-os/developer-library/guides/hardware-schematics/chamelium/ +Chamelium V2 Documentation +-------------------------- + +Documentation about the Cv3 is made available by Google directly in the git +repository: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/chameleon/v3/doc/ + Setting up Chamelium V2 -----------------------
@@ -76,6 +85,16 @@ and then configure eth0 like so: This document supposes that target PC's network IP has "192.168.1.1/24" and the Chamelium's network IP has "192.168.1.2/24". +Setting up Chamelium V3 +----------------------- + +To setup the chamelium software, you can refer to the chamelium documentation: +https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/chameleon/v3/doc/first_boot.md + +Once setup you can define a static IP address with network manager (a nice TUI +is installed: `nmtui`) or use DHCP to set a stable one. It is required as the IGT +tests will need to communicate with the chamelium. + Deploying the Chamelium With IGT --------------------------------
@@ -115,6 +134,16 @@ example (only Chamelium.URL is mandatory): # The URL used for connecting to the Chamelium's RPC server URL=http://192.168.1.2:9992 + +By default, the IGT tests will perform autodiscovery. As it can take some time, you can +manually define a static configuration. This configuration will be trusted by the test +and no autodetection will be performed, so if the physical connexion is not exactly +the same the tests will fail. + +As the Cv3 brings support for MST, two different configuration format are used. + +For chamelium v2: + # The rest of the sections are used for defining connector mappings. This # is optional if the same connector type (ex. DP-DP) is used on both sides, # the mappings will be discovered automatically.
@@ -142,6 +171,38 @@ example (only Chamelium.URL is mandatory): [Chamelium:VGA-1] ChameliumPortID=4 +For chamelium v3: + + # For physical ports + [Chameliumv3:<port_id>] + PortName=<drm connector name> + + # For MST parent ports + [Chameliumv3:<port_id>] + MstPath=<mst path of this port> + + # For MST children ports + [Chameliumv3:<port_id>] + MstPath=<mst path of this port> + ChameliumParentID=<parent id on the chamelium side> + +To generate the Cv3 configuration, you can use this minimal file, the +first chamelium test will perform an autodetection and save the result in igtrc: + + [Chamelium] + # The URL used for connecting to the Chamelium's RPC server + URL=http://192.168.1.2:9992 + ChameliumAutodetectSave=1 + +As the chamelium is also used for emulating display, it can be useful to plug some ports during "normal" testings. To do +so, you have to use the options ConnectOnAnyTest and, if needed, EDID. This does not work yet for MST. + + [Chameliumv3:<port_id>] + PortName=<drm connector name> + ConnectOnAnyTest=true + EDID=<EDID name you want to plug, leave empty to get the list of supported EDID> + + Chamelium V2 Port IDs --------------------- defined at: https://chromium.googlesource.com/chromiumos/platform/chameleon/+/master/chameleond/utils/ids.py
@@ -150,12 +211,27 @@ DP2 (located next to the VGA connector) = 2 HDMI = 3 VGA = 4 -Cv3 Port IDs +Chamelium V3 Port IDs --------------------- -DP1 (top left) = 0 -DP2 (top right) = 1 -HDMI1 (bottom left) = 2 -HDMI2 (bottom right) = 3 + +Four ports are available with the Cv3: 2 DP and 2 HDMI. With MST, 4 more virtual ports +are available. Obviously, as the same physical port is connected to different hardware +emulation, you can't plug all the chamelium ports at the same time. + + +DP1, at the top left, can be used as: +- Physical DP, port_id = 0 +- Emulated DP, port_id = 4 + +DP2, at the top right can be used as: +- Physical DP, port_id = 1 +- MST DP, port_id = 5, and its children 6, 7, 8 + +HDMI1 (bottom left): +- Physical HDMI, port_id = 2 + +HDMI2 (bottom right): +- Physical HDMI, port_id = 3 Running the Chamelium With IGT ------------------------------
Signature · 1 line
2.44.2
Quoted 44 lines · Louis Chauvet
Hi all,
This patch series introduces a new wrapper for the Chameleon v3 board, a testing tool used primarily for Chromebooks, but also by community members to increase test coverage of graphic devices. The Chameleon v3 is an upgrade from its predecessor, with the ability to emulate 2 HDMI and 2 DisplayPort devices, including MST devices.
The board can read and analyze any stream on the DisplayPort and HDMI cables, and even take captures, making it an ideal tool for testing hardware, driver, and user space behavior in specific situations, such as screen hotplugging and multiple MST screens. However, the changes between the v2 and v3, such as the addition of MST support and the removal of CRC for screen captures, would require significant modifications to the existing tests and wrappers.
To avoid this complexity and ensure that the Chameleon v3 is fully supported and the v2 is not broken, I wrote a new wrapper with simplicity and ease of use in mind. The Chameleon v3 wrapper should only manage the Chameleon itself, without the need for DRM displays, EDID caching/modifications, or state machines. This approach will make it easier for developers to use the Chameleon v3 and contribute to its development.
I will use this work to create many new tests (that will come in future series):
- MST managment
- Tiled displays emulation
- Suspend/Resume
- Hardware overlay planesThis series can be divided in multiple parts:
- PATCH 1-5: Adding few helpers toigt_kms
- PATCH 6-10: Add few helpers tominotor_edid
- PATCH 10-14: Split chamelium v2 and chamelium v3 support
- PATCH 15-18: Create a basic test listing available port on the chamelium
- PATCH 19-27: Add port mapping configuration and autodetection
- PATCH 28-38: Add basic EDID tests
- PATCH 39: Add documentationAs most of the series is preparation work, I sent all the patches today, but if required I can split the series in multiple smallest series.
Quoted 6 lines
---
Changes in v2:
- Mainly splitting and cleaning work since the RFC,
EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v1: https://lore.kernel.org/r/[email protected]
Ooops, I forgot to edit this part, sorry
Changes in v2:
- Since the RFC, a lot of work has been done to split commits, document functions, configuration format and cleanup
- Changed the autodetection algorithm to make it a bit faster and less complex
- Introduce new setting to plug specific port during "normal" tests
- Solved build failures, this should be bissectable
Quoted 84 lines
---
Louis Chauvet (39):
lib/igt_kms: Add a detect timeout value
lib/igt_kms: Add helper to wait for a specific status on a connectorlib/igt_kms: Add function to list connected connectors
lib/igt_kms: Add helper to obtain a connector by its name or MST pathlib/igt_kms: Add function to get valid pipe for specific outputlib/monitor_edids: Add helper functions for usingmonitor_edidobjectslib/monitor_edids: Add helper to get an EDID by its namelib/monitor_edids: Add helper to print all available EDID nameslib/monitor_edids: Fix missing names in some monitor EDIDlib/monitor_edids: Add new EDID for HDMI 4k
tests/chamelium: Extract Chamelium v2 tests into a separate directorylib/chamelium/v2: Extract chamelium v2 wrapper into its own directorylib/chamelium/v2: Modify build options to separate Chamelium v2 and v3lib/chamelium/v3: Introduce the foundation for the Chamelium v3 wrapperlib/chamelium/v3: Introduce initialization and cleanup of Chamelium-related structureslib/chamelium/v3: Add method to discover Chamelium portslib/chamelium/v3: Implement method to retrieve Chamelium port names tests/chamelium/v3: Implement a basic Chamelium v3 accessibility testlib/chamelium/v3: Implement Chamelium reinitialization via Reset RPC calllib/chamelium/v3: Implement methods for plugging Chamelium portslib/chamelium/v3: Implement methods for managing Chamelium EDIDlib/chamelium/v3: Implement Chamelium configuration parsinglib/chamelium/v3: Log port mapping for debugging purposeslib/chamelium/v3: Introduce new configuration format for MST supportlib/chamelium/v3: Provide access toport_mappingvia method calllib/chamelium/v3: Implement helper function to get port mapping from Chameleon port idlib/chamelium/v3: Implement helper function to retrieve connector from port mappinglib/chamelium/v3: Plug specific ports for all tests
lib/chamelium/v3: Implement Chamelium port autodetection algorithmlib/chamelium/v3: Add save option to avoid doing autodetection every time tests/chamelium/v3: Implement basic EDID handling test tests/chamelium/v3: Implement 4K EDID stress test
tests/chamelium/v3: Implement non-4K EDID stress test
lib/chamelium/v3: Implement method to discover video signal status tests/chamelium/v3: Implement test for DRM device resolutionlib/chamelium/v3: Implement hot plug toggle scheduling method tests/chamelium/v3: Add test for display change detection during sleep tests/chamelium/v3: Add MST EDID reading test
docs: Add Chamelium v3docs/chamelium.txt | 90 +- docs/testplan/meson.build | 4 +- lib/{ => chamelium/v2}/igt_chamelium.c | 2 +- lib/{ => chamelium/v2}/igt_chamelium.h | 0 lib/{ => chamelium/v2}/igt_chamelium_stream.c | 2 +- lib/{ => chamelium/v2}/igt_chamelium_stream.h | 0 lib/chamelium/v3/igt_chamelium.c | 1191 +++++++++++++++++++++++ lib/chamelium/v3/igt_chamelium.h | 89 ++ lib/igt.h | 6 +- lib/igt_core.c | 3 + lib/igt_kms.c | 287 +++++- lib/igt_kms.h | 17 + lib/meson.build | 16 +- lib/monitor_edids/dp_edids.h | 3 + lib/monitor_edids/hdmi_edids.h | 27 +- lib/monitor_edids/monitor_edids_helper.c | 92 +- lib/monitor_edids/monitor_edids_helper.h | 10 +- lib/tests/meson.build | 8 +- meson.build | 45 +- meson_options.txt | 8 +- tests/chamelium/{ => v2}/kms_chamelium_audio.c | 0 tests/chamelium/{ => v2}/kms_chamelium_color.c | 0 tests/chamelium/{ => v2}/kms_chamelium_edid.c | 2 +- tests/chamelium/{ => v2}/kms_chamelium_frames.c | 0 tests/chamelium/{ => v2}/kms_chamelium_helper.c | 0 tests/chamelium/{ => v2}/kms_chamelium_helper.h | 0 tests/chamelium/{ => v2}/kms_chamelium_hpd.c | 0 tests/chamelium/v3/kms_chamelium_v3_basic.c | 30 + tests/chamelium/v3/kms_chamelium_v3_edid.c | 419 ++++++++ tests/kms_color_helper.h | 2 +- tests/kms_feature_discovery.c | 6 +- tests/kms_tiled_display.c | 6 +- tests/meson.build | 45 +- 33 files changed, 2348 insertions(+), 62 deletions(-)---
base-commit:9683de1314f7fb9204fc4d8baf193a52adda9b59
change-id: 20240522-dev-remove-static-ports-9382ffbbf146Best regards,
Signature · 1 line
Louis Chauvet <[email protected]>
Patchwork
CI✗ Fi.CI.BUILD: failure for tests/chamelium: Integrate the chamelium v3
In reply to Louis Chauvet== Series Details ==
== Series Details ==
Series: tests/chamelium: Integrate the chamelium v3
URL : https://patchwork.freedesktop.org/series/135910/
State : failure
== Summary ==
IGT patchset build failed on latest successful build a7ef4e2bacb168f19605851986629d462b097df6 lib/i915/perf: Add ARL support in IGT perf library
Tail of build.log:
[381/1759] Compiling C object 'lib/76b5a35@@igt-igt_v3d_c@sta/igt_v3d.c.o'.
[382/1759] Compiling C object 'lib/76b5a35@@igt-gpu_cmds_c@sta/gpu_cmds.c.o'.
[383/1759] Compiling C object 'tests/59830eb@@kms_selftest@exe/kms_selftest.c.o'.
[384/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen7_c@sta/rendercopy_gen7.c.o'. [385/1759] Compiling C object 'tests/59830eb@@kms_sysfs_edid_timing@exe/kms_sysfs_edid_timing.c.o'. [386/1759] Compiling C object 'tests/59830eb@@gem_softpin@exe/intel_gem_softpin.c.o'. [387/1759] Compiling C object 'tests/59830eb@@kms_scaling_modes@exe/kms_scaling_modes.c.o'. [388/1759] Compiling C object 'lib/76b5a35@@igt-igt_draw_c@sta/igt_draw.c.o'.
[389/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen6_c@sta/rendercopy_gen6.c.o'. [390/1759] Compiling C object 'lib/76b5a35@@igt-intel_compute_c@sta/intel_compute.c.o'. [391/1759] Compiling C object 'tests/59830eb@@kms_plane_multiple@exe/kms_plane_multiple.c.o'. [392/1759] Compiling C object 'tests/59830eb@@kms_tv_load_detect@exe/kms_tv_load_detect.c.o'. [393/1759] Compiling C object 'tests/59830eb@@kms_rmfb@exe/kms_rmfb.c.o'.
[394/1759] Compiling C object 'tests/59830eb@@kms_plane_cursor@exe/kms_plane_cursor.c.o'. [395/1759] Compiling C object 'tests/59830eb@@kms_plane_lowres@exe/kms_plane_lowres.c.o'. [396/1759] Compiling C object 'lib/76b5a35@@igt-intel_bufops_c@sta/intel_bufops.c.o'. [397/1759] Compiling C object 'tests/59830eb@@kms_pipe_crc_basic@exe/kms_pipe_crc_basic.c.o'. [398/1759] Compiling C object 'lib/76b5a35@@igt-igt_pm_c@sta/igt_pm.c.o'.
[399/1759] Compiling C object 'tests/59830eb@@kms_prop_blob@exe/kms_prop_blob.c.o'.
[400/1759] Compiling C object 'tests/59830eb@@kms_plane_alpha_blend@exe/kms_plane_alpha_blend.c.o'. [401/1759] Compiling C object 'tests/59830eb@@kms_prime@exe/kms_prime.c.o'.
[402/1759] Compiling C object 'lib/76b5a35@@igt-igt_amd_c@sta/igt_amd.c.o'.
[403/1759] Generating i915-perf-registers-acmgt3 with a custom command.
[404/1759] Compiling C object 'lib/76b5a35@@igt-igt_vmwgfx_c@sta/igt_vmwgfx.c.o'.
[405/1759] Compiling C object 'tests/59830eb@@kms_tiled_display@exe/kms_tiled_display.c.o'. [406/1759] Compiling C object 'tests/59830eb@@kms_sequence@exe/kms_sequence.c.o'.
[407/1759] Compiling C object 'tests/59830eb@@gem_concurrent_blit@exe/intel_gem_concurrent_blit.c.o'. [408/1759] Compiling C object 'lib/76b5a35@@xe_oa@sha/meson-generated_.._xe_oa_equations.c.o'. [409/1759] Compiling C object 'tests/59830eb@@kms_flip@exe/kms_flip.c.o'.
[410/1759] Compiling C object 'lib/76b5a35@@igt-intel_blt_c@sta/intel_blt.c.o'.
[411/1759] Compiling C object 'tests/59830eb@@kms_plane@exe/kms_plane.c.o'.
[412/1759] Generating i915-perf-metrics-acmgt3 with a custom command.
[413/1759] Compiling C object 'lib/76b5a35@@igt-igt_kmod_c@sta/igt_kmod.c.o'.
[414/1759] Compiling C object 'tests/59830eb@@kms_properties@exe/kms_properties.c.o'. [415/1759] Compiling C object 'tests/59830eb@@kms_setmode@exe/kms_setmode.c.o'.
[416/1759] Compiling C object 'tests/59830eb@@kms_plane_scaling@exe/kms_plane_scaling.c.o'. [417/1759] Compiling C object 'tests/59830eb@@kms_lease@exe/kms_lease.c.o'.
[418/1759] Compiling C object 'lib/76b5a35@@igt-chamelium_v2_igt_chamelium_c@sta/chamelium_v2_igt_chamelium.c.o'. [419/1759] Compiling C object 'tests/59830eb@@kms_rotation_crc@exe/kms_rotation_crc.c.o'. [420/1759] Compiling C object 'tests/59830eb@@kms_atomic@exe/kms_atomic.c.o'.
[421/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen8_c@sta/rendercopy_gen8.c.o'. [422/1759] Compiling C object 'tests/59830eb@@kms_cursor_legacy@exe/kms_cursor_legacy.c.o'. [423/1759] Compiling C object 'lib/76b5a35@@igt-igt_core_c@sta/igt_core.c.o'.
[424/1759] Compiling C object 'lib/76b5a35@@igt-intel_batchbuffer_c@sta/intel_batchbuffer.c.o'. [425/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen9_c@sta/rendercopy_gen9.c.o'. [426/1759] Compiling C object 'lib/76b5a35@@igt-igt_fb_c@sta/igt_fb.c.o'.
[427/1759] Compiling C object 'lib/76b5a35@@igt-i915_intel_decode_c@sta/i915_intel_decode.c.o'. [428/1759] Compiling C object 'lib/76b5a35@@igt-igt_kms_c@sta/igt_kms.c.o'.
[429/1759] Generating i915-perf-equations with a custom command.
ninja: build stopped: subcommand failed.
Re: ✗ Fi.CI.BUILD: failure for tests/chamelium: Integrate the chamelium v3
Hi all,
It seems like I forgot to include errno.h. Should I send a new version or wait for comments before?
lib/chamelium/v3/igt_chamelium.c +2 -0
@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#include <errno.h> +#include <xmlrpc-c/base.h> #include <xmlrpc-c/client.h>
This morning I attempted to run the CI locally to avoid more errors, it was a bit tricky (gitlab-runner deprecated the exec option to run the CI locally, the images used are in the private docker repository, I had to rebuild docker image myself).
With the following diff, the fedora build seems to pass, but I have some timeout on tests, this timeout is also present on master.
PASS build:tests-fedora PASS build:tests-fedora-no-libunwind PASS build:tests-fedora-oldest-meson PASS build:tests-fedora-no-libdrm-nouveau PASS build:tests-fedora-clang PASS test:list-undocumented-tests PASS test:verify-blacklists FAIL test:ninja-test
Quoted 3 lines
Skipped: 0 Timeout: 1Full log written to /gcl-builds/build/meson-logs/testlog.txt
FAIL test:ninja-test-clang
Quoted 3 lines
Skipped: 0 Timeout: 1Full log written to /gcl-builds/build/meson-logs/testlog.txt
For test:ninja-test
419/431 runner TIMEOUT 300.01 s
For test:ninja-test-clang
419/431 runner TIMEOUT 300.00 s
I am not able to run debian images, I tried to build the Dockerfile, but the debian version seems too old (404 during apt update), and I am not able to fetch prebuild images from gitlab (it seems to require API keys).
I will send a series to explain how to run the CI locally.
Quoted 64 lines
== Series Details ==
Series: tests/chamelium: Integrate the chamelium v3
URL : https://patchwork.freedesktop.org/series/135910/
State : failure== Summary ==
IGT patchset build failed on latest successful build
a7ef4e2bacb168f19605851986629d462b097df6lib/i915/perf: Add ARL support in IGT perf libraryTail of build.log:
[381/1759] Compiling C object 'lib/76b5a35@@igt-igt_v3d_c@sta/igt_v3d.c.o'.
[382/1759] Compiling C object 'lib/76b5a35@@igt-gpu_cmds_c@sta/gpu_cmds.c.o'.
[383/1759] Compiling C object 'tests/59830eb@@kms_selftest@exe/kms_selftest.c.o'.
[384/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen7_c@sta/rendercopy_gen7.c.o'. [385/1759] Compiling C object 'tests/59830eb@@kms_sysfs_edid_timing@exe/kms_sysfs_edid_timing.c.o'. [386/1759] Compiling C object 'tests/59830eb@@gem_softpin@exe/intel_gem_softpin.c.o'. [387/1759] Compiling C object 'tests/59830eb@@kms_scaling_modes@exe/kms_scaling_modes.c.o'. [388/1759] Compiling C object 'lib/76b5a35@@igt-igt_draw_c@sta/igt_draw.c.o'.
[389/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen6_c@sta/rendercopy_gen6.c.o'. [390/1759] Compiling C object 'lib/76b5a35@@igt-intel_compute_c@sta/intel_compute.c.o'. [391/1759] Compiling C object 'tests/59830eb@@kms_plane_multiple@exe/kms_plane_multiple.c.o'. [392/1759] Compiling C object 'tests/59830eb@@kms_tv_load_detect@exe/kms_tv_load_detect.c.o'. [393/1759] Compiling C object 'tests/59830eb@@kms_rmfb@exe/kms_rmfb.c.o'.
[394/1759] Compiling C object 'tests/59830eb@@kms_plane_cursor@exe/kms_plane_cursor.c.o'. [395/1759] Compiling C object 'tests/59830eb@@kms_plane_lowres@exe/kms_plane_lowres.c.o'. [396/1759] Compiling C object 'lib/76b5a35@@igt-intel_bufops_c@sta/intel_bufops.c.o'. [397/1759] Compiling C object 'tests/59830eb@@kms_pipe_crc_basic@exe/kms_pipe_crc_basic.c.o'. [398/1759] Compiling C object 'lib/76b5a35@@igt-igt_pm_c@sta/igt_pm.c.o'.
[399/1759] Compiling C object 'tests/59830eb@@kms_prop_blob@exe/kms_prop_blob.c.o'.
[400/1759] Compiling C object 'tests/59830eb@@kms_plane_alpha_blend@exe/kms_plane_alpha_blend.c.o'. [401/1759] Compiling C object 'tests/59830eb@@kms_prime@exe/kms_prime.c.o'.
[402/1759] Compiling C object 'lib/76b5a35@@igt-igt_amd_c@sta/igt_amd.c.o'.
[403/1759] Generating i915-perf-registers-acmgt3 with a custom command.
[404/1759] Compiling C object 'lib/76b5a35@@igt-igt_vmwgfx_c@sta/igt_vmwgfx.c.o'.
[405/1759] Compiling C object 'tests/59830eb@@kms_tiled_display@exe/kms_tiled_display.c.o'. [406/1759] Compiling C object 'tests/59830eb@@kms_sequence@exe/kms_sequence.c.o'.
[407/1759] Compiling C object 'tests/59830eb@@gem_concurrent_blit@exe/intel_gem_concurrent_blit.c.o'. [408/1759] Compiling C object 'lib/76b5a35@@xe_oa@sha/meson-generated_.._xe_oa_equations.c.o'. [409/1759] Compiling C object 'tests/59830eb@@kms_flip@exe/kms_flip.c.o'.
[410/1759] Compiling C object 'lib/76b5a35@@igt-intel_blt_c@sta/intel_blt.c.o'.
[411/1759] Compiling C object 'tests/59830eb@@kms_plane@exe/kms_plane.c.o'.
[412/1759] Generating i915-perf-metrics-acmgt3 with a custom command.
[413/1759] Compiling C object 'lib/76b5a35@@igt-igt_kmod_c@sta/igt_kmod.c.o'.
[414/1759] Compiling C object 'tests/59830eb@@kms_properties@exe/kms_properties.c.o'. [415/1759] Compiling C object 'tests/59830eb@@kms_setmode@exe/kms_setmode.c.o'.
[416/1759] Compiling C object 'tests/59830eb@@kms_plane_scaling@exe/kms_plane_scaling.c.o'. [417/1759] Compiling C object 'tests/59830eb@@kms_lease@exe/kms_lease.c.o'.
[418/1759] Compiling C object 'lib/76b5a35@@igt-chamelium_v2_igt_chamelium_c@sta/chamelium_v2_igt_chamelium.c.o'. [419/1759] Compiling C object 'tests/59830eb@@kms_rotation_crc@exe/kms_rotation_crc.c.o'. [420/1759] Compiling C object 'tests/59830eb@@kms_atomic@exe/kms_atomic.c.o'.
[421/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen8_c@sta/rendercopy_gen8.c.o'. [422/1759] Compiling C object 'tests/59830eb@@kms_cursor_legacy@exe/kms_cursor_legacy.c.o'. [423/1759] Compiling C object 'lib/76b5a35@@igt-igt_core_c@sta/igt_core.c.o'.
[424/1759] Compiling C object 'lib/76b5a35@@igt-intel_batchbuffer_c@sta/intel_batchbuffer.c.o'. [425/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen9_c@sta/rendercopy_gen9.c.o'. [426/1759] Compiling C object 'lib/76b5a35@@igt-igt_fb_c@sta/igt_fb.c.o'.
[427/1759] Compiling C object 'lib/76b5a35@@igt-i915_intel_decode_c@sta/i915_intel_decode.c.o'. [428/1759] Compiling C object 'lib/76b5a35@@igt-igt_kms_c@sta/igt_kms.c.o'.
[429/1759] Generating i915-perf-equations with a custom command.
ninja: build stopped: subcommand failed.
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: ✗ Fi.CI.BUILD: failure for tests/chamelium: Integrate the chamelium v3
Hi Louis,
Quoted 45 lines · Louis Chauvet
Hi all,
It seems like I forgot to include
errno.h. Should I send a new version or wait for comments before?lib/chamelium/v3/igt_chamelium.c +2
-0@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#include <errno.h> +#include <xmlrpc-c/base.h> #include <xmlrpc-c/client.h> This morning I attempted to run the CI locally to avoid more errors, it was a bit tricky (gitlab-runner deprecated the exec option to run the CI locally, the images used are in the private docker repository, I had to rebuild docker image myself).
With the following diff, the fedora build seems to pass, but I have some timeout on tests, this timeout is also present on master.
PASS build:tests-fedora PASS build:tests-fedora-no-libunwind PASS build:tests-fedora-oldest-meson PASS build:tests-fedora-no-libdrm-nouveau PASS build:tests-fedora-clang PASS test:list-undocumented-tests PASS test:verify-blacklists FAIL test:ninja-testQuoted 3 lines
Skipped: 0 Timeout: 1Full log written to /gcl-builds/build/meson-logs/testlog.txt
FAIL test:ninja-test-clang
Quoted 3 lines
Skipped: 0 Timeout: 1Full log written to /gcl-builds/build/meson-logs/testlog.txt
For test:ninja-test
419/431 runner TIMEOUT 300.01 s
Quoted 6 lines
For test:ninja-test-clang
419/431 runner TIMEOUT 300.00 sI am not able to run debian images, I tried to build the Dockerfile, but the debian version seems too old (404 during apt update), and I am not able to fetch prebuild images from gitlab (it seems to require API keys).
Thanks for this series.
I'm able to add your patches in a test branch and build it in drm-ci using debian images. There are some failures seen in lib/igt_kms.c and I sent some review comments for your patches. Please could you send an updated series. Thank you.
Regards,
Vignesh
Quoted 68 lines
I will send a series to explain how to run the CI locally.
Quoted 64 lines
== Series Details ==
Series: tests/chamelium: Integrate the chamelium v3
URL : https://patchwork.freedesktop.org/series/135910/
State : failure== Summary ==
IGT patchset build failed on latest successful build
a7ef4e2bacb168f19605851986629d462b097df6lib/i915/perf: Add ARL support in IGT perf libraryTail of build.log:
[381/1759] Compiling C object 'lib/76b5a35@@igt-igt_v3d_c@sta/igt_v3d.c.o'.
[382/1759] Compiling C object 'lib/76b5a35@@igt-gpu_cmds_c@sta/gpu_cmds.c.o'.
[383/1759] Compiling C object 'tests/59830eb@@kms_selftest@exe/kms_selftest.c.o'.
[384/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen7_c@sta/rendercopy_gen7.c.o'. [385/1759] Compiling C object 'tests/59830eb@@kms_sysfs_edid_timing@exe/kms_sysfs_edid_timing.c.o'. [386/1759] Compiling C object 'tests/59830eb@@gem_softpin@exe/intel_gem_softpin.c.o'. [387/1759] Compiling C object 'tests/59830eb@@kms_scaling_modes@exe/kms_scaling_modes.c.o'. [388/1759] Compiling C object 'lib/76b5a35@@igt-igt_draw_c@sta/igt_draw.c.o'.
[389/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen6_c@sta/rendercopy_gen6.c.o'. [390/1759] Compiling C object 'lib/76b5a35@@igt-intel_compute_c@sta/intel_compute.c.o'. [391/1759] Compiling C object 'tests/59830eb@@kms_plane_multiple@exe/kms_plane_multiple.c.o'. [392/1759] Compiling C object 'tests/59830eb@@kms_tv_load_detect@exe/kms_tv_load_detect.c.o'. [393/1759] Compiling C object 'tests/59830eb@@kms_rmfb@exe/kms_rmfb.c.o'.
[394/1759] Compiling C object 'tests/59830eb@@kms_plane_cursor@exe/kms_plane_cursor.c.o'. [395/1759] Compiling C object 'tests/59830eb@@kms_plane_lowres@exe/kms_plane_lowres.c.o'. [396/1759] Compiling C object 'lib/76b5a35@@igt-intel_bufops_c@sta/intel_bufops.c.o'. [397/1759] Compiling C object 'tests/59830eb@@kms_pipe_crc_basic@exe/kms_pipe_crc_basic.c.o'. [398/1759] Compiling C object 'lib/76b5a35@@igt-igt_pm_c@sta/igt_pm.c.o'.
[399/1759] Compiling C object 'tests/59830eb@@kms_prop_blob@exe/kms_prop_blob.c.o'.
[400/1759] Compiling C object 'tests/59830eb@@kms_plane_alpha_blend@exe/kms_plane_alpha_blend.c.o'. [401/1759] Compiling C object 'tests/59830eb@@kms_prime@exe/kms_prime.c.o'.
[402/1759] Compiling C object 'lib/76b5a35@@igt-igt_amd_c@sta/igt_amd.c.o'.
[403/1759] Generating i915-perf-registers-acmgt3 with a custom command.
[404/1759] Compiling C object 'lib/76b5a35@@igt-igt_vmwgfx_c@sta/igt_vmwgfx.c.o'.
[405/1759] Compiling C object 'tests/59830eb@@kms_tiled_display@exe/kms_tiled_display.c.o'. [406/1759] Compiling C object 'tests/59830eb@@kms_sequence@exe/kms_sequence.c.o'.
[407/1759] Compiling C object 'tests/59830eb@@gem_concurrent_blit@exe/intel_gem_concurrent_blit.c.o'. [408/1759] Compiling C object 'lib/76b5a35@@xe_oa@sha/meson-generated_.._xe_oa_equations.c.o'. [409/1759] Compiling C object 'tests/59830eb@@kms_flip@exe/kms_flip.c.o'.
[410/1759] Compiling C object 'lib/76b5a35@@igt-intel_blt_c@sta/intel_blt.c.o'.
[411/1759] Compiling C object 'tests/59830eb@@kms_plane@exe/kms_plane.c.o'.
[412/1759] Generating i915-perf-metrics-acmgt3 with a custom command.
[413/1759] Compiling C object 'lib/76b5a35@@igt-igt_kmod_c@sta/igt_kmod.c.o'.
[414/1759] Compiling C object 'tests/59830eb@@kms_properties@exe/kms_properties.c.o'. [415/1759] Compiling C object 'tests/59830eb@@kms_setmode@exe/kms_setmode.c.o'.
[416/1759] Compiling C object 'tests/59830eb@@kms_plane_scaling@exe/kms_plane_scaling.c.o'. [417/1759] Compiling C object 'tests/59830eb@@kms_lease@exe/kms_lease.c.o'.
[418/1759] Compiling C object 'lib/76b5a35@@igt-chamelium_v2_igt_chamelium_c@sta/chamelium_v2_igt_chamelium.c.o'. [419/1759] Compiling C object 'tests/59830eb@@kms_rotation_crc@exe/kms_rotation_crc.c.o'. [420/1759] Compiling C object 'tests/59830eb@@kms_atomic@exe/kms_atomic.c.o'.
[421/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen8_c@sta/rendercopy_gen8.c.o'. [422/1759] Compiling C object 'tests/59830eb@@kms_cursor_legacy@exe/kms_cursor_legacy.c.o'. [423/1759] Compiling C object 'lib/76b5a35@@igt-igt_core_c@sta/igt_core.c.o'.
[424/1759] Compiling C object 'lib/76b5a35@@igt-intel_batchbuffer_c@sta/intel_batchbuffer.c.o'. [425/1759] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen9_c@sta/rendercopy_gen9.c.o'. [426/1759] Compiling C object 'lib/76b5a35@@igt-igt_fb_c@sta/igt_fb.c.o'.
[427/1759] Compiling C object 'lib/76b5a35@@igt-i915_intel_decode_c@sta/i915_intel_decode.c.o'. [428/1759] Compiling C object 'lib/76b5a35@@igt-igt_kms_c@sta/igt_kms.c.o'.
[429/1759] Generating i915-perf-equations with a custom command.
ninja: build stopped: subcommand failed.
Patchwork
CI✗ GitLab.Pipeline: warning for tests/chamelium: Integrate the chamelium v3
In reply to Louis Chauvet== Series Details ==
== Series Details ==
Series: tests/chamelium: Integrate the chamelium v3
URL : https://patchwork.freedesktop.org/series/135910/
State : warning
== Summary ==
Pipeline status: FAILED.
see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1220486 for the overview.
build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/60848890):
#include "igt_kms.h"
../lib/chamelium/v3/igt_chamelium.c:164:4:
errno = 0;
^~~~~
../lib/chamelium/v3/igt_chamelium.c:164:4: note: each undeclared identifier is reported only once for each function it appears in
../lib/chamelium/v3/igt_chamelium.c: In function ‘chamelium_v3_fill_port_mapping_from_config_v3’:
../lib/chamelium/v3/igt_chamelium.c:223:4: error: ‘errno’ undeclared (first use in this function)
errno = 0;
^~~~~
../lib/chamelium/v3/igt_chamelium.c:223:4: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
../lib/chamelium/v3/igt_chamelium.c:231:24: error: ‘ERANGE’ undeclared (first use in this function)
} else if (errno == ERANGE) {
^~~~~~ ninja: build stopped: subcommand failed. section_end:1720541868:step_script section_start:1720541868:cleanup_file_variables Cleaning up project directory and file based variables section_end:1720541869:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/60848885):
+++ |+#include <errno.h>
10 | #include "igt_kms.h"
../lib/chamelium/v3/igt_chamelium.c:164:4: note: each undeclared identifier is reported only once for each function it appears in
164 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c: In function ‘chamelium_v3_fill_port_mapping_from_config_v3’:
../lib/chamelium/v3/igt_chamelium.c:223:4: error: ‘errno’ undeclared (first use in this function)
223 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c:223:4: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
../lib/chamelium/v3/igt_chamelium.c:231:24: error: ‘ERANGE’ undeclared (first use in this function)
231 | } else if (errno == ERANGE) {
| ^~~~~~ ninja: build stopped: subcommand failed. section_end:1720541858:step_script section_start:1720541858:cleanup_file_variables Cleaning up project directory and file based variables section_end:1720541859:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/60848889):
errno = 0;
^
../lib/chamelium/v3/igt_chamelium.c:231:15: error: use of undeclared identifier 'errno'; did you mean 'error'?
} else if (errno == ERANGE) {
^~~~~
error
../lib/chamelium/v3/igt_chamelium.c:219:12: note: 'error' declared here
GError *error = NULL;
^
../lib/chamelium/v3/igt_chamelium.c:231:24: error: use of undeclared identifier 'ERANGE'
} else if (errno == ERANGE) {
^ 4 errors generated.
ninja: build stopped: subcommand failed. section_end:1720541870:step_script section_start:1720541870:cleanup_file_variables Cleaning up project directory and file based variables section_end:1720541870:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libdrm-nouveau has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/60848888):
+++ |+#include <errno.h>
10 | #include "igt_kms.h"
../lib/chamelium/v3/igt_chamelium.c:164:4: note: each undeclared identifier is reported only once for each function it appears in
164 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c: In function ‘chamelium_v3_fill_port_mapping_from_config_v3’:
../lib/chamelium/v3/igt_chamelium.c:223:4: error: ‘errno’ undeclared (first use in this function)
223 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c:223:4: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
../lib/chamelium/v3/igt_chamelium.c:231:24: error: ‘ERANGE’ undeclared (first use in this function)
231 | } else if (errno == ERANGE) {
| ^~~~~~ ninja: build stopped: subcommand failed. section_end:1720541872:step_script section_start:1720541872:cleanup_file_variables Cleaning up project directory and file based variables section_end:1720541873:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/60848886):
+++ |+#include <errno.h>
10 | #include "igt_kms.h"
../lib/chamelium/v3/igt_chamelium.c:164:4: note: each undeclared identifier is reported only once for each function it appears in
164 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c: In function ‘chamelium_v3_fill_port_mapping_from_config_v3’:
../lib/chamelium/v3/igt_chamelium.c:223:4: error: ‘errno’ undeclared (first use in this function)
223 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c:223:4: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
../lib/chamelium/v3/igt_chamelium.c:231:24: error: ‘ERANGE’ undeclared (first use in this function)
231 | } else if (errno == ERANGE) {
| ^~~~~~ ninja: build stopped: subcommand failed. section_end:1720541855:step_script section_start:1720541855:cleanup_file_variables Cleaning up project directory and file based variables section_end:1720541856:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/60848887):
+++ |+#include <errno.h>
10 | #include "igt_kms.h"
../lib/chamelium/v3/igt_chamelium.c:164:4: note: each undeclared identifier is reported only once for each function it appears in
164 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c: In function ‘chamelium_v3_fill_port_mapping_from_config_v3’:
../lib/chamelium/v3/igt_chamelium.c:223:4: error: ‘errno’ undeclared (first use in this function)
223 | errno = 0;
| ^~~~~
../lib/chamelium/v3/igt_chamelium.c:223:4: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
../lib/chamelium/v3/igt_chamelium.c:231:24: error: ‘ERANGE’ undeclared (first use in this function)
231 | } else if (errno == ERANGE) {
| ^~~~~~ ninja: build stopped: subcommand failed. section_end:1720541853:step_script section_start:1720541853:cleanup_file_variables Cleaning up project directory and file based variables section_end:1720541854:cleanup_file_variables
ERROR: Job failed: exit code 1
== Logs ==
For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1220486