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;