Merge pull request 'kernel: bind request controls to p_cur via v4l2_ctrl_request_setup' (#2) from noether/kernel-ctrl-request-setup into main

Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-05-20 18:37:12 +00:00
2 changed files with 37 additions and 2 deletions
+15 -2
View File
@@ -416,8 +416,21 @@ int daedalus_decoder_run_request(struct daedalus_decoder *dec,
dec->pkt->data = assembled;
dec->pkt->size = (int) assembled_len;
log_debug("decoder: h264 prepended SPS=%zuB PPS=%zuB slice=%uB",
sps_len, pps_len, req->bitstream_len);
log_info("decoder: h264 SPS prof=%u level=%u ref_frames=%u w_mbs=%u h_units=%u poc_type=%u flags=0x%x",
h264_meta->sps.profile_idc,
h264_meta->sps.level_idc,
h264_meta->sps.max_num_ref_frames,
h264_meta->sps.pic_width_in_mbs_minus1,
h264_meta->sps.pic_height_in_map_units_minus1,
h264_meta->sps.pic_order_cnt_type,
h264_meta->sps.flags);
log_info("decoder: h264 PPS spsid=%u ppsid=%u qp-26=%d flags=0x%x",
h264_meta->pps.seq_parameter_set_id,
h264_meta->pps.pic_parameter_set_id,
h264_meta->pps.pic_init_qp_minus26,
h264_meta->pps.flags);
log_info("decoder: h264 prepended SPS=%zuB PPS=%zuB slice=%uB",
sps_len, pps_len, req->bitstream_len);
} else {
/*
* VP9/AV1: bitstream is self-contained per frame, point the
+22
View File
@@ -677,6 +677,28 @@ static void daedalus_device_run(void *priv)
goto fail_buf_error;
}
/*
* Bind the in-flight media_request's stateless control values to
* the ctrl_handler's p_cur slots so daedalus_collect_h264_meta()
* sees this request's SPS/PPS/scaling_matrix/decode_params — not
* the previous request's stale values (or driver defaults from
* v4l2_ctrl_new_custom when no prior request has run yet).
*
* Without this, p_cur reads back zero/default for everything the
* userspace driver set via S_EXT_CTRLS with
* V4L2_CTRL_WHICH_REQUEST_VAL — caught by libva-v4l2-request-
* fourier's libva-boundary instrumentation (issue #8) showing
* num_ref_frames=1 sent vs. ref_frames=0 read. Pair with the
* v4l2_ctrl_request_complete call already present in the
* completion path (daedalus_complete_resp_frame).
*
* cedrus / rkvdec / hantro all call this from device_run; the
* m2m core does NOT do it automatically.
*/
if (src_buf->vb2_buf.req_obj.req)
v4l2_ctrl_request_setup(src_buf->vb2_buf.req_obj.req,
&ctx->hdl);
{
u32 cid = daedalus_fourcc_to_codec_id(ctx->src_fmt.pixelformat);
size_t meta_len = 0;