aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-11 19:09:34 +0100
committeremersion <contact@emersion.fr>2017-11-11 19:09:34 +0100
commit09279b90a63c5fdb2e28a61f2dfc936285126177 (patch)
treea6f72b67564c0e0552f3cd9a5eaf81c158197558 /backend
parent2bee288090d930a09be5f9176a519c1ec02c63de (diff)
Add wlr_output.serial
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/drm/util.c b/backend/drm/util.c
index 656c070a..c27d7b67 100644
--- a/backend/drm/util.c
+++ b/backend/drm/util.c
@@ -106,8 +106,15 @@ void parse_edid(struct wlr_output *restrict output, size_t len, const uint8_t *d
if (nl) {
*nl = '\0';
}
+ } else if (flag == 0 && data[i + 3] == 0xFF) {
+ sprintf(output->serial, "%.13s", &data[i + 5]);
- break;
+ // Monitor serial numbers are terminated by newline if they're too
+ // short
+ char *nl = strchr(output->serial, '\n');
+ if (nl) {
+ *nl = '\0';
+ }
}
}
}