mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-21 06:46:46 -04:00
Merge gitlab.freedesktop.org:wlroots/wlroots
This commit is contained in:
commit
26f6fab4eb
275 changed files with 7472 additions and 5463 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
|
@ -25,7 +26,9 @@ static const struct prop_info connector_info[] = {
|
|||
{ "EDID", INDEX(edid) },
|
||||
{ "PATH", INDEX(path) },
|
||||
{ "TILE", INDEX(tile) },
|
||||
{ "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 +184,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