Read DRM_CAP_ADDFB2_MODIFIERS

This commit is contained in:
Simon Ser 2021-02-01 15:52:48 +01:00
parent 4e6204e079
commit c7c917e39a
2 changed files with 6 additions and 0 deletions

View file

@ -439,6 +439,11 @@ int init_drm(struct drm_t *drm, const char *device, const char *mode_str, unsign
if (drmGetCap(drm->fd, DRM_CAP_CURSOR_HEIGHT, &drm->cursor_height) != 0) {
drm->cursor_height = 64;
}
uint64_t cap;
if (drmGetCap(drm->fd, DRM_CAP_ADDFB2_MODIFIERS, &cap) == 0 && cap != 0) {
drm->allow_modifiers = true;
}
if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_ATOMIC, 1) != 0) {
fprintf(stderr, "drmSetClientCap(ATOMIC) failed\n");

View file

@ -53,6 +53,7 @@ struct drm_t {
int fd;
uint64_t cursor_width, cursor_height;
bool allow_modifiers;
/* only used for atomic: */
struct plane *plane;