forked from marfrit/libva-v4l2-request-fourier
fourier-local: stateless control modernization + HEVC strip
Compound patch carrying the fork's pre-Step-1 substrate, originally authored by Jernej Škrabec / fourier on top of bootlin'sa3c2476: - src/h264.c + src/picture.c: V4L2_CID_MPEG_VIDEO_H264_* renamed to V4L2_CID_STATELESS_H264_*, struct shapes tracked to mainline (V4L2_CID_STATELESS_H264_DECODE_MODE/_START_CODE added to the passthrough shim). - include/hevc-ctrls.h: redirect shim to <linux/v4l2-controls.h> (kernel-side HEVC controls now live in the canonical UAPI header). - src/meson.build: src/h265.c / src/h265.h commented out — HEVC build path is excluded from this fork (RK3568 hantro G1/G2 has no HEVC, and the kernel-side HEVC controls have a separate rework in flight upstream). - src/tiled_yuv.S: aarch64 stub for tiled_to_planar (assembly source was sunxi-cedrus armv7-only; aarch64 needs a stub to keep the build linking). - include/h264-ctrls.h: removed (dead post-fourier — no source includes it; the passthrough shim's CID aliases live in the kernel header now). Functionally equivalent to the prior fork master commits:c1f5108V4L2_PIX_FMT_H264_SLICE rename4ccbfe9Strip HEVC build pathda9f2a5include/h264-ctrls.h passthrough + CID aliasesfc4bb10src/h264.c track upstream UAPI shape13e9b64src/h264.c drop num_slices field4d14ffbsrc/tiled_yuv.S aarch64 stub1b02c9bsrc/h264.c include utils.h Folded into one commit during 2026-05-04 Step 1 reconciliation (see ../phase0_evidence/2026-05-04/findings.md). Per-patch history of the early fork commits preserved on the pre-step1 branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+15
-6
@@ -51,6 +51,7 @@
|
||||
#include "autoconfig.h"
|
||||
|
||||
static VAStatus codec_store_buffer(struct request_data *driver_data,
|
||||
struct object_context *context,
|
||||
VAProfile profile,
|
||||
struct object_surface *surface_object,
|
||||
struct object_buffer *buffer_object)
|
||||
@@ -63,6 +64,14 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
||||
* RenderPicture), we can't use a V4L2 buffer directly
|
||||
* and have to copy from a regular buffer.
|
||||
*/
|
||||
if (context->h264_start_code) {
|
||||
static const char start_code[3] = { 0x00, 0x00, 0x01 };
|
||||
|
||||
memcpy(surface_object->source_data +
|
||||
surface_object->slices_size,
|
||||
start_code, sizeof(start_code));
|
||||
surface_object->slices_size += sizeof(start_code);
|
||||
}
|
||||
memcpy(surface_object->source_data +
|
||||
surface_object->slices_size,
|
||||
buffer_object->data,
|
||||
@@ -184,16 +193,15 @@ static VAStatus codec_set_controls(struct request_data *driver_data,
|
||||
case VAProfileH264ConstrainedBaseline:
|
||||
case VAProfileH264MultiviewHigh:
|
||||
case VAProfileH264StereoHigh:
|
||||
rc = h264_set_controls(driver_data, context, surface_object);
|
||||
rc = h264_set_controls(driver_data, context, profile,
|
||||
surface_object);
|
||||
if (rc < 0)
|
||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||
break;
|
||||
|
||||
case VAProfileHEVCMain:
|
||||
rc = h265_set_controls(driver_data, context, surface_object);
|
||||
if (rc < 0)
|
||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||
break;
|
||||
/* Fourier-local: HEVC stripped, no HW support on RK3566. */
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
|
||||
default:
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
@@ -255,7 +263,8 @@ VAStatus RequestRenderPicture(VADriverContextP context, VAContextID context_id,
|
||||
if (buffer_object == NULL)
|
||||
return VA_STATUS_ERROR_INVALID_BUFFER;
|
||||
|
||||
rc = codec_store_buffer(driver_data, config_object->profile,
|
||||
rc = codec_store_buffer(driver_data, context_object,
|
||||
config_object->profile,
|
||||
surface_object, buffer_object);
|
||||
if (rc != VA_STATUS_SUCCESS)
|
||||
return rc;
|
||||
|
||||
Reference in New Issue
Block a user