mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
backend/drm: set "max bpc" to the max
"max bpc" is a maximum value, the driver is free to choose a smaller value depending on the bandwidth available. Some faulty monitors misbehave with higher bpc values. We'll add a workaround if users get hit by these in practice. References: https://gitlab.freedesktop.org/wayland/weston/-/issues/612
This commit is contained in:
parent
1f1c0275be
commit
1d581656c7
5 changed files with 43 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
|
@ -26,6 +27,7 @@ static const struct prop_info connector_info[] = {
|
|||
{ "PATH", INDEX(path) },
|
||||
{ "content type", INDEX(content_type) },
|
||||
{ "link-status", INDEX(link_status) },
|
||||
{ "max bpc", INDEX(max_bpc) },
|
||||
{ "non-desktop", INDEX(non_desktop) },
|
||||
{ "panel orientation", INDEX(panel_orientation) },
|
||||
{ "subconnector", INDEX(subconnector) },
|
||||
|
|
@ -181,3 +183,28 @@ char *get_drm_prop_enum(int fd, uint32_t obj, uint32_t prop_id) {
|
|||
|
||||
return str;
|
||||
}
|
||||
|
||||
bool introspect_drm_prop_range(int fd, uint32_t prop_id,
|
||||
uint64_t *min, uint64_t *max) {
|
||||
drmModePropertyRes *prop = drmModeGetProperty(fd, prop_id);
|
||||
if (!prop) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (drmModeGetPropertyType(prop) != DRM_MODE_PROP_RANGE) {
|
||||
drmModeFreeProperty(prop);
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(prop->count_values == 2);
|
||||
|
||||
if (min != NULL) {
|
||||
*min = prop->values[0];
|
||||
}
|
||||
if (max != NULL) {
|
||||
*max = prop->values[1];
|
||||
}
|
||||
|
||||
drmModeFreeProperty(prop);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue