Dne četrtek, 10. oktober 2019 ob 15:11:50 CEST je Hans Verkuil napisal(a): > From: Jernej Skrabec <jernej.skrabec@xxxxxxxx> > > When codec supports multiple slices in one frame, VPU has to know when > first slice of each frame is being processed, presumably to correctly > clear/set data in auxiliary buffers. > > Add first_slice field to cedrus_run structure and set it according to > the new_frame boolean of the context. > > Signed-off-by: Jernej Skrabec <jernej.skrabec@xxxxxxxx> > [hverkuil-cisco@xxxxxxxxx: rewritten to use the new_frame bool] > Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> > --- > drivers/staging/media/sunxi/cedrus/cedrus.h | 1 + > drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h > b/drivers/staging/media/sunxi/cedrus/cedrus.h index > 2f017a651848..32cb38e541c6 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus.h > +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h > @@ -70,6 +70,7 @@ struct cedrus_mpeg2_run { > struct cedrus_run { > struct vb2_v4l2_buffer *src; > struct vb2_v4l2_buffer *dst; > + bool first_slice; > > union { > struct cedrus_h264_run h264; > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c > b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c index > 56ca4c9ad01c..7d3dd31e8190 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c > @@ -31,6 +31,7 @@ void cedrus_device_run(void *priv) > > run.src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); > run.dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); > + run.first_slice = ctx->fh.m2m_ctx->new_frame; I'm not sure if this patch makes sense anymore now that the flag is part of the core. I think we can drop this patch and access new_frame directly in next patch. Any thoughts? Best regards, Jernej > > /* Apply request(s) controls if needed. */ > src_req = run.src->vb2_buf.req_obj.req;