From 2f54a8d9e8f0051d946884ab9edd124cd104e4a6 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Sat, 25 Apr 2026 21:27:46 +0000 Subject: [PATCH] src/config.c: probe both single- and multi-plane V4L2 buffer types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bootlin's original probe assumed single-plane decoders (the sunxi-cedrus target the library was originally written for). Rockchip's hantro VPU on RK3566/RK3588 reports V4L2_CAP_VIDEO_M2M_MPLANE only — the single- plane VIDIOC_ENUM_FMT path returns nothing, so vainfo prints an empty "Supported profile and entrypoints" list and downstream apps fall back to software. Add an OUTPUT_MPLANE fallback to all three format probes (MPEG-2, H.264, HEVC). On a single-plane decoder the second probe is a no-op; on a multi-plane decoder it's what makes the profile list non-empty. This is the *probe* fix only — it gets vainfo to enumerate profiles and gets Brave's GPU process to attempt vaCreateContext. The rest of the multiplanar port (S_FMT / REQBUFS / EXPBUF / QBUF in context.c, picture.c, v4l2.c) is the next phase; vaCreateContext currently fails because those paths are still single-plane only. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/config.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/config.c b/src/config.c index 8c08148..bca08ee 100644 --- a/src/config.c +++ b/src/config.c @@ -120,6 +120,9 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context, found = v4l2_find_format(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT, + V4L2_PIX_FMT_MPEG2_SLICE) || + v4l2_find_format(driver_data->video_fd, + V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, V4L2_PIX_FMT_MPEG2_SLICE); if (found && index < (V4L2_REQUEST_MAX_CONFIG_ATTRIBUTES - 2)) { profiles[index++] = VAProfileMPEG2Simple; @@ -128,6 +131,9 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context, found = v4l2_find_format(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT, + V4L2_PIX_FMT_H264_SLICE) || + v4l2_find_format(driver_data->video_fd, + V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, V4L2_PIX_FMT_H264_SLICE); if (found && index < (V4L2_REQUEST_MAX_CONFIG_ATTRIBUTES - 5)) { profiles[index++] = VAProfileH264Main; @@ -139,6 +145,9 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context, found = v4l2_find_format(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT, + V4L2_PIX_FMT_HEVC_SLICE) || + v4l2_find_format(driver_data->video_fd, + V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, V4L2_PIX_FMT_HEVC_SLICE); if (found && index < (V4L2_REQUEST_MAX_CONFIG_ATTRIBUTES - 1)) profiles[index++] = VAProfileHEVCMain;