From c02ff21952a6a19ca375b9dc4f9a5609616a82b8 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Tue, 25 Aug 2020 05:52:32 +0200 Subject: media: uapi: h264: Clean DPB entry interface As discussed recently, the current interface for the Decoded Picture Buffer is not enough to properly support field coding. This commit introduces enough semantics to support frame and field coding, and to signal how DPB entries are "used for reference". Reserved fields will be added by a follow-up commit. Signed-off-by: Ezequiel Garcia Tested-by: Jonas Karlman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/rkvdec/rkvdec-h264.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'drivers/staging/media/rkvdec/rkvdec-h264.c') diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c index 7b66e2743a4f..d1f2715f30ae 100644 --- a/drivers/staging/media/rkvdec/rkvdec-h264.c +++ b/drivers/staging/media/rkvdec/rkvdec-h264.c @@ -949,16 +949,17 @@ static void config_registers(struct rkvdec_ctx *ctx, for (i = 0; i < ARRAY_SIZE(dec_params->dpb); i++) { struct vb2_buffer *vb_buf = get_ref_buf(ctx, run, i); - refer_addr = vb2_dma_contig_plane_dma_addr(vb_buf, 0) | - RKVDEC_COLMV_USED_FLAG_REF; + refer_addr = vb2_dma_contig_plane_dma_addr(vb_buf, 0); - if (!(dpb[i].flags & V4L2_H264_DPB_ENTRY_FLAG_FIELD)) - refer_addr |= RKVDEC_TOPFIELD_USED_REF | - RKVDEC_BOTFIELD_USED_REF; - else if (dpb[i].flags & V4L2_H264_DPB_ENTRY_FLAG_BOTTOM_FIELD) - refer_addr |= RKVDEC_BOTFIELD_USED_REF; - else + if (dpb[i].flags & V4L2_H264_DPB_ENTRY_FLAG_ACTIVE) + refer_addr |= RKVDEC_COLMV_USED_FLAG_REF; + if (dpb[i].flags & V4L2_H264_DPB_ENTRY_FLAG_FIELD) + refer_addr |= RKVDEC_FIELD_REF; + + if (dpb[i].fields & V4L2_H264_TOP_FIELD_REF) refer_addr |= RKVDEC_TOPFIELD_USED_REF; + if (dpb[i].fields & V4L2_H264_BOTTOM_FIELD_REF) + refer_addr |= RKVDEC_BOTFIELD_USED_REF; writel_relaxed(dpb[i].top_field_order_cnt, rkvdec->regs + poc_reg_tbl_top_field[i]); -- cgit v1.2.3-59-g8ed1b