From d1ba4625d29fea4951949aa68e06b7e6b2aeaf07 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Wed, 20 May 2026 16:45:33 +0200 Subject: [PATCH] config: include video_fd_daedalus in profile enumeration probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LIBVA-2 follow-up. RequestQueryConfigProfiles walks each known decoder fd via any_fd_supports_output_format() and adds a VAProfile* for each codec OUTPUT format the V4L2 device advertises. The fd list missed video_fd_daedalus — so on a Pi 5 with rpi-hevc-dec primary + daedalus_v4l2 alt, only S265 (HEVC) was probed and the H.264 / VP9 / AV1 profiles never got enumerated. Effect on higgs: ffmpeg -hwaccel vaapi -i h264_test.mp4 reported "No support for codec h264 profile 578" before the per-codec dispatch in request_switch_device_for_profile could fire — the profile-578 (H264 Constrained Baseline) check happened during hwaccel init, found nothing in the libva profile list, and bailed without ever calling into the daedalus path. Fix: extend the fds[] array in any_fd_supports_output_format from 5 to 6 entries, with the sixth being video_fd_daedalus when HAVE_DAEDALUS_V4L2 is on (and -1 otherwise so it's skipped by the `if (fds[i] < 0) continue;` guard). After the fix, daedalus_v4l2's OUTPUT format menu (VP9F + AV1F + S264) gets seen, and Request- QueryConfigProfiles returns VP9Profile0 + AV1Profile0 + the H264* profiles, all of which then route through the LIBVA-1 'd' kind override in request_switch_device_for_profile. Verified on higgs: Before: vainfo: Supported profile and entrypoints VAProfileHEVCMain : VAEntrypointVLD (only HEVC; H264/VP9/AV1 not enumerated) ffmpeg vaapi -i h264 → "No support for codec h264 profile 578" Build clean on boltzmann (only config.c.o + request.c.o recompile). Backward-compatible on RK3399/3588 — the new slot is gated by HAVE_DAEDALUS_V4L2 *and* video_fd_daedalus >= 0; both stay false in those deployments. Existing 5-fd probe order unchanged. Co-Authored-By: Claude Opus 4.7 --- src/config.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 76b5c35..dafb594 100644 --- a/src/config.c +++ b/src/config.c @@ -172,15 +172,20 @@ VAStatus RequestDestroyConfig(VADriverContextP context, VAConfigID config_id) static bool any_fd_supports_output_format(struct request_data *driver_data, unsigned int fmt) { - int fds[5] = { + int fds[6] = { driver_data->video_fd, driver_data->video_fd_rkvdec, driver_data->video_fd_hantro, driver_data->video_fd_rpi_hevc_dec, /* iter40 */ driver_data->video_fd_vpu981, /* ampere-av1 Phase 2 */ +#ifdef HAVE_DAEDALUS_V4L2 + driver_data->video_fd_daedalus, /* LIBVA-1: H.264/VP9/AV1 */ +#else + -1, +#endif }; int i; - for (i = 0; i < 5; i++) { + for (i = 0; i < 6; i++) { if (fds[i] < 0) continue; if (v4l2_find_format(fds[i], V4L2_BUF_TYPE_VIDEO_OUTPUT, fmt)) return true; -- 2.47.3