From 3728d7e99b88ca71980f7f732ce3f5d1ba7cf1c2 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 31 Aug 2023 14:32:07 +0300 Subject: [PATCH] backend-drm,pipewire,remoting: do not set monitor serial to "unknown" If serial is unknown, it's best to leave it as NULL. All usage sites already deal with it possibly being NULL. This makes DRM-backend consistent with all other backend that leave serial as NULL, allowing to move the initialization of these fields into core. Pipewire and remoting plugins are modified just for consistency. Signed-off-by: Pekka Paalanen --- libweston/backend-drm/modes.c | 2 +- pipewire/pipewire-plugin.c | 3 +-- remoting/remoting-plugin.c | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libweston/backend-drm/modes.c b/libweston/backend-drm/modes.c index 901372bb..37a10559 100644 --- a/libweston/backend-drm/modes.c +++ b/libweston/backend-drm/modes.c @@ -601,7 +601,7 @@ update_head_from_connector(struct drm_head *head) weston_head_set_monitor_strings(&head->base, dhi.make ?: "unknown", dhi.model ?: "unknown", - dhi.serial_number ?: "unknown"); + dhi.serial_number); prune_eotf_modes_by_kms_support(head, &dhi.eotf_mask); weston_head_set_supported_eotf_mask(&head->base, dhi.eotf_mask); diff --git a/pipewire/pipewire-plugin.c b/pipewire/pipewire-plugin.c index cb07521a..3ab279b3 100644 --- a/pipewire/pipewire-plugin.c +++ b/pipewire/pipewire-plugin.c @@ -524,7 +524,6 @@ pipewire_output_create(struct weston_compositor *c, char *name) const struct weston_drm_virtual_output_api *api; const char *make = "Weston"; const char *model = "Virtual Display"; - const char *serial_number = "unknown"; const char *connector_name = "pipewire"; char *remoting_name; @@ -566,7 +565,7 @@ pipewire_output_create(struct weston_compositor *c, char *name) str_printf(&remoting_name, "%s-%s", connector_name, name); weston_head_init(head, remoting_name); weston_head_set_subpixel(head, WL_OUTPUT_SUBPIXEL_NONE); - weston_head_set_monitor_strings(head, make, model, serial_number); + weston_head_set_monitor_strings(head, make, model, NULL); head->compositor = c; output->head = head; diff --git a/remoting/remoting-plugin.c b/remoting/remoting-plugin.c index 4d4dea7e..b517ee70 100644 --- a/remoting/remoting-plugin.c +++ b/remoting/remoting-plugin.c @@ -752,7 +752,6 @@ remoting_output_create(struct weston_compositor *c, char *name) const struct weston_drm_virtual_output_api *api; const char *make = "Renesas"; const char *model = "Virtual Display"; - const char *serial_number = "unknown"; const char *connector_name = "remoting"; char *remoting_name; @@ -790,7 +789,7 @@ remoting_output_create(struct weston_compositor *c, char *name) str_printf(&remoting_name, "%s-%s", connector_name, name); weston_head_init(head, remoting_name); weston_head_set_subpixel(head, WL_OUTPUT_SUBPIXEL_NONE); - weston_head_set_monitor_strings(head, make, model, serial_number); + weston_head_set_monitor_strings(head, make, model, NULL); head->compositor = c; weston_output_attach_head(output->output, head);