3ffa9d0d17
Phase 6 implementation. Backend builds clean on higgs (Debian 13 trixie, aarch64), vainfo lists VAProfileHEVCMain via rpi-hevc-dec, multi-device probe finds /dev/video19 + /dev/media1, CreateContext + S_FMT + REQBUFS + STREAMON all succeed. Phase 7 partial: infrastructure works, 10 frames flow through the pipeline (correct byte counts produced — 13824000 for 1280x720 x 10 NV12 frames). But every DQBUF CAPTURE returns V4L2_BUF_FLAG_ERROR so output content is wrong (libva sha != kdirect sha). The decode itself is failing on the rpi-hevc-dec side despite all ctrl submissions returning success. Code changes: - request.h: video_fd_rpi_hevc_dec / media_fd_rpi_hevc_dec slots + has_hevc_ext_sps_rps_rpi_hevc_dec flag (mirrors iter38 + iter2 pair-of-flags pattern, naturally false on Pi). - request.c: known_decoder_drivers gains rpi-hevc-dec; primary-driver probe gets an else-if branch setting the new fds (Phase 5 F3); request_switch_device_for_profile prefers 'p' for HEVC when rpi-hevc-dec present. - context.c: per-fd want_pixfmt (NC12 on Pi), capture_pixelformat taken from video_format slot (not hardcoded NV12/NV15); synthetic-SPS pre-seed gated off for Pi (Phase 5 F6); destination_sizes uses nv12_col128_uv_plane_offset for NC12 SAND layout (Phase 5 F2); per-driver HEVC_START_CODE (NONE on Pi, ANNEX_B on RK); per-driver context_object->h264_start_code (skip prepend on Pi). - video.c: NV12_COL128 video_format entry (8-bit SAND, single buffer, 2 planes, NV12 drm_format with MOD_NONE so detile branch fires rather than tiled_to_planar). - nv12_col128.c/.h: detile primitive (Y + UV per-plane, kernel hevc_d_video.c bytesperline formula + ffmpeg/Kynesim per-pixel offset). UV plane offset = 128 * ALIGN(h, 8) — within-column (SAND interleaves Y+UV per column, NOT plane-concatenated; earlier wrong formula caught by Phase 7 SEGV). - image.c: #ifdef __arm__ extended to __arm__ || __aarch64__ (Phase 5 F1 — guard was killing detile path on all aarch64 hosts including fresnel iter39 NV15 path, masked because 10-bit never exercised); RequestCreateImage NC12 → NV12 stride override (linear width, not column-stride); copy_surface_to_image NC12 detile branch (gates on fourcc + v4l2_format). - nv15.h: fallback V4L2_PIX_FMT_NV15 define (Debian 13 headers omit it though they have NC12). - nv12_col128.h: fallback V4L2_PIX_FMT_NV12_COL128 + V4L2_PIX_FMT_NV12_10_COL128 (Arch / mainline pre-Pi headers). - tests/test_nv12_col128_detile.c: hand-crafted-bytes unit test; passes (8 cases: Y + UV for 4 widths incl. 1366 misaligned; UV-offset helper). - meson.build / nv12_col128 sources listed. Phase 7 status: not yet bit-exact. Remaining diagnosis: per-frame S_EXT_CTRLS payload diff vs kdirect (kdirect sends 4 ctrls SPS+PPS+decode_params+slice_array; ours sends 5 incl. scaling_matrix; field ordering differs). Likely the slice_array contents need per-driver handling for rpi-hevc-dec's expected layout. Beyond in-session reach. iter38 5/5 baseline on fresnel + ampere should be unaffected (new fd stays -1 on non-Pi hosts; all gates either short-circuit on fd-not-present or no-op). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
139 lines
3.6 KiB
Meson
139 lines
3.6 KiB
Meson
# Copyright (C) 2019 Bootlin
|
|
#
|
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
# copy of this software and associated documentation files (the
|
|
# "Software"), to deal in the Software without restriction, including
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
# distribute, sub license, and/or sell copies of the Software, and to
|
|
# permit persons to whom the Software is furnished to do so, subject to
|
|
# the following conditions:
|
|
#
|
|
# The above copyright notice and this permission notice (including the
|
|
# next paragraph) shall be included in all copies or substantial portions
|
|
# of the Software.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
autoconf_data = configuration_data()
|
|
autoconf_data.set('VA_DRIVER_INIT_FUNC', va_driver_init_func)
|
|
|
|
autoconf = configure_file(
|
|
output: 'autoconfig.h',
|
|
configuration: autoconf_data)
|
|
|
|
sources = [
|
|
'request.c',
|
|
'object_heap.c',
|
|
'config.c',
|
|
'surface.c',
|
|
'context.c',
|
|
'buffer.c',
|
|
'picture.c',
|
|
'subpicture.c',
|
|
'image.c',
|
|
'utils.c',
|
|
'tiled_yuv.S',
|
|
'video.c',
|
|
'media.c',
|
|
'v4l2.c',
|
|
'mpeg2.c',
|
|
'h264.c',
|
|
'h264_slice_header.c',
|
|
'request_pool.c',
|
|
'cap_pool.c',
|
|
'h265.c',
|
|
'vp8.c',
|
|
'vp9.c',
|
|
'codec.c',
|
|
'nv15.c',
|
|
'nv12_col128.c',
|
|
|
|
# Vendored GStreamer 1.28.2 H.265 parser + utilities (LGPL v2.1+,
|
|
# see src/h265_parser/gst_compat.h for sourcing notes + per-iter2
|
|
# adaptation strategy).
|
|
'h265_parser/gst_compat.c',
|
|
'h265_parser/gst/base/gstbitreader.c',
|
|
'h265_parser/gst/base/gstbytereader.c',
|
|
'h265_parser/gst/codecparsers/nalutils.c',
|
|
'h265_parser/gst/codecparsers/gsth265parser.c'
|
|
]
|
|
|
|
headers = [
|
|
'request.h',
|
|
'object_heap.h',
|
|
'config.h',
|
|
'surface.h',
|
|
'context.h',
|
|
'buffer.h',
|
|
'picture.h',
|
|
'subpicture.h',
|
|
'image.h',
|
|
'utils.h',
|
|
'tiled_yuv.h',
|
|
'video.h',
|
|
'media.h',
|
|
'v4l2.h',
|
|
'mpeg2.h',
|
|
'h264.h',
|
|
'h264_slice_header.h',
|
|
'request_pool.h',
|
|
'cap_pool.h',
|
|
'h265.h',
|
|
'vp8.h',
|
|
'vp9.h',
|
|
'codec.h',
|
|
'nv15.h',
|
|
'nv12_col128.h',
|
|
|
|
# Internal mirror of Linux 7.0 V4L2 HEVC EXT_SPS_*_RPS UAPI defs
|
|
# (allows building against pre-7.0 linux-api-headers; redundant
|
|
# once the host headers are 7.0+).
|
|
'hevc-ctrls/v4l2-hevc-ext-controls.h',
|
|
|
|
# Vendored GStreamer + project shim headers (see sources above).
|
|
'h265_parser/gst_compat.h',
|
|
'h265_parser/gst/gst.h',
|
|
'h265_parser/gst/glib-compat-private.h',
|
|
'h265_parser/gst/base/base-prelude.h',
|
|
'h265_parser/gst/base/gstbitreader.h',
|
|
'h265_parser/gst/base/gstbytereader.h',
|
|
'h265_parser/gst/base/gstbitwriter.h',
|
|
'h265_parser/gst/codecparsers/codecparsers-prelude.h',
|
|
'h265_parser/gst/codecparsers/gsth265parser.h',
|
|
'h265_parser/gst/codecparsers/nalutils.h'
|
|
]
|
|
|
|
includes = [
|
|
include_directories('../include'),
|
|
# Vendored GStreamer parser tree — the parser's #include <gst/base/...>
|
|
# style references resolve here via stub headers that redirect to
|
|
# gst_compat.h.
|
|
include_directories('h265_parser')
|
|
]
|
|
|
|
cflags = [
|
|
'-Wall',
|
|
'-fvisibility=hidden'
|
|
]
|
|
|
|
deps = [
|
|
kernel_headers_dep,
|
|
libva_dep,
|
|
libdrm_dep
|
|
]
|
|
|
|
v4l2_request_drv_video = shared_module('v4l2_request_drv_video',
|
|
name_prefix: '',
|
|
install: true,
|
|
install_dir: join_paths(get_option('libdir'), 'dri'),
|
|
c_args: cflags,
|
|
sources: [ sources, headers, autoconf ],
|
|
include_directories: includes,
|
|
dependencies: deps)
|