From 8ce53cecf0f9036312b8b538dd1897e2e7b98db3 Mon Sep 17 00:00:00 2001 From: Praneeth Paladugu Date: Mon, 22 Aug 2016 00:28:16 -0700 Subject: [PATCH] msm: vidc: Use internal size for extradata plane Derive extradata plane size using internal MACRO rather than getting from Venus. This helps to keep clients and driver in sync. CRs-Fixed: 1011881 Change-Id: I2b3536f5eb2742d6b6855140c40724f6425d1578 Signed-off-by: Praneeth Paladugu --- drivers/media/platform/msm/vidc/msm_vdec.c | 28 ++++++++-------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/media/platform/msm/vidc/msm_vdec.c b/drivers/media/platform/msm/vidc/msm_vdec.c index 8fcf2e3a1a3f..ec693d3274d6 100644 --- a/drivers/media/platform/msm/vidc/msm_vdec.c +++ b/drivers/media/platform/msm/vidc/msm_vdec.c @@ -1077,7 +1077,6 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) struct hfi_device *hdev; int rc = 0, i = 0, stride = 0, scanlines = 0, color_format = 0; unsigned int *plane_sizes = NULL, extra_idx = 0; - struct hal_buffer_requirements *bufreq; if (!inst || !f || !inst->core || !inst->core->device) { dprintk(VIDC_ERR, @@ -1168,10 +1167,10 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) extra_idx = EXTRADATA_IDX(fmt->num_planes); if (extra_idx && extra_idx < VIDEO_MAX_PLANES) { - bufreq = get_buff_req_buffer(inst, - HAL_BUFFER_EXTRADATA_OUTPUT); f->fmt.pix_mp.plane_fmt[extra_idx].sizeimage = - bufreq ? bufreq->buffer_size : 0; + VENUS_EXTRADATA_SIZE( + inst->prop.height[CAPTURE_PORT], + inst->prop.width[CAPTURE_PORT]); } for (i = 0; i < fmt->num_planes; ++i) @@ -1249,7 +1248,6 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) int ret = 0; int i; int max_input_size = 0; - struct hal_buffer_requirements *bufreq; if (!inst || !f) { dprintk(VIDC_ERR, "%s invalid parameters\n", __func__); @@ -1294,16 +1292,12 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f) extra_idx = EXTRADATA_IDX(fmt->num_planes); if (extra_idx && extra_idx < VIDEO_MAX_PLANES) { - bufreq = get_buff_req_buffer(inst, - HAL_BUFFER_EXTRADATA_OUTPUT); f->fmt.pix_mp.plane_fmt[extra_idx].sizeimage = - bufreq ? bufreq->buffer_size : 0; + VENUS_EXTRADATA_SIZE( + inst->prop.height[CAPTURE_PORT], + inst->prop.width[CAPTURE_PORT]); } - for (i = 0; i < fmt->num_planes; ++i) - inst->bufq[CAPTURE_PORT].vb2_bufq.plane_sizes[i] = - f->fmt.pix_mp.plane_fmt[i].sizeimage; - f->fmt.pix_mp.num_planes = fmt->num_planes; for (i = 0; i < fmt->num_planes; ++i) { inst->bufq[CAPTURE_PORT].vb2_bufq.plane_sizes[i] = @@ -1590,12 +1584,10 @@ static int msm_vdec_queue_setup(struct vb2_queue *q, extra_idx = EXTRADATA_IDX(inst->fmts[CAPTURE_PORT]->num_planes); if (extra_idx && extra_idx < VIDEO_MAX_PLANES) { - bufreq = get_buff_req_buffer(inst, - HAL_BUFFER_EXTRADATA_OUTPUT); - if (bufreq) - sizes[extra_idx] = bufreq->buffer_size; - else - sizes[extra_idx] = 0; + sizes[extra_idx] = + VENUS_EXTRADATA_SIZE( + inst->prop.height[CAPTURE_PORT], + inst->prop.width[CAPTURE_PORT]); } break; default: