Guard the field assignment num_delta_pocs_of_ref_rps_idx as it is not supported

in fedora < 39
epel9
Than Ngo 1 year ago
parent 569a8a36e9
commit f553ba3014

@ -0,0 +1,50 @@
commit 992f2b837f7c150bebe40a8186420c5c065b71f8
Author: Chen-Yu Tsai <wenst@chromium.org>
Date: Mon Jul 31 04:50:11 2023 +0000
media/gpu/v4l2: Only set HEVC .num_delta_pocs_of_ref_rps_idx on ChromeOS
The HEVC decode parameter .num_delta_pocs_of_ref_rps_idx field was
very recently added to support MediaTek's stateless HEVC decoder. It
was accepted upstream, but hasn't been part of a release yet, and so
hasn't trickled down into a distro package that can be included in the
sysroots.
Guard the field assignment for now so that the Linux builds can proceed.
Bug: b:258331312, b:291169645
Cq-Include-Trybots: luci.chromium.try:linux-v4l2-codec-rel
Change-Id: I1629be2373e7d67ea06a206226ad09bce90c3752
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4728846
Reviewed-by: Nathan Hebert <nhebert@chromium.org>
Auto-Submit: Chen-Yu Tsai <wenst@chromium.org>
Commit-Queue: Chen-Yu Tsai <wenst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1177093}
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc b/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc
index d683fbb5407a4..0f02f39758fe9 100644
--- a/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc
+++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc
@@ -11,6 +11,7 @@
#include <type_traits>
#include "base/logging.h"
+#include "build/build_config.h"
#include "media/gpu/macros.h"
#include "media/gpu/v4l2/v4l2_decode_surface.h"
#include "media/gpu/v4l2/v4l2_decode_surface_handler.h"
@@ -410,8 +411,14 @@ V4L2VideoDecoderDelegateH265::SubmitFrameMetadata(
.pic_order_cnt_val = pic->pic_order_cnt_val_,
.short_term_ref_pic_set_size = static_cast<__u16>(slice_hdr->st_rps_bits),
.long_term_ref_pic_set_size = static_cast<__u16>(slice_hdr->lt_rps_bits),
+#if BUILDFLAG(IS_CHROMEOS)
+ // .num_delta_pocs_of_ref_rps_idx is upstream but not yet pulled
+ // into linux build sysroot.
+ // TODO(wenst): Remove once linux-libc-dev package is updated to
+ // at least v6.5 in the sysroots.
.num_delta_pocs_of_ref_rps_idx =
static_cast<__u8>(slice_hdr->st_ref_pic_set.rps_idx_num_delta_pocs),
+#endif
.flags = static_cast<__u64>(
(pic->irap_pic_ ? V4L2_HEVC_DECODE_PARAM_FLAG_IRAP_PIC : 0) |
((pic->nal_unit_type_ >= H265NALU::IDR_W_RADL &&

@ -377,6 +377,9 @@ Patch312: chromium-115-python-3.12-deprecated.patch
Patch350: chromium-115-linux_ui_darkmode.patch Patch350: chromium-115-linux_ui_darkmode.patch
# Tweak about:gpu, Add dark mode support # Tweak about:gpu, Add dark mode support
Patch351: chromium-116-tweak_about_gpu.patch Patch351: chromium-116-tweak_about_gpu.patch
# Guard the field assignment num_delta_pocs_of_ref_rps_idx as it is not supported
# in fedora < 39
Patch352: chromium-116-v4l2-num_delta_pocs_of_ref_rps_idx.patch
# Use chromium-latest.py to generate clean tarball from released build tarballs, found here: # Use chromium-latest.py to generate clean tarball from released build tarballs, found here:
# http://build.chromium.org/buildbot/official/ # http://build.chromium.org/buildbot/official/
@ -976,6 +979,13 @@ udev.
%patch -P350 -p1 -b .linux_ui_darkmode %patch -P350 -p1 -b .linux_ui_darkmode
%patch -P351 -p1 -b .tweak_about_gpu %patch -P351 -p1 -b .tweak_about_gpu
%ifarch aarch64
%if 0%{?fedora} < 39
%patch -P352 -p1 -b .num_delta_pocs_of_ref_rps_idx
%endif
%endif
# Change shebang in all relevant files in this directory and all subdirectories # Change shebang in all relevant files in this directory and all subdirectories
# See `man find` for how the `-exec command {} +` syntax works # See `man find` for how the `-exec command {} +` syntax works
find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} + find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +

Loading…
Cancel
Save