From d364539dc6133e29c7eaf26b18445cd1897b33c2 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Mon, 5 Oct 2026 03:19:55 +0200 Subject: [PATCH] mpv: make the drmprime overlay framebuffer the whole frame 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 Signed-off-by: Khem Raj --- ...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 --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 +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