From 61db76ebcf804b5238ee0eebe3c0128d266437b9 Mon Sep 17 00:00:00 2001 From: claude-noether Date: Sun, 17 May 2026 09:54:12 +0200 Subject: [PATCH] ampere-av1 Phase 2 step 2: advertise VAProfileAV1Profile0 via libva MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extended any_fd_supports_output_format() with vpu981 fd as 4th probe target. Added V4L2_PIX_FMT_AV1_FRAME advertisement in RequestQueryConfigProfiles. VAProfileAV1Profile0 in entrypoints + GetConfigAttributes switches. V4L2_REQUEST_MAX_PROFILES=11 now exactly full; comment added warning about future profile additions needing the constant bumped. Verified via vainfo: VAProfileMPEG2Simple/Main, H264×5, HEVC, VP8, AV1 — all advertised (VP9 absent because rkvdec module is on sibling-campaign-close state, not the broken vp9-iter1; restoring VP9 needs the ampere-vp9-enablement campaign reopened or the fail-state module reloaded.) Co-Authored-By: Claude Opus 4.7 --- src/config.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 5d38408..7a8c204 100644 --- a/src/config.c +++ b/src/config.c @@ -84,6 +84,10 @@ VAStatus RequestCreateConfig(VADriverContextP context, VAProfile profile, // fresnel-fourier iter4: VP9 Profile 0 enabled on rkvdec. // Same shape — no profile-specific validation here. break; + case VAProfileAV1Profile0: + // ampere-av1-enablement: AV1 Profile 0 enabled on vpu981. + // Same shape — no profile-specific validation here. + break; default: return VA_STATUS_ERROR_UNSUPPORTED_PROFILE; } @@ -157,13 +161,14 @@ VAStatus RequestDestroyConfig(VADriverContextP context, VAConfigID config_id) static bool any_fd_supports_output_format(struct request_data *driver_data, unsigned int fmt) { - int fds[3] = { + int fds[4] = { driver_data->video_fd, driver_data->video_fd_rkvdec, driver_data->video_fd_hantro, + driver_data->video_fd_vpu981, }; int i; - for (i = 0; i < 3; i++) { + for (i = 0; i < 4; i++) { if (fds[i] < 0) continue; if (v4l2_find_format(fds[i], V4L2_BUF_TYPE_VIDEO_OUTPUT, fmt)) return true; @@ -207,6 +212,17 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context, if (found && index < (V4L2_REQUEST_MAX_PROFILES - 1)) profiles[index++] = VAProfileVP9Profile0; + /* + * ampere-av1-enablement: AV1 routes to vpu981 (advertised via the + * new video_fd_vpu981 slot). V4L2_REQUEST_MAX_PROFILES=11 is now + * EXACTLY full with this addition. Future profile additions + * require bumping that constant + verifying libva consumers' + * profiles[] sizing. + */ + found = any_fd_supports_output_format(driver_data, V4L2_PIX_FMT_AV1_FRAME); + if (found && index < (V4L2_REQUEST_MAX_PROFILES - 1)) + profiles[index++] = VAProfileAV1Profile0; + *profiles_count = index; return VA_STATUS_SUCCESS; @@ -228,6 +244,7 @@ VAStatus RequestQueryConfigEntrypoints(VADriverContextP context, case VAProfileHEVCMain: case VAProfileVP8Version0_3: case VAProfileVP9Profile0: + case VAProfileAV1Profile0: entrypoints[0] = VAEntrypointVLD; *entrypoints_count = 1; break;