aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-12-02 14:38:43 +0100
committerSimon Zeni <simon@bl4ckb0ne.ca>2022-12-02 14:27:07 +0000
commitd92f92f2d332fb280dde60a6f215cf9445f476bb (patch)
tree5f9eb2ac210685e7bcb2f7aca91e933077583bf8
parentf36a5915da5c998d2a55b00dc62adcf9c1797d19 (diff)
wl-drm: only advertise formats supporting implicit modifiers
With the Vulkan renderer we don't support implicit modifiers. However wl_drm only supports implicit modifiers. Stop advertising wl_drm formats when implicit modifiers are unsupported.
-rw-r--r--types/wlr_drm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/types/wlr_drm.c b/types/wlr_drm.c
index ab44084b..34cb52ad 100644
--- a/types/wlr_drm.c
+++ b/types/wlr_drm.c
@@ -161,7 +161,10 @@ static void drm_bind(struct wl_client *client, void *data,
wl_drm_send_capabilities(resource, WL_DRM_CAPABILITY_PRIME);
for (size_t i = 0; i < drm->formats.len; i++) {
- wl_drm_send_format(resource, drm->formats.formats[i]->format);
+ const struct wlr_drm_format *fmt = drm->formats.formats[i];
+ if (wlr_drm_format_has(fmt, DRM_FORMAT_MOD_INVALID)) {
+ wl_drm_send_format(resource, fmt->format);
+ }
}
}