media: v4l2-mem2mem: Don't copy frame flags in v4l2_m2m_buf_copy_metadata()

The v4l2_m2m_buf_copy_metadata() function takes a boolean
copy_frame_flags argument. When true, it causes the function to copy the
V4L2_BUF_FLAG_KEYFRAME, V4L2_BUF_FLAG_BFRAME and V4L2_BUF_FLAG_PFRAME
flags from the output buffer to the capture buffer.

There is no use cases in any upstream driver for copying the flags.
KEY/P/B frames are properties of the bitstream buffer in some formats.
Once decoded, this is no longer a property of the video frame and should
be discarded.

It was considered useful to know if an uncompressed frame was decoded
from a KEY/P/B compressed frame, and to preserve that information if
that same uncompressed frame was passed through another M2M device (e.g.
a scaler). However, the V4L2 documentation makes it clear that the flags
are meant for compressed frames only.

Drop the copy_frame_flags argument from v4l2_m2m_buf_copy_metadata().
The change to drivers was performed with the following Coccinelle
semantic patch:

@@
expression src;
expression dst;
expression flag;
@@
-       v4l2_m2m_buf_copy_metadata(src, dst, flag);
+       v4l2_m2m_buf_copy_metadata(src, dst);

include/media/v4l2-mem2mem.h and drivers/media/v4l2-core/v4l2-mem2mem.c
have been updated manually.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Laurent Pinchart
2025-10-15 13:01:16 +03:00
committed by Hans Verkuil
parent d5ddab0cf0
commit 1fdb55ed40
33 changed files with 53 additions and 61 deletions

View File

@@ -2124,7 +2124,7 @@ static void allegro_channel_finish_frame(struct allegro_channel *channel,
state = VB2_BUF_STATE_DONE;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
if (msg->is_idr)
dst_buf->flags |= V4L2_BUF_FLAG_KEYFRAME;
else

View File

@@ -821,7 +821,7 @@ static int vdec_frame_decoded(struct vpu_inst *inst, void *arg)
vbuf = &vpu_buf->m2m_buf.vb;
src_buf = vdec_get_src_buffer(inst, info->consumed_count);
if (src_buf) {
v4l2_m2m_buf_copy_metadata(src_buf, vbuf, true);
v4l2_m2m_buf_copy_metadata(src_buf, vbuf);
if (info->consumed_count) {
v4l2_m2m_src_buf_remove(inst->fh.m2m_ctx);
vpu_set_buffer_state(src_buf, VPU_BUF_STATE_IDLE);

View File

@@ -788,7 +788,7 @@ static int venc_get_one_encoded_frame(struct vpu_inst *inst,
src_buf = vpu_find_buf_by_sequence(inst, inst->out_format.type, frame->info.frame_id);
if (src_buf) {
v4l2_m2m_buf_copy_metadata(src_buf, vbuf, true);
v4l2_m2m_buf_copy_metadata(src_buf, vbuf);
vpu_set_buffer_state(src_buf, VPU_BUF_STATE_IDLE);
v4l2_m2m_src_buf_remove_by_buf(inst->fh.m2m_ctx, src_buf);
v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);

View File

@@ -1685,7 +1685,7 @@ static void coda_finish_encode(struct coda_ctx *ctx)
dst_buf->flags |= V4L2_BUF_FLAG_PFRAME;
dst_buf->flags |= src_buf->flags & V4L2_BUF_FLAG_LAST;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);

View File

@@ -1245,7 +1245,7 @@ static void coda9_jpeg_finish_encode(struct coda_ctx *ctx)
dst_buf->flags |= V4L2_BUF_FLAG_KEYFRAME;
dst_buf->flags |= src_buf->flags & V4L2_BUF_FLAG_LAST;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);
coda_m2m_buf_done(ctx, dst_buf, err_mb ? VB2_BUF_STATE_ERROR :
@@ -1472,7 +1472,7 @@ static void coda9_jpeg_finish_decode(struct coda_ctx *ctx)
dst_buf->flags |= V4L2_BUF_FLAG_KEYFRAME;
dst_buf->flags |= src_buf->flags & V4L2_BUF_FLAG_LAST;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
vb2_set_plane_payload(&dst_buf->vb2_buf, 0, q_data_dst->sizeimage);

View File

@@ -1354,7 +1354,7 @@ static void e5010_device_run(void *priv)
s_vb->sequence = ctx->out_queue.sequence++;
d_vb->sequence = ctx->cap_queue.sequence++;
v4l2_m2m_buf_copy_metadata(s_vb, d_vb, false);
v4l2_m2m_buf_copy_metadata(s_vb, d_vb);
if (ctx != e5010->last_context_run || ctx->update_qp) {
dprintk(e5010, 1, "ctx updated: 0x%p -> 0x%p, updating qp tables\n",

View File

@@ -1618,7 +1618,7 @@ retry_select:
if (!dst_buf)
goto getbuf_fail;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
mtk_jpegenc_set_hw_param(ctx, hw_id, src_buf, dst_buf);
ret = pm_runtime_get_sync(comp_jpeg[hw_id]->dev);
@@ -1714,7 +1714,7 @@ retry_select:
if (!dst_buf)
goto getbuf_fail;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
jpeg_src_buf = mtk_jpeg_vb2_to_srcbuf(&src_buf->vb2_buf);
jpeg_dst_buf = mtk_jpeg_vb2_to_srcbuf(&dst_buf->vb2_buf);

View File

@@ -530,7 +530,7 @@ static void mtk_jpegdec_timeout_work(struct work_struct *work)
src_buf = cjpeg->hw_param.src_buffer;
dst_buf = cjpeg->hw_param.dst_buffer;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
mtk_jpeg_dec_reset(cjpeg->reg_base);
clk_disable_unprepare(cjpeg->jdec_clk.clks->clk);
@@ -560,7 +560,7 @@ static irqreturn_t mtk_jpegdec_hw_irq_handler(int irq, void *priv)
ctx = jpeg->hw_param.curr_ctx;
src_buf = jpeg->hw_param.src_buffer;
dst_buf = jpeg->hw_param.dst_buffer;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
irq_status = mtk_jpeg_dec_get_int_status(jpeg->reg_base);
dec_irq_ret = mtk_jpeg_dec_enum_result(irq_status);

View File

@@ -261,7 +261,7 @@ static void mtk_jpegenc_timeout_work(struct work_struct *work)
src_buf = cjpeg->hw_param.src_buffer;
dst_buf = cjpeg->hw_param.dst_buffer;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
mtk_jpeg_enc_reset(cjpeg->reg_base);
clk_disable_unprepare(cjpeg->venc_clk.clks->clk);
@@ -289,7 +289,7 @@ static irqreturn_t mtk_jpegenc_hw_irq_handler(int irq, void *priv)
ctx = jpeg->hw_param.curr_ctx;
src_buf = jpeg->hw_param.src_buffer;
dst_buf = jpeg->hw_param.dst_buffer;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
irq_status = readl(jpeg->reg_base + JPEG_ENC_INT_STS) &
JPEG_ENC_INT_STATUS_MASK_ALLIRQ;

View File

@@ -51,7 +51,7 @@ static void mdp_m2m_process_done(void *priv, int vb_state)
ctx->curr_param.frame_no = ctx->frame_count[MDP_M2M_SRC];
src_vbuf->sequence = ctx->frame_count[MDP_M2M_SRC]++;
dst_vbuf->sequence = ctx->frame_count[MDP_M2M_DST]++;
v4l2_m2m_buf_copy_metadata(src_vbuf, dst_vbuf, true);
v4l2_m2m_buf_copy_metadata(src_vbuf, dst_vbuf);
v4l2_m2m_buf_done(src_vbuf, vb_state);
v4l2_m2m_buf_done(dst_vbuf, vb_state);

View File

@@ -1073,7 +1073,7 @@ static int vdec_av1_slice_setup_lat_from_src_buf(struct vdec_av1_slice_instance
lat_buf->src_buf_req = src->vb2_buf.req_obj.req;
dst = &lat_buf->ts_info;
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
vsi->frame.cur_ts = dst->vb2_buf.timestamp;
return 0;
@@ -1780,7 +1780,7 @@ static int vdec_av1_slice_setup_core_to_dst_buf(struct vdec_av1_slice_instance *
if (!dst)
return -EINVAL;
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, dst, true);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, dst);
return 0;
}

View File

@@ -367,7 +367,7 @@ static int vdec_h264_slice_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
inst->vsi_ctx.dec.vdec_fb_va = (u64)(uintptr_t)fb;
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb,
&dst_buf_info->m2m_buf.vb, true);
&dst_buf_info->m2m_buf.vb);
err = get_vdec_decode_parameters(inst);
if (err)
goto err_free_fb_out;

View File

@@ -570,7 +570,7 @@ static int vdec_h264_slice_setup_core_buffer_ext(struct vdec_h264_slice_inst *in
}
vb2_v4l2 = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, vb2_v4l2, true);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, vb2_v4l2);
return 0;
}
@@ -674,7 +674,7 @@ static int vdec_h264_slice_core_decode(struct vdec_lat_buf *lat_buf)
}
vb2_v4l2 = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, vb2_v4l2, true);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, vb2_v4l2);
vdec_h264_slice_fill_decode_reflist(inst, &inst->vsi_core->h264_slice_params,
share_info);
@@ -768,7 +768,8 @@ static int vdec_h264_slice_lat_decode_ext(void *h_vdec, struct mtk_vcodec_mem *b
src_buf_info = container_of(bs, struct mtk_video_dec_buf, bs_buffer);
lat_buf->src_buf_req = src_buf_info->m2m_buf.vb.vb2_buf.req_obj.req;
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &lat_buf->ts_info, true);
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb,
&lat_buf->ts_info);
err = vdec_h264_slice_fill_decode_parameters(inst, share_info,
&inst->vsi_ext->h264_slice_params);
@@ -900,7 +901,8 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
inst->vsi->dec.nal_info = buf[nal_start_idx];
lat_buf->src_buf_req = src_buf_info->m2m_buf.vb.vb2_buf.req_obj.req;
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &lat_buf->ts_info, true);
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb,
&lat_buf->ts_info);
err = vdec_h264_slice_fill_decode_parameters(inst, share_info,
&inst->vsi->h264_slice_params);
@@ -1039,7 +1041,7 @@ static int vdec_h264_slice_single_decode_ext(void *h_vdec, struct mtk_vcodec_mem
inst->vsi_ctx_ext.dec.vdec_fb_va = (u64)(uintptr_t)fb;
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb,
&dst_buf_info->m2m_buf.vb, true);
&dst_buf_info->m2m_buf.vb);
err = get_vdec_sig_decode_parameters(inst);
if (err)
goto err_free_fb_out;
@@ -1135,7 +1137,7 @@ static int vdec_h264_slice_single_decode(void *h_vdec, struct mtk_vcodec_mem *bs
inst->vsi_ctx.dec.vdec_fb_va = (u64)(uintptr_t)fb;
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb,
&dst_buf_info->m2m_buf.vb, true);
&dst_buf_info->m2m_buf.vb);
err = get_vdec_sig_decode_parameters(inst);
if (err)
goto err_free_fb_out;

View File

@@ -742,7 +742,8 @@ static int vdec_hevc_slice_setup_lat_buffer(struct vdec_hevc_slice_inst *inst,
src_buf_info = container_of(bs, struct mtk_video_dec_buf, bs_buffer);
lat_buf->src_buf_req = src_buf_info->m2m_buf.vb.vb2_buf.req_obj.req;
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &lat_buf->ts_info, true);
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb,
&lat_buf->ts_info);
*res_chg = inst->resolution_changed;
if (inst->resolution_changed) {
@@ -847,7 +848,7 @@ static int vdec_hevc_slice_setup_core_buffer(struct vdec_hevc_slice_inst *inst,
}
vb2_v4l2 = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, vb2_v4l2, true);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, vb2_v4l2);
return 0;
}

View File

@@ -358,7 +358,7 @@ static int vdec_vp8_slice_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
y_fb_dma, c_fb_dma);
v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb,
&dst_buf_info->m2m_buf.vb, true);
&dst_buf_info->m2m_buf.vb);
err = vdec_vp8_slice_get_decode_parameters(inst);
if (err)

View File

@@ -706,7 +706,7 @@ int vdec_vp9_slice_setup_single_from_src_to_dst(struct vdec_vp9_slice_instance *
if (!dst)
return -EINVAL;
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
return 0;
}
@@ -724,7 +724,7 @@ static int vdec_vp9_slice_setup_lat_from_src_buf(struct vdec_vp9_slice_instance
lat_buf->src_buf_req = src->vb2_buf.req_obj.req;
dst = &lat_buf->ts_info;
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
return 0;
}
@@ -1652,7 +1652,7 @@ static int vdec_vp9_slice_setup_core_to_dst_buf(struct vdec_vp9_slice_instance *
if (!dst)
return -EINVAL;
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, dst, true);
v4l2_m2m_buf_copy_metadata(&lat_buf->ts_info, dst);
return 0;
}

View File

@@ -776,7 +776,7 @@ static int tegra_vde_h264_setup_frames(struct tegra_ctx *ctx,
* If userspace doesn't tell us frame's type, then we will try decode
* as-is.
*/
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
if (h->decode_params->flags & V4L2_H264_DECODE_PARAM_FLAG_BFRAME)
tb->b_frame = true;

View File

@@ -1430,7 +1430,7 @@ static void dw100_start(struct dw100_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE),
in_vb->sequence, out_vb->sequence);
v4l2_m2m_buf_copy_metadata(in_vb, out_vb, true);
v4l2_m2m_buf_copy_metadata(in_vb, out_vb);
/* Now, let's deal with hardware ... */
dw100_hw_master_bus_disable(dw_dev);

View File

@@ -1537,7 +1537,7 @@ static void mxc_jpeg_device_run(void *priv)
src_buf->sequence = q_data_out->sequence++;
dst_buf->sequence = q_data_cap->sequence++;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
jpeg_src_buf = vb2_to_mxc_buf(&src_buf->vb2_buf);
if (q_data_cap->fmt->mem_planes != dst_buf->vb2_buf.num_planes) {

View File

@@ -107,7 +107,7 @@ static void mxc_isi_m2m_frame_write_done(struct mxc_isi_pipe *pipe, u32 status)
src_vbuf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
dst_vbuf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
v4l2_m2m_buf_copy_metadata(src_vbuf, dst_vbuf, false);
v4l2_m2m_buf_copy_metadata(src_vbuf, dst_vbuf);
src_vbuf->sequence = ctx->queues.out.sequence++;
dst_vbuf->sequence = ctx->queues.cap.sequence++;

View File

@@ -75,7 +75,7 @@ static irqreturn_t rga_isr(int irq, void *prv)
WARN_ON(!src);
WARN_ON(!dst);
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
dst->sequence = ctx->csequence++;

View File

@@ -783,7 +783,7 @@ void rkvdec_run_preamble(struct rkvdec_ctx *ctx, struct rkvdec_run *run)
if (src_req)
v4l2_ctrl_request_setup(src_req, &ctx->ctrl_hdl);
v4l2_m2m_buf_copy_metadata(run->bufs.src, run->bufs.dst, true);
v4l2_m2m_buf_copy_metadata(run->bufs.src, run->bufs.dst);
}
void rkvdec_run_postamble(struct rkvdec_ctx *ctx, struct rkvdec_run *run)

View File

@@ -485,7 +485,7 @@ static void device_run(void *prv)
src->sequence = frm_out->sequence++;
dst->sequence = frm_cap->sequence++;
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
if (clk_enable(dev->gate))
goto end;

View File

@@ -71,7 +71,7 @@ static void deinterlace_device_run(void *priv)
src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
deinterlace_write(dev, DEINTERLACE_MOD_ENABLE,
DEINTERLACE_MOD_ENABLE_EN);

View File

@@ -70,7 +70,7 @@ static void rotate_device_run(void *priv)
src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
val = ROTATE_GLB_CTL_MODE(ROTATE_MODE_COPY_ROTATE);
if (ctx->hflip)

View File

@@ -183,7 +183,7 @@ static void device_run(void *priv)
if (ret)
goto err_cancel_job;
v4l2_m2m_buf_copy_metadata(src, dst, true);
v4l2_m2m_buf_copy_metadata(src, dst);
if (ctx->codec_ops->run(ctx))
goto err_cancel_job;

View File

@@ -421,7 +421,7 @@ static void device_run(void *priv)
else
dst_buf->sequence = q_dst->sequence++;
dst_buf->flags &= ~V4L2_BUF_FLAG_LAST;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
spin_lock(ctx->lock);
if (!ctx->comp_has_next_frame &&
@@ -555,7 +555,7 @@ static void set_last_buffer(struct vb2_v4l2_buffer *dst_buf,
vb2_set_plane_payload(&dst_buf->vb2_buf, 0, 0);
dst_buf->sequence = q_dst->sequence++;
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, !ctx->is_enc);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
dst_buf->flags |= V4L2_BUF_FLAG_LAST;
v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_DONE);
}

View File

@@ -477,7 +477,7 @@ static int device_process(struct vim2m_ctx *ctx,
out_vb->sequence = q_data_out->sequence++;
in_vb->sequence = q_data_in->sequence++;
v4l2_m2m_buf_copy_metadata(in_vb, out_vb, true);
v4l2_m2m_buf_copy_metadata(in_vb, out_vb);
if (ctx->mode & MEM2MEM_VFLIP) {
start = height - 1;

View File

@@ -572,7 +572,7 @@ void visl_device_run(void *priv)
if (src_req)
v4l2_ctrl_request_setup(src_req, &ctx->hdl);
v4l2_m2m_buf_copy_metadata(run.src, run.dst, true);
v4l2_m2m_buf_copy_metadata(run.src, run.dst);
run.dst->sequence = ctx->q_data[V4L2_M2M_DST].sequence++;
run.src->sequence = ctx->q_data[V4L2_M2M_SRC].sequence++;
run.dst->field = ctx->decoded_fmt.fmt.pix.field;

View File

@@ -1288,14 +1288,9 @@ void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx,
EXPORT_SYMBOL_GPL(v4l2_m2m_buf_queue);
void v4l2_m2m_buf_copy_metadata(const struct vb2_v4l2_buffer *out_vb,
struct vb2_v4l2_buffer *cap_vb,
bool copy_frame_flags)
struct vb2_v4l2_buffer *cap_vb)
{
u32 mask = V4L2_BUF_FLAG_TIMECODE | V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
if (copy_frame_flags)
mask |= V4L2_BUF_FLAG_KEYFRAME | V4L2_BUF_FLAG_PFRAME |
V4L2_BUF_FLAG_BFRAME;
const u32 mask = V4L2_BUF_FLAG_TIMECODE | V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
cap_vb->vb2_buf.timestamp = out_vb->vb2_buf.timestamp;

View File

@@ -99,7 +99,7 @@ static void ipu_ic_pp_complete(struct ipu_image_convert_run *run, void *_ctx)
src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, true);
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf);
src_buf->sequence = ctx->sequence++;
dst_buf->sequence = src_buf->sequence;

View File

@@ -90,7 +90,7 @@ void cedrus_device_run(void *priv)
break;
}
v4l2_m2m_buf_copy_metadata(run.src, run.dst, true);
v4l2_m2m_buf_copy_metadata(run.src, run.dst);
cedrus_dst_format_set(dev, &ctx->dst_fmt);

View File

@@ -845,19 +845,13 @@ v4l2_m2m_dst_buf_remove_by_idx(struct v4l2_m2m_ctx *m2m_ctx, unsigned int idx)
*
* @out_vb: the output buffer that is the source of the metadata.
* @cap_vb: the capture buffer that will receive the metadata.
* @copy_frame_flags: copy the KEY/B/PFRAME flags as well.
*
* This helper function copies the timestamp, timecode (if the TIMECODE
* buffer flag was set), field and the TIMECODE, KEYFRAME, BFRAME, PFRAME
* and TSTAMP_SRC_MASK flags from @out_vb to @cap_vb.
*
* If @copy_frame_flags is false, then the KEYFRAME, BFRAME and PFRAME
* flags are not copied. This is typically needed for encoders that
* set this bits explicitly.
* buffer flag was set), field, and the TIMECODE and TSTAMP_SRC_MASK flags from
* @out_vb to @cap_vb.
*/
void v4l2_m2m_buf_copy_metadata(const struct vb2_v4l2_buffer *out_vb,
struct vb2_v4l2_buffer *cap_vb,
bool copy_frame_flags);
struct vb2_v4l2_buffer *cap_vb);
/* v4l2 request helper */