mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
backend/drm: add support for the subconnector property
The subconnector property indicates the connector sub-type. This is useful because that usually indicates what kind of connector the user has plugged in to their monitor, e.g. a DisplayPort-to-DVI cable will indicate a DVI subconnector. Also some laptops have non-DP connectors that are internally linked to a DP port on the GPU. Set the output description accordingly. See https://drmdb.emersion.fr/properties/3233857728/subconnector
This commit is contained in:
parent
6af748171a
commit
cb6f584496
3 changed files with 43 additions and 2 deletions
|
|
@ -1349,12 +1349,25 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
|
|||
parse_edid(&wlr_conn->output, edid_len, edid);
|
||||
free(edid);
|
||||
|
||||
char *subconnector = NULL;
|
||||
if (wlr_conn->props.subconnector) {
|
||||
subconnector = get_drm_prop_enum(drm->fd,
|
||||
wlr_conn->id, wlr_conn->props.subconnector);
|
||||
}
|
||||
if (subconnector && strcmp(subconnector, "Native") == 0) {
|
||||
free(subconnector);
|
||||
subconnector = NULL;
|
||||
}
|
||||
|
||||
struct wlr_output *output = &wlr_conn->output;
|
||||
char description[128];
|
||||
snprintf(description, sizeof(description), "%s %s %s (%s)",
|
||||
output->make, output->model, output->serial, output->name);
|
||||
snprintf(description, sizeof(description), "%s %s %s (%s%s%s)",
|
||||
output->make, output->model, output->serial, output->name,
|
||||
subconnector ? " via " : "", subconnector ? subconnector : "");
|
||||
wlr_output_set_description(output, description);
|
||||
|
||||
free(subconnector);
|
||||
|
||||
wlr_log(WLR_INFO, "Detected modes:");
|
||||
|
||||
for (int i = 0; i < drm_conn->count_modes; ++i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue