mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
backend/drm: add wlr_drm_connector_get_id
This allows a compositor to get a KMS connector object ID from a
wlr_output. The compositor can then query more information about
the connector via libdrm.
This gives more freedom to compositors and allows them to read
KMS properties that wlroots doesn't know about. For instance,
they could read the EDID or the suggested_{X,Y} properties and
change their output configuration based on that.
This commit is contained in:
parent
cb6f584496
commit
f17b0f975d
2 changed files with 10 additions and 0 deletions
|
|
@ -1046,6 +1046,11 @@ bool wlr_output_is_drm(struct wlr_output *output) {
|
|||
return output->impl == &output_impl;
|
||||
}
|
||||
|
||||
uint32_t wlr_drm_connector_get_id(struct wlr_output *output) {
|
||||
struct wlr_drm_connector *conn = get_drm_connector_from_output(output);
|
||||
return conn->id;
|
||||
}
|
||||
|
||||
static const int32_t subpixel_map[] = {
|
||||
[DRM_MODE_SUBPIXEL_UNKNOWN] = WL_OUTPUT_SUBPIXEL_UNKNOWN,
|
||||
[DRM_MODE_SUBPIXEL_HORIZONTAL_RGB] = WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue