Revert "Merge pull request 'kernel + daemon: H.264 B-frame display reorder fix (closes #6)' (#7) from noether/kernel-daemon-h264-reorder-fix into main"

This reverts commit 79256dc7ef, reversing
changes made to 7ff2d897ea.
This commit is contained in:
2026-05-21 14:40:59 +02:00
parent 49e60c9bba
commit 714d781d22
6 changed files with 276 additions and 713 deletions
+2 -52
View File
@@ -28,12 +28,7 @@
#include <linux/v4l2-controls.h>
#define DAEDALUS_PROTO_MAGIC 0x44303456u /* 'D04V' */
#define DAEDALUS_PROTO_VERSION 1u /* pre-1.0; bumped for
* REQ_DECODE.src_pts +
* RESP_FRAME.flags +
* RESP_FRAME.output_src_pts
* (H.264 B-frame reorder fix,
* daedalus-v4l2#6). */
#define DAEDALUS_PROTO_VERSION 0u /* pre-1.0 */
/*
* Wire-protocol message types.
@@ -147,17 +142,6 @@ struct daedalus_req_decode {
__u32 capture_plane_size[3];
__u32 capture_plane_stride[3];
__u32 flags;
__u32 reserved0; /* explicit pad to 8-byte align src_pts */
/*
* The V4L2 OUTPUT (bitstream) buffer's vb2 timestamp at submission
* time. The daemon sets pkt->pts = src_pts before
* avcodec_send_packet so libavcodec's display-ordered
* receive_frame can return frame->pts == src_pts of the bitstream
* the frame's slices belong to. Decouples kernel cookie (decode
* order, in-kernel identity) from display order — required for
* H.264 B-frame correctness (daedalus-v4l2#6).
*/
__u64 src_pts;
};
/**
@@ -224,31 +208,6 @@ enum daedalus_decode_status {
* Fixed size — keeps wire parsing simple. No variable-length
* pixel data in Phase 8.4; dmabuf in Phase 8.5 carries that.
*/
/**
* DAEDALUS_RESP_FLAG_HAS_PIXELS - this RESP delivers a decoded frame's
* pixels. The owning CAPTURE buffer is identified by output_src_pts
* (matched against an in-flight item's src_pts on the kernel side),
* NOT by the chardev message header's cookie. Required since
* libavcodec's H.264 decoder reorders to display order — the cookie
* the daemon just received the REQ on may not be the cookie whose
* bitstream produced the frame just popped from receive_frame.
*
* DAEDALUS_RESP_FLAG_SRC_CONSUMED - the chardev header's cookie's
* OUTPUT bitstream buffer is done from the daemon's perspective
* (libavcodec has accepted the slice data via avcodec_send_packet).
* Kernel releases src_buf for the cookie and runs job_finish so the
* m2m scheduler can dispatch the next REQ. Independent of any
* pixel delivery — the dst_buf paired with this cookie may still
* be parked, awaiting a future RESP with HAS_PIXELS + matching
* output_src_pts.
*
* Both flags may be set in a single message (steady-state path with
* no codec reorder lag — the just-sent packet immediately yielded a
* frame whose pts == this REQ's src_pts).
*/
#define DAEDALUS_RESP_FLAG_HAS_PIXELS 0x00000001u
#define DAEDALUS_RESP_FLAG_SRC_CONSUMED 0x00000002u
struct daedalus_resp_frame {
__u32 status;
__u32 codec_id;
@@ -258,16 +217,7 @@ struct daedalus_resp_frame {
__u32 luma_len;
__u32 chroma_len;
__u32 fnv1a_yuv;
__u32 flags; /* bitmask of DAEDALUS_RESP_FLAG_* */
__u32 reserved0; /* explicit pad to 8-byte align output_src_pts */
/*
* Set when DAEDALUS_RESP_FLAG_HAS_PIXELS is in flags. Identifies
* which OUTPUT bitstream's slices produced the pixels in this
* RESP — kernel completes the CAPTURE buffer whose inflight item
* has src_pts == output_src_pts. Ignored when HAS_PIXELS is
* clear.
*/
__u64 output_src_pts;
__u32 reserved;
};
/* -- chardev ioctl ABI ----------------------------------------------- */