media/gpu: Enable AV1 hardware decode on Linux V4L2 platforms [chromium/src : main]

0 views
Skip to first unread message

Jason Perlow (Gerrit)

unread,
5:46 PM (3 hours ago) 5:46 PM
to Miguel Casas-Sanchez, chromium...@chromium.org, feature-me...@chromium.org

Jason Perlow abandoned this change.

View Change

Abandoned Abandoning this - it cannot work upstream as written, and I should have caught that before sending it. The change enables use_av1_hw_decoder for is_linux && use_v4l2_codec, which pulls the V4L2 AV1 code into a build whose sysroot cannot compile it. Chromium's own pinned Linux sysroot has no V4L2 AV1 UAPI at all. I downloaded the tarball at the Sha256Sum pinned in build/linux/sysroot_scripts/sysroots.json (c7176a4c7aacbf46bda58a029f39f79a68008d3dee6518f154dcf5161a5486d8) and checked its headers directly: V4L2_PIX_FMT_AV1 MISSING V4L2_PIX_FMT_AV1_FRAME MISSING V4L2_CID_MPEG_VIDEO_AV1_PROFILE MISSING V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN MISSING v4l2_ctrl_av1_sequence MISSING V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X MISSING So it is not a single missing constant. media/gpu/v4l2/v4l2_utils.cc (profile map and pixel-format table), media/gpu/v4l2/v4l2_video_decoder.cc (v4l2_ctrl_av1_sequence) and the v4l2_video_decoder_delegate_av1.cc sources all need UAPI the sysroot does not carry, and nothing in-tree vendors those headers - media/gpu/v4l2 includes <linux/videodev2.h> from the sysroot directly. Today this code only ever builds on ChromeOS, which supplies its own modern sysroot. Confirmed independently: an Electron checkout (Chromium 153) pinning the identical sysroot Sha256Sum fails compiling v4l2_video_decoder_delegate_av1.cc on V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X. My own tree only built because our downstream build script copies modern kernel headers into the sysroot before compiling - I had mistakenly credited that to the stock sysroot when I filed this. It is also unnecessary. use_av1_hw_decoder is in declare_args(), so a board build that does have suitable headers can just set it in args.gn, which is what I have switched to. Changing the default would break any Linux V4L2 builder using the stock sysroot for no gain. If enabling this by default is ever wanted for Linux V4L2, it needs the sysroot refreshed (or the AV1 UAPI vendored) first - that is the real dependency, and it is a bigger change than this CL. Sorry for the noise, and thanks for the time.

Jason Perlow abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: abandon
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I55a3ea71ffad9746d606d4143321d0faaef3f657
Gerrit-Change-Number: 8230288
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Perlow <jpe...@gmail.com>
Gerrit-Reviewer: Miguel Casas-Sanchez <mca...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Jason Perlow (Gerrit)

unread,
6:01 PM (2 hours ago) 6:01 PM
to Miguel Casas-Sanchez, chromium...@chromium.org, feature-me...@chromium.org

Message from Jason Perlow

Following up with the prior art I should have found before sending this.

crrev.com/c/6632634 ("media/gpu/v4l2: Allow enabling AV1 support on Linux", merged 2025-06-12, Bug 372630272) already covers this exact ground, and reaches the opposite conclusion deliberately:

  "The required values in v4l2-controls.h have been upstreamed for a while,
however the baseline Debian dependency has not been updated to a version
including that yet. Add a simple way to already enable AV1 support by
reusing the use_av1_hw_decoder flag, keeping it enabled by default for
VA-API but disabling it for V4L2."

So the is_linux && use_vaapi condition I proposed changing is not an oversight - it is a considered decision, and my CL was effectively a revert of it. Apologies for not finding that first.

For the record, the gap is measurable: the sysroot pinned in build/linux/sysroot_scripts/sysroots.json ships kernel UAPI 6.1 (LINUX_VERSION_CODE 393566), and the V4L2 stateless AV1 uAPI landed in 6.5. Four minor versions.

I have switched our downstream build to set use_av1_hw_decoder = true in args.gn, which is exactly the mechanism 6632634 added, so we now carry no patch for this at all. Thanks for the flag - it does the job.

No action needed on this CL; leaving the trail here in case anyone else arrives at the same idea.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I55a3ea71ffad9746d606d4143321d0faaef3f657
Gerrit-Change-Number: 8230288
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Perlow <jpe...@gmail.com>
Gerrit-Reviewer: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-Comment-Date: Sun, 09 Aug 2026 22:01:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages