From db9f5f903c37fc1b174a54057605b783543e446a Mon Sep 17 00:00:00 2001 From: Akshata Sahukar Date: Wed, 29 Jan 2020 12:04:37 -0800 Subject: [PATCH] msm: vidc: Introduce ETB flag for Enc Superframe handling Driver will internally produce subframe flag for all ETB of a Superframe to firmware (except last ETB). Firmware will propagate subframe flag to FBD. Driver client will receive multiple FBDs with subframe flag for single Superframe ETB (except last FBD). This subframe flag indicates that more FBD expected for same input. Change-Id: I627123ee2500dd7846363d8b819c3fa56234a494 Signed-off-by: Akshata Sahukar --- msm/vidc/msm_vidc_common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index b11cdf63a045..74b28c5e195a 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -4367,6 +4367,7 @@ static int msm_comm_qbuf_superframe_to_hfi(struct msm_vidc_inst *inst, frames[0].flags &= ~HAL_BUFFERFLAG_EXTRADATA; frames[0].flags &= ~HAL_BUFFERFLAG_EOS; frames[0].flags &= ~HAL_BUFFERFLAG_CVPMETADATA_SKIP; + frames[0].flags &= ~HAL_BUFFERFLAG_ENDOFSUBFRAME; if (frames[0].flags) s_vpr_e(inst->sid, "%s: invalid flags %#x\n", __func__, frames[0].flags); @@ -4388,10 +4389,20 @@ static int msm_comm_qbuf_superframe_to_hfi(struct msm_vidc_inst *inst, /* first frame */ if (frames[0].extradata_addr) frames[0].flags |= HAL_BUFFERFLAG_EXTRADATA; + + /* Add work incomplete flag for all etb's except the + * last one. For last frame, flag is cleared at the + * last frame iteration. + */ + frames[0].flags |= HAL_BUFFERFLAG_ENDOFSUBFRAME; } else if (i == superframe_count - 1) { /* last frame */ if (mbuf->vvb.flags & V4L2_BUF_FLAG_EOS) frames[i].flags |= HAL_BUFFERFLAG_EOS; + /* Clear Subframe flag just for the last frame to + * indicate the end of SuperFrame. + */ + frames[i].flags &= ~HAL_BUFFERFLAG_ENDOFSUBFRAME; } num_etbs++; }