summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kindestam <antonki@kth.se>2020-05-04 20:47:38 +0200
committerAnton Kindestam <antonki@kth.se>2020-05-08 21:26:25 +0200
commit9dfcc496a504f6ec701af08e92ce45b93239277f (patch)
tree2bed7b718aa0026cf47ea9c28a85bcf4c656ca86
parent6c04eb0508e1e30fc3b5b486363e9722f461296c (diff)
downloadmpv-9dfcc496a504f6ec701af08e92ce45b93239277f.tar.bz2
mpv-9dfcc496a504f6ec701af08e92ce45b93239277f.tar.xz
drm_prime: fallback to drmModeAddFB2
Fallback to drmModeAddFB2 if drmModeAddFB2WithModifiers fails. I've observed it failing on a pinebook pro running manjaro. We also got "0" as modifiers from FFmpeg anyway, which might or might not have something to do with this. Instead of trying to find the source of the problem, just add this fallback.
-rw-r--r--video/out/drm_prime.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/video/out/drm_prime.c b/video/out/drm_prime.c
index 1cfaa1a1d3..9335fa8e02 100644
--- a/video/out/drm_prime.c
+++ b/video/out/drm_prime.c
@@ -73,10 +73,16 @@ int drm_prime_create_framebuffer(struct mp_log *log, int fd,
modifiers, &framebuffer->fb_id,
DRM_MODE_FB_MODIFIERS);
if (ret < 0) {
- mp_err(log, "Failed to create framebuffer on layer %d: %s\n",
- 0, mp_strerror(errno));
- goto fail;
+ ret = drmModeAddFB2(fd, width, height, layer->format,
+ handles, pitches, offsets,
+ &framebuffer->fb_id, 0);
+ if (ret < 0) {
+ mp_err(log, "Failed to create framebuffer with drmModeAddFB2 on layer %d: %s\n",
+ 0, mp_strerror(errno));
+ goto fail;
+ }
}
+
for (int plane = 0; plane < AV_DRM_MAX_PLANES; plane++) {
drm_prime_add_handle_ref(handle_refs, framebuffer->gem_handles[plane]);
}