src/config.c: probe both single- and multi-plane V4L2 buffer types
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user