aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/util.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-11-11 17:36:14 -0500
committerGitHub <noreply@github.com>2017-11-11 17:36:14 -0500
commitc1eff3d3afc237aa4a988a01c88c492a4787d954 (patch)
treea6f72b67564c0e0552f3cd9a5eaf81c158197558 /backend/drm/util.c
parent2bee288090d930a09be5f9176a519c1ec02c63de (diff)
parent09279b90a63c5fdb2e28a61f2dfc936285126177 (diff)
Merge pull request #413 from emersion/output-serial
Add wlr_output.serial
Diffstat (limited to 'backend/drm/util.c')
-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';
+ }
}
}
}