diff mbox series

[meta-oe,2/3] mpv: make the drmprime overlay framebuffer the whole frame

Message ID 20261005011956.1224267-2-f_l_k@t-online.de
State New
Headers show
Series [meta-oe,1/3] mpv: fix a file descriptor leak in the render API | expand

Commit Message

Markus Volk Oct. 5, 2026, 1:19 a.m. UTC
The DRM framebuffer was made the size of the source rect while SRC_X and
SRC_Y place that rect inside the frame. With panscan or a crop the rect
reaches past the framebuffer, the atomic commit fails with ENOSPC and the
plane stays dark. The patch, Upstream-Status: Pending, makes the
framebuffer the size of the frame.

AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 ...make-the-framebuffer-the-whole-frame.patch | 24 +++++++++++++++++++
 .../recipes-multimedia/mplayer/mpv_0.41.0.bb  |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta-oe/recipes-multimedia/mplayer/mpv/0002-hwdec_drmprime_overlay-make-the-framebuffer-the-whole-frame.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-multimedia/mplayer/mpv/0002-hwdec_drmprime_overlay-make-the-framebuffer-the-whole-frame.patch b/meta-oe/recipes-multimedia/mplayer/mpv/0002-hwdec_drmprime_overlay-make-the-framebuffer-the-whole-frame.patch
new file mode 100644
index 0000000000..577d8cfdaa
--- /dev/null
+++ b/meta-oe/recipes-multimedia/mplayer/mpv/0002-hwdec_drmprime_overlay-make-the-framebuffer-the-whole-frame.patch
@@ -0,0 +1,24 @@ 
+From: Markus Volk <f_l_k@t-online.de>
+Subject: [PATCH] hwdec_drmprime_overlay: make the framebuffer the whole frame
+
+The framebuffer for the DRM plane was made the size of the source rect,
+while SRC_X and SRC_Y place that rect inside the frame. As soon as the
+rect does not start at the top left, with panscan or a video crop, it
+reaches past the framebuffer and the atomic commit fails with ENOSPC; the
+plane stays dark. Make the framebuffer the size of the frame and let the
+SRC_* properties pick the part that is shown.
+
+Upstream-Status: Pending
+---
+--- a/video/out/hwdec/hwdec_drmprime_overlay.c
++++ b/video/out/hwdec/hwdec_drmprime_overlay.c
+@@ -187,7 +187,8 @@
+             int dstw = MP_ALIGN_UP(p->dst.x1 - p->dst.x0, 2);
+             int dsth = MP_ALIGN_UP(p->dst.y1 - p->dst.y0, 2);
+ 
+-            if (drm_prime_create_framebuffer(p->log, p->ctx->fd, desc, srcw, srch, &next_frame.fb, &p->handle_refs)) {
++            // The framebuffer is the whole frame, SRC_* pick the part shown
++            if (drm_prime_create_framebuffer(p->log, p->ctx->fd, desc, hw_image->w, hw_image->h, &next_frame.fb, &p->handle_refs)) {
+                 ret = -1;
+                 goto fail;
+             }
diff --git a/meta-oe/recipes-multimedia/mplayer/mpv_0.41.0.bb b/meta-oe/recipes-multimedia/mplayer/mpv_0.41.0.bb
index 7178182c29..f37ae4ac50 100644
--- a/meta-oe/recipes-multimedia/mplayer/mpv_0.41.0.bb
+++ b/meta-oe/recipes-multimedia/mplayer/mpv_0.41.0.bb
@@ -26,6 +26,7 @@  SRCREV = "41f6a645068483470267271e1d09966ca3b9f413"
 SRC_URI = " \
     git://github.com/mpv-player/mpv;name=mpv;branch=release/${@oe.utils.trim_version('${PV}', 2)};protocol=https;tag=v${PV} \
     file://0001-opengl-context-require-swap_buffers-param-for-FenceS.patch \
+    file://0002-hwdec_drmprime_overlay-make-the-framebuffer-the-whole-frame.patch \
 "
 
 inherit meson pkgconfig mime-xdg