[PATCH i-g-t 2/2] tests/chamelium/kms_chamelium_color: print output name in assert
Kunal Joshi
kunal1.joshi at intel.com
Tue Apr 15 06:37:42 UTC 2025
Print output name in assert
v2: print output name for better log readability (Swati)
Cc: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Cc: Karthik B S <karthik.b.s at intel.com>
Cc: Swati Sharma <swati2.sharma at intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
---
lib/igt_chamelium.c | 62 --------------------------
lib/igt_chamelium.h | 64 ++++++++++++++++++++++++---
lib/intel_compute.c | 2 +
tests/chamelium/kms_chamelium_color.c | 2 +-
4 files changed, 61 insertions(+), 69 deletions(-)
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index a96e36b5b..87ac1a1ca 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -24,28 +24,7 @@
* Lyude Paul <lyude at redhat.com>
*/
-#include "config.h"
-
-#include <stdbool.h>
-#include <string.h>
-#include <errno.h>
-#include <math.h>
-#include <xmlrpc-c/base.h>
-#include <xmlrpc-c/client.h>
-#include <pthread.h>
-#include <glib.h>
-#include <pixman.h>
-#include <cairo.h>
-
#include "igt_chamelium.h"
-#include "igt_core.h"
-#include "igt_aux.h"
-#include "igt_edid.h"
-#include "igt_frame.h"
-#include "igt_list.h"
-#include "igt_kms.h"
-#include "igt_pipe_crc.h"
-#include "igt_rc.h"
/**
* SECTION:igt_chamelium
@@ -90,47 +69,6 @@
* Especially with modern, more complex hardware where we may have LSPcons and
* USB controllers in the way.
*/
-#define CHAMELIUM_HOTPLUG_DETECTION_DELAY 10
-
-struct chamelium_port {
- unsigned int type;
- int id;
- int connector_id;
- char *name;
- bool adapter_allowed;
- char *connector_path;
- bool is_mapped;
-};
-
-struct chamelium_frame_dump {
- unsigned char *bgr;
- size_t size;
- int width;
- int height;
- struct chamelium_port *port;
-};
-
-struct chamelium_fb_crc_async_data {
- cairo_surface_t *fb_surface;
-
- pthread_t thread_id;
- igt_crc_t *ret;
-};
-
-struct chamelium {
- xmlrpc_env env;
- xmlrpc_client *client;
- char *url;
-
- /* Indicates the last port to have been used for capturing video */
- struct chamelium_port *capturing_port;
-
- int drm_fd;
-
- struct igt_list_head edids;
- struct chamelium_port ports[CHAMELIUM_MAX_PORTS];
- int port_count;
-};
bool igt_chamelium_allow_fsm_handling = true;
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index 8882e13fb..b2b97434f 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -28,23 +28,35 @@
#include "config.h"
-#include <stdbool.h>
+#include <cairo.h>
+#include <errno.h>
+#include <glib.h>
+#include <math.h>
+#include <pixman.h>
+#include <pthread.h>
#include <stddef.h>
+#include <stdbool.h>
+#include <string.h>
#include <xf86drmMode.h>
+#include <xmlrpc-c/base.h>
+#include <xmlrpc-c/client.h>
+#include "igt_aux.h"
+#include "igt_core.h"
#include "igt_debugfs.h"
+#include "igt_edid.h"
+#include "igt_frame.h"
#include "igt_kms.h"
#include "igt_list.h"
+#include "igt_pipe_crc.h"
+#include "igt_rc.h"
+
+#define CHAMELIUM_HOTPLUG_DETECTION_DELAY 10
struct igt_fb;
struct edid;
typedef struct _igt_crc igt_crc_t;
-struct chamelium;
-struct chamelium_port;
-struct chamelium_frame_dump;
-struct chamelium_fb_crc_async_data;
-
/**
* chamelium_check:
* @CHAMELIUM_CHECK_ANALOG: Fuzzy checking method for analog interfaces
@@ -107,6 +119,46 @@ extern bool igt_chamelium_allow_fsm_handling;
#define CHAMELIUM_HOTPLUG_TIMEOUT 20 /* seconds */
+struct chamelium_port {
+ unsigned int type;
+ int id;
+ int connector_id;
+ char *name;
+ bool adapter_allowed;
+ char *connector_path;
+ bool is_mapped;
+};
+
+struct chamelium_frame_dump {
+ unsigned char *bgr;
+ size_t size;
+ int width;
+ int height;
+ struct chamelium_port *port;
+};
+
+struct chamelium_fb_crc_async_data {
+ cairo_surface_t *fb_surface;
+
+ pthread_t thread_id;
+ igt_crc_t *ret;
+};
+
+struct chamelium {
+ xmlrpc_env env;
+ xmlrpc_client *client;
+ char *url;
+
+ /* Indicates the last port to have been used for capturing video */
+ struct chamelium_port *capturing_port;
+
+ int drm_fd;
+
+ struct igt_list_head edids;
+ struct chamelium_port ports[CHAMELIUM_MAX_PORTS];
+ int port_count;
+};
+
/**
* chamelium_edid:
* @chamelium: instance of the chamelium where the EDID will be applied
diff --git a/lib/intel_compute.c b/lib/intel_compute.c
index 825bfb110..827b72f54 100644
--- a/lib/intel_compute.c
+++ b/lib/intel_compute.c
@@ -22,7 +22,9 @@
#define PIPE_CONTROL 0x7a000004
#define MEDIA_STATE_FLUSH 0x0
+#ifndef MAX
#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
+#endif
#define SIZE_DATA 64
#define SIZE_BATCH 0x10000
#define SIZE_BUFFER_INPUT MAX(sizeof(float) * SIZE_DATA, 0x10000)
diff --git a/tests/chamelium/kms_chamelium_color.c b/tests/chamelium/kms_chamelium_color.c
index bf6510969..88b3717d4 100644
--- a/tests/chamelium/kms_chamelium_color.c
+++ b/tests/chamelium/kms_chamelium_color.c
@@ -758,7 +758,7 @@ igt_main
igt_assert_f(chamelium_reprobe_connector(&data.display,
data.chamelium,
data.ports[i]) == DRM_MODE_CONNECTED,
- "Output not connected\n");
+ "%s not connected\n", data.chamelium->ports[i].name);
}
kmstest_set_vt_graphics_mode();
--
2.25.1
More information about the igt-dev
mailing list