summaryrefslogtreecommitdiffstats
path: root/video/out/wldmabuf
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-02-17 11:24:15 -0600
committerDudemanguy <random342@airmail.cc>2023-02-18 02:21:54 +0000
commite2cdc23af06f0911ced2d17034ee3ff6f5a98820 (patch)
tree709450aa90d7e9454f7641ce5adf365bcba6695b /video/out/wldmabuf
parent7607432127d5aa4e2a6e8cc05ea112c19aa9ff7f (diff)
downloadmpv-e2cdc23af06f0911ced2d17034ee3ff6f5a98820.tar.bz2
mpv-e2cdc23af06f0911ced2d17034ee3ff6f5a98820.tar.xz
Revert "vo_dmabuf_wayland: drop support for linux-dmabuf-v2"
This was originally dropped because it was thought to be unneeded at the time, but at least some devices (rockchip) apparently are still on old compositors that use linux-dmabuf v2. It's not much code, and for testing purposes it's good to have around since it's hard to test drmprime otherwise. Some minor additions are here to support the newly added vaapi-format mapping in v2 of the protocol. This reverts commit a5b9d529eec8d4bb6fc858143337c3573ec8afd0.
Diffstat (limited to 'video/out/wldmabuf')
-rw-r--r--video/out/wldmabuf/ra_wldmabuf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/video/out/wldmabuf/ra_wldmabuf.c b/video/out/wldmabuf/ra_wldmabuf.c
index eda2cc9fe8..a3499a25e9 100644
--- a/video/out/wldmabuf/ra_wldmabuf.c
+++ b/video/out/wldmabuf/ra_wldmabuf.c
@@ -34,12 +34,16 @@ bool ra_compatible_format(struct ra* ra, uint32_t drm_format, uint64_t modifier)
struct vo_wayland_state *wl = p->vo->wl;
const wayland_format *formats = wl->format_map;
- for (int i = 0; i < wl->format_size / sizeof(wayland_format); i++)
- {
+ for (int i = 0; i < wl->format_size / sizeof(wayland_format); i++) {
if (drm_format == formats[i].format && modifier == formats[i].modifier)
return true;
}
+ for (int i = 0; i < wl->drm_format_ct; i++) {
+ if (drm_format == wl->drm_formats[i])
+ return true;
+ }
+
return false;
}