summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>2020-06-24 11:11:30 +0530
committerRamalingam C <ramalingam.c@intel.com>2020-06-26 14:36:44 +0530
commitaf1ef32bfae90bcdbaf1b5d84c61ff4e04368505 (patch)
tree7a7b85fa43e624fee822633bc669569569da836b /lib
parent66e2683a03a62828d3480dd0f6f235a72a34ff8c (diff)
lib: Use generic names for APIs that handle uevents
The functions for handling uevents are named with "_hotplug" as suffix such as igt_watch_hotplug(). Earlier hotplug was the only uevent that was requested to be detected, but in fact, these APIs are generic and can be used for detecting other uevents too. Currently we have tests like kms_lease, kms_content_protection using the uevent handling infrastructure for detecting uevents other than hotplug. This patch renames the functions and replace the "_hotplug" suffix with "_uevents". v2: Rebase v3: Added changes in lib igt_chamelium.c, that was missed earlier. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Suggested-by: Ramalingam C <ramalingam.c@intel.com> Suggested-by: Hiler, Arkadiusz <arkadiusz.hiler@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_chamelium.c4
-rw-r--r--lib/igt_kms.c30
-rw-r--r--lib/igt_kms.h6
3 files changed, 20 insertions, 20 deletions
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index ed92bc782..58e01ab72 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -330,7 +330,7 @@ static xmlrpc_value *__chamelium_rpc_va(struct chamelium *chamelium,
if (fsm_port) {
monitor_args.chamelium = chamelium;
monitor_args.port = fsm_port;
- monitor_args.mon = igt_watch_hotplug();
+ monitor_args.mon = igt_watch_uevents();
pthread_create(&fsm_thread_id, NULL, chamelium_fsm_mon,
&monitor_args);
}
@@ -358,7 +358,7 @@ static xmlrpc_value *__chamelium_rpc_va(struct chamelium *chamelium,
if (fsm_port) {
pthread_cancel(fsm_thread_id);
pthread_join(fsm_thread_id, NULL);
- igt_cleanup_hotplug(monitor_args.mon);
+ igt_cleanup_uevents(monitor_args.mon);
}
return res;
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 1af74d081..27f85859b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -4156,13 +4156,13 @@ void igt_reset_connectors(void)
}
/**
- * igt_watch_hotplug:
+ * igt_watch_uevents:
*
- * Begin monitoring udev for sysfs hotplug events.
+ * Begin monitoring udev for sysfs uevents.
*
- * Returns: a udev monitor for detecting hotplugs on
+ * Returns: a udev monitor for detecting uevents on
*/
-struct udev_monitor *igt_watch_hotplug(void)
+struct udev_monitor *igt_watch_uevents(void)
{
struct udev *udev;
struct udev_monitor *mon;
@@ -4230,7 +4230,7 @@ bool event_detected(struct udev_monitor *mon, int timeout_secs,
/**
* igt_connector_event_detected:
- * @mon: A udev monitor initialized with #igt_watch_hotplug
+ * @mon: A udev monitor initialized with #igt_watch_uevents
* @conn_id: Connector id of the Connector for which the property change is
* expected.
* @prop_id: Property id for which the change is expected.
@@ -4252,7 +4252,7 @@ bool igt_connector_event_detected(struct udev_monitor *mon, uint32_t conn_id,
/**
* igt_hotplug_detected:
- * @mon: A udev monitor initialized with #igt_watch_hotplug
+ * @mon: A udev monitor initialized with #igt_watch_uevents
* @timeout_secs: How long to wait for a hotplug event to occur.
*
* Detect if a hotplug event was received since we last checked the monitor.
@@ -4270,7 +4270,7 @@ bool igt_hotplug_detected(struct udev_monitor *mon, int timeout_secs)
/**
* igt_lease_change_detected:
- * @mon: A udev monitor initialized with #igt_watch_hotplug
+ * @mon: A udev monitor initialized with #igt_watch_uevents
* @timeout_secs: How long to wait for a lease change event to occur.
*
* Detect if a lease change event was received since we last checked the monitor.
@@ -4287,12 +4287,12 @@ bool igt_lease_change_detected(struct udev_monitor *mon, int timeout_secs)
}
/**
- * igt_flush_hotplugs:
- * @mon: A udev monitor initialized with #igt_watch_hotplug
+ * igt_flush_uevents:
+ * @mon: A udev monitor initialized with #igt_watch_uevents
*
- * Get rid of any pending hotplug events
+ * Get rid of any pending uevents
*/
-void igt_flush_hotplugs(struct udev_monitor *mon)
+void igt_flush_uevents(struct udev_monitor *mon)
{
struct udev_device *dev;
@@ -4301,12 +4301,12 @@ void igt_flush_hotplugs(struct udev_monitor *mon)
}
/**
- * igt_cleanup_hotplug:
- * @mon: A udev monitor initialized with #igt_watch_hotplug
+ * igt_cleanup_uevents:
+ * @mon: A udev monitor initialized with #igt_watch_uevents
*
- * Cleanup the resources allocated by #igt_watch_hotplug
+ * Cleanup the resources allocated by #igt_watch_uevents
*/
-void igt_cleanup_hotplug(struct udev_monitor *mon)
+void igt_cleanup_uevents(struct udev_monitor *mon)
{
struct udev *udev = udev_monitor_get_udev(mon);
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 539f6c5ae..416e737c9 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -774,15 +774,15 @@ const struct edid *igt_kms_get_dp_audio_edid(void);
const struct edid *igt_kms_get_4k_edid(void);
const struct edid *igt_kms_get_3d_edid(void);
-struct udev_monitor *igt_watch_hotplug(void);
+struct udev_monitor *igt_watch_uevents(void);
bool igt_hotplug_detected(struct udev_monitor *mon,
int timeout_secs);
bool igt_lease_change_detected(struct udev_monitor *mon,
int timeout_secs);
bool igt_connector_event_detected(struct udev_monitor *mon, uint32_t conn_id,
uint32_t prop_id, int timeout_msecs);
-void igt_flush_hotplugs(struct udev_monitor *mon);
-void igt_cleanup_hotplug(struct udev_monitor *mon);
+void igt_flush_uevents(struct udev_monitor *mon);
+void igt_cleanup_uevents(struct udev_monitor *mon);
bool igt_display_has_format_mod(igt_display_t *display, uint32_t format, uint64_t modifier);
bool igt_plane_has_format_mod(igt_plane_t *plane, uint32_t format, uint64_t modifier);