summaryrefslogtreecommitdiff
path: root/xf86drmMode.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-03-05 16:07:58 +0100
committerSimon Ser <contact@emersion.fr>2021-04-06 10:37:03 +0200
commitb362850689d1b0048b7f4641cc236128b5a43773 (patch)
treea0d22a8f0a09d72a4dcbf69bc20607e30cfb26ed /xf86drmMode.c
parenta5a400c9581c3b91598623603067556b18084c5d (diff)
xf86drmMode: set FB_MODIFIERS flag when modifiers are supplied
The kernel will always return EINVAL if modifiers are supplied but the flag DRM_MODE_FB_MODIFIERS isn't set. That's a pretty nice footgun. Be a little more helpful and set the flag if the user has supplied a modifier array. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xf86drmMode.c b/xf86drmMode.c
index c3920b91..dc177241 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -289,8 +289,10 @@ drm_public int drmModeAddFB2WithModifiers(int fd, uint32_t width,
memcpy(f.handles, bo_handles, 4 * sizeof(bo_handles[0]));
memcpy(f.pitches, pitches, 4 * sizeof(pitches[0]));
memcpy(f.offsets, offsets, 4 * sizeof(offsets[0]));
- if (modifier)
+ if (modifier) {
+ f.flags |= DRM_MODE_FB_MODIFIERS;
memcpy(f.modifier, modifier, 4 * sizeof(modifier[0]));
+ }
if ((ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ADDFB2, &f)))
return ret;