Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e36ed60 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Update buffer size calculation"

parents b5cf1b62 c6ebddb9
Loading
Loading
Loading
Loading
+64 −73
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#define MIN_NUM_THUMBNAIL_MODE_OUTPUT_BUFFERS MIN_NUM_OUTPUT_BUFFERS
#define MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS MIN_NUM_CAPTURE_BUFFERS
#define MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS_VP9 8
#define MIN_NUM_DEC_OUTPUT_BUFFERS 4
#define MIN_NUM_DEC_CAPTURE_BUFFERS 4
/* Y=16(0-9bits), Cb(10-19bits)=Cr(20-29bits)=128, black by default */
@@ -474,48 +475,39 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = {

#define NUM_CTRLS ARRAY_SIZE(msm_vdec_ctrls)

static u32 get_frame_size_compressed_full_yuv(int plane,
					u32 max_mbs_per_frame, u32 size_per_mb)
static u32 get_dec_input_frame_size(struct msm_vidc_inst *inst)
{
	u32 frame_size;
	u32 frame_size, num_mbs;
	u32 div_factor = 1;
	u32 base_res_mbs = MAX_4K_MBPF;
	u32 width = inst->prop.width[OUTPUT_PORT];
	u32 height = inst->prop.height[OUTPUT_PORT];

	if (max_mbs_per_frame > MAX_4K_MBPF)
		frame_size = (max_mbs_per_frame * size_per_mb * 3 / 2) / 4;
	/*
	 * Decoder input size calculation:
	 * If clip is 8k buffer size is calculated for 8k : 8k mbs/4
	 * For 8k cases we expect width/height to be set always.
	 * In all other cases size is calculated for 4k:
	 * 4k mbs for VP8/VP9 and 4k/2 for remaining codecs
	 */
	num_mbs = ((width + 15) >> 4) * ((height + 15) >> 4);
	if (num_mbs > MAX_4K_MBPF) {
		div_factor = 4;
		base_res_mbs = inst->capability.mbs_per_frame.max;
	} else {
		base_res_mbs = MAX_4K_MBPF;
		if (inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9)
			div_factor = 1;
		else
		frame_size = (max_mbs_per_frame * size_per_mb * 3 / 2);

	/* multiply by 10/8 (1.25) to get size for 10 bit case */
	frame_size = frame_size + (frame_size >> 2);

	return frame_size;
			div_factor = 2;
	}

static u32 get_frame_size_compressed(int plane,
					u32 max_mbs_per_frame, u32 size_per_mb)
{
	u32 frame_size;

	if (max_mbs_per_frame > MAX_4K_MBPF)
		frame_size = (max_mbs_per_frame * size_per_mb * 3 / 2) / 4;
	else
		frame_size = (max_mbs_per_frame * size_per_mb * 3/2)/2;

	frame_size = base_res_mbs * 3 / 2 / div_factor;
	 /* multiply by 10/8 (1.25) to get size for 10 bit case */
	if ((inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9) ||
		(inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_HEVC))
		frame_size = frame_size + (frame_size >> 2);

	return frame_size;
}

static u32 get_frame_size(struct msm_vidc_inst *inst,
					const struct msm_vidc_format *fmt,
					int fmt_type, int plane)
{
	u32 frame_size = 0;

	if (fmt_type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
		frame_size = fmt->get_frame_size(plane,
					inst->capability.mbs_per_frame.max,
					MB_SIZE_IN_PIXEL);
	if (inst->buffer_size_limit &&
		(inst->buffer_size_limit < frame_size)) {
		frame_size = inst->buffer_size_limit;
@@ -525,16 +517,17 @@ static u32 get_frame_size(struct msm_vidc_inst *inst,
		dprintk(VIDC_DBG, "set input buffer size to %d\n",
			frame_size);
	}
	} else if (fmt_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
		frame_size = fmt->get_frame_size(plane,
					inst->capability.height.max,
					inst->capability.width.max);
		dprintk(VIDC_DBG, "set output buffer size to %d\n",
			frame_size);
	} else {
		dprintk(VIDC_WARN, "Wrong format type\n");

	return ALIGN(frame_size, SZ_4K);
}
	return frame_size;

static u32 get_dec_output_frame_size(struct msm_vidc_inst *inst)
{
	u32 hfi_fmt;

	hfi_fmt = msm_comm_convert_color_fmt(inst->fmts[CAPTURE_PORT].fourcc);
	return VENUS_BUFFER_SIZE(hfi_fmt, inst->prop.width[CAPTURE_PORT],
			inst->prop.height[CAPTURE_PORT]);
}

struct msm_vidc_format vdec_formats[] = {
@@ -542,35 +535,30 @@ struct msm_vidc_format vdec_formats[] = {
		.name = "YCbCr Semiplanar 4:2:0",
		.description = "Y/CbCr 4:2:0",
		.fourcc = V4L2_PIX_FMT_NV12,
		.get_frame_size = get_frame_size_nv12,
		.type = CAPTURE_PORT,
	},
	{
		.name = "YCbCr Semiplanar 4:2:0 10bit",
		.description = "Y/CbCr 4:2:0 10bit",
		.fourcc = V4L2_PIX_FMT_SDE_Y_CBCR_H2V2_P010_VENUS,
		.get_frame_size = get_frame_size_p010,
		.type = CAPTURE_PORT,
	},
	{
		.name = "UBWC YCbCr Semiplanar 4:2:0",
		.description = "UBWC Y/CbCr 4:2:0",
		.fourcc = V4L2_PIX_FMT_NV12_UBWC,
		.get_frame_size = get_frame_size_nv12_ubwc,
		.type = CAPTURE_PORT,
	},
	{
		.name = "UBWC YCbCr Semiplanar 4:2:0 10bit",
		.description = "UBWC Y/CbCr 4:2:0 10bit",
		.fourcc = V4L2_PIX_FMT_NV12_TP10_UBWC,
		.get_frame_size = get_frame_size_tp10_ubwc,
		.type = CAPTURE_PORT,
	},
	{
		.name = "Mpeg2",
		.description = "Mpeg2 compressed format",
		.fourcc = V4L2_PIX_FMT_MPEG2,
		.get_frame_size = get_frame_size_compressed,
		.type = OUTPUT_PORT,
		.defer_outputs = false,
		.input_min_count = 4,
@@ -580,7 +568,6 @@ struct msm_vidc_format vdec_formats[] = {
		.name = "H264",
		.description = "H264 compressed format",
		.fourcc = V4L2_PIX_FMT_H264,
		.get_frame_size = get_frame_size_compressed,
		.type = OUTPUT_PORT,
		.defer_outputs = false,
		.input_min_count = 4,
@@ -590,7 +577,6 @@ struct msm_vidc_format vdec_formats[] = {
		.name = "HEVC",
		.description = "HEVC compressed format",
		.fourcc = V4L2_PIX_FMT_HEVC,
		.get_frame_size = get_frame_size_compressed,
		.type = OUTPUT_PORT,
		.defer_outputs = false,
		.input_min_count = 4,
@@ -600,7 +586,6 @@ struct msm_vidc_format vdec_formats[] = {
		.name = "VP8",
		.description = "VP8 compressed format",
		.fourcc = V4L2_PIX_FMT_VP8,
		.get_frame_size = get_frame_size_compressed_full_yuv,
		.type = OUTPUT_PORT,
		.defer_outputs = false,
		.input_min_count = 4,
@@ -610,7 +595,6 @@ struct msm_vidc_format vdec_formats[] = {
		.name = "VP9",
		.description = "VP9 compressed format",
		.fourcc = V4L2_PIX_FMT_VP9,
		.get_frame_size = get_frame_size_compressed_full_yuv,
		.type = OUTPUT_PORT,
		.defer_outputs = true,
		.input_min_count = 4,
@@ -734,8 +718,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
		}

		f->fmt.pix_mp.plane_fmt[0].sizeimage =
			inst->fmts[fmt->type].get_frame_size(0,
			f->fmt.pix_mp.height, f->fmt.pix_mp.width);
			get_dec_output_frame_size(inst);

		extra_idx = EXTRADATA_IDX(inst->bufq[fmt->type].num_planes);
		if (extra_idx && extra_idx < VIDEO_MAX_PLANES) {
@@ -804,8 +787,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
			goto err_invalid_fmt;
		}

		max_input_size = get_frame_size(
			inst, &inst->fmts[fmt->type], f->type, 0);
		max_input_size = get_dec_input_frame_size(inst);
		if (f->fmt.pix_mp.plane_fmt[0].sizeimage > max_input_size ||
			!f->fmt.pix_mp.plane_fmt[0].sizeimage) {
			f->fmt.pix_mp.plane_fmt[0].sizeimage = max_input_size;
@@ -999,13 +981,22 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		if (!bufreq)
			return -EINVAL;

		/* VP9 super frame requires multiple frames decoding */
		if (inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9) {
			bufreq->buffer_count_min =
				MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS_VP9;
			bufreq->buffer_count_min_host =
				MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS_VP9;
			bufreq->buffer_count_actual =
				MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS_VP9;
		} else {
			bufreq->buffer_count_min =
				MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS;
			bufreq->buffer_count_min_host =
			MIN_NUM_THUMBNAIL_MODE_OUTPUT_BUFFERS;
				MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS;
			bufreq->buffer_count_actual =
			MIN_NUM_THUMBNAIL_MODE_OUTPUT_BUFFERS;

				MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS;
		}
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_SECURE:
		inst->flags &= ~VIDC_SECURE;
+105 −32
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@
#define OPERATING_FRAME_RATE_STEP (1 << 16)
#define MAX_SLICE_BYTE_SIZE ((MAX_BIT_RATE)>>3)
#define MIN_SLICE_BYTE_SIZE 512
#define MAX_SLICE_MB_SIZE ((4096 * 2304) >> 8)
#define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4))
#define NUM_MBS_4k (((4096 + 15) >> 4) * ((2304 + 15) >> 4))
#define MAX_SLICE_MB_SIZE NUM_MBS_4k
#define QP_ENABLE_I 0x1
#define QP_ENABLE_P 0x2
#define QP_ENABLE_B 0x4
@@ -923,11 +925,99 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {

#define NUM_CTRLS ARRAY_SIZE(msm_venc_ctrls)

static u32 get_frame_size_compressed(int plane, u32 height, u32 width)
static u32 get_enc_input_frame_size(struct msm_vidc_inst *inst)
{
	int sz = ALIGN(height, 32) * ALIGN(width, 32) * 3 / 2;
	u32 hfi_fmt;

	return ALIGN(sz, SZ_4K);
	hfi_fmt = msm_comm_convert_color_fmt(inst->fmts[OUTPUT_PORT].fourcc);
	return VENUS_BUFFER_SIZE(hfi_fmt, inst->prop.width[OUTPUT_PORT],
			inst->prop.height[OUTPUT_PORT]);
}

static u32 get_enc_output_frame_size(struct msm_vidc_inst *inst)
{
	u32 frame_size;
	u32 mbs_per_frame;
	u32 width, height;

	/*
	 * Encoder output size calculation:
	 * For resolution < 720p : YUVsize * 4
	 * For resolution > 720p & <= 4K : YUVsize / 2
	 * For resolution > 4k : YUVsize / 4
	 */
	width = inst->prop.width[CAPTURE_PORT];
	height = inst->prop.height[CAPTURE_PORT];
	mbs_per_frame = ((width + 15) >> 4) * ((height + 15) >> 4);
	frame_size = (width * height * 3) >> 1;
	if (mbs_per_frame < NUM_MBS_720P)
		frame_size = frame_size << 2;
	else if (mbs_per_frame <= NUM_MBS_4k)
		frame_size = frame_size >> 1;
	else
		frame_size = frame_size >> 2;

	if ((inst->rc_type == RATE_CONTROL_OFF) ||
		(inst->rc_type == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ))
		frame_size = frame_size << 1;

	return ALIGN(frame_size, SZ_4K);
}

static inline u32 ROI_EXTRADATA_SIZE(
	u32 width, u32 height, u32 lcu_size) {
	u32 lcu_width = 0;
	u32 lcu_height = 0;
	u32 n_shift = 0;

	while (lcu_size && !(lcu_size & 0x1)) {
		n_shift++;
		lcu_size = lcu_size >> 1;
	}
	lcu_width = (width + (lcu_size - 1)) >> n_shift;
	lcu_height = (height + (lcu_size - 1)) >> n_shift;

	return (((lcu_width + 7) >> 3) << 3) * lcu_height * 2;
}

static u32 get_enc_input_extra_size(struct msm_vidc_inst *inst, u32 extra_types)
{
	u32 size = 0;
	u32 width = inst->prop.width[OUTPUT_PORT];
	u32 height = inst->prop.height[OUTPUT_PORT];

	if (extra_types & EXTRADATA_ENC_INPUT_ROI) {
		u32 lcu_size = 16;

		if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_HEVC)
			lcu_size = 32;

		size += ROI_EXTRADATA_SIZE(width, height, lcu_size);
	}

	if (extra_types & EXTRADATA_ENC_INPUT_HDR10PLUS)
		size += sizeof(struct hfi_hdr10_pq_sei);

	/* Add size for extradata none */
	if (size)
		size += sizeof(struct msm_vidc_extradata_header);

	return ALIGN(size, SZ_4K);
}

static u32 get_enc_output_extra_size(struct msm_vidc_inst *inst,
	u32 extra_types)
{
	u32 size = 0;

	if (extra_types & EXTRADATA_ADVANCED)
		size += sizeof(struct msm_vidc_metadata_ltr_payload);

	/* Add size for extradata none */
	if (size)
		size += sizeof(struct msm_vidc_extradata_header);

	return ALIGN(size, SZ_4K);
}

static struct msm_vidc_format venc_formats[] = {
@@ -935,21 +1025,18 @@ static struct msm_vidc_format venc_formats[] = {
		.name = "YCbCr Semiplanar 4:2:0",
		.description = "Y/CbCr 4:2:0",
		.fourcc = V4L2_PIX_FMT_NV12,
		.get_frame_size = get_frame_size_nv12,
		.type = OUTPUT_PORT,
	},
	{
		.name = "UBWC YCbCr Semiplanar 4:2:0",
		.description = "UBWC Y/CbCr 4:2:0",
		.fourcc = V4L2_PIX_FMT_NV12_UBWC,
		.get_frame_size = get_frame_size_nv12_ubwc,
		.type = OUTPUT_PORT,
	},
	{
		.name = "H264",
		.description = "H264 compressed format",
		.fourcc = V4L2_PIX_FMT_H264,
		.get_frame_size = get_frame_size_compressed,
		.type = CAPTURE_PORT,
		.input_min_count = 4,
		.output_min_count = 4,
@@ -958,7 +1045,6 @@ static struct msm_vidc_format venc_formats[] = {
		.name = "VP8",
		.description = "VP8 compressed format",
		.fourcc = V4L2_PIX_FMT_VP8,
		.get_frame_size = get_frame_size_compressed,
		.type = CAPTURE_PORT,
		.input_min_count = 4,
		.output_min_count = 4,
@@ -967,7 +1053,6 @@ static struct msm_vidc_format venc_formats[] = {
		.name = "HEVC",
		.description = "HEVC compressed format",
		.fourcc = V4L2_PIX_FMT_HEVC,
		.get_frame_size = get_frame_size_compressed,
		.type = CAPTURE_PORT,
		.input_min_count = 4,
		.output_min_count = 4,
@@ -976,21 +1061,18 @@ static struct msm_vidc_format venc_formats[] = {
		.name = "YCrCb Semiplanar 4:2:0",
		.description = "Y/CrCb 4:2:0",
		.fourcc = V4L2_PIX_FMT_NV21,
		.get_frame_size = get_frame_size_nv21,
		.type = OUTPUT_PORT,
	},
	{
		.name = "TP10 UBWC 4:2:0",
		.description = "TP10 UBWC 4:2:0",
		.fourcc = V4L2_PIX_FMT_NV12_TP10_UBWC,
		.get_frame_size = get_frame_size_tp10_ubwc,
		.type = OUTPUT_PORT,
	},
	{
		.name = "TME",
		.description = "TME MBI format",
		.fourcc = V4L2_PIX_FMT_TME,
		.get_frame_size = get_frame_size_compressed,
		.type = CAPTURE_PORT,
		.input_min_count = 4,
		.output_min_count = 4,
@@ -999,14 +1081,12 @@ static struct msm_vidc_format venc_formats[] = {
		.name = "YCbCr Semiplanar 4:2:0 10bit",
		.description = "Y/CbCr 4:2:0 10bit",
		.fourcc = V4L2_PIX_FMT_SDE_Y_CBCR_H2V2_P010_VENUS,
		.get_frame_size = get_frame_size_p010,
		.type = OUTPUT_PORT,
	},
	{
		.name = "YCbCr Semiplanar 4:2:0 512 aligned",
		.description = "Y/CbCr 4:2:0 512 aligned",
		.fourcc = V4L2_PIX_FMT_NV12_512,
		.get_frame_size = get_frame_size_nv12_512,
		.type = OUTPUT_PORT,
	},
};
@@ -1248,8 +1328,7 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
		 * it is already updated when extradata control is set
		 */
		inst->bufq[fmt->type].plane_sizes[0] =
			inst->fmts[fmt->type].get_frame_size(0,
			f->fmt.pix_mp.height, f->fmt.pix_mp.width);
			get_enc_output_frame_size(inst);

		f->fmt.pix_mp.num_planes = inst->bufq[fmt->type].num_planes;
		for (i = 0; i < inst->bufq[fmt->type].num_planes; i++) {
@@ -1286,8 +1365,7 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
		 * it is already updated when extradata control is set
		 */
		inst->bufq[fmt->type].plane_sizes[0] =
			inst->fmts[fmt->type].get_frame_size(0,
			f->fmt.pix_mp.height, f->fmt.pix_mp.width);
			get_enc_input_frame_size(inst);
		f->fmt.pix_mp.num_planes = inst->bufq[fmt->type].num_planes;
		for (i = 0; i < inst->bufq[fmt->type].num_planes; i++) {
			f->fmt.pix_mp.plane_fmt[i].sizeimage =
@@ -1571,22 +1649,10 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		inst->bufq[OUTPUT_PORT].num_planes = 1;
		inst->bufq[CAPTURE_PORT].num_planes = 1;

		if (ctrl->val & EXTRADATA_ADVANCED)
			inst->bufq[CAPTURE_PORT].num_planes = 2;

		if ((ctrl->val & EXTRADATA_ENC_INPUT_ROI) ||
			(ctrl->val & EXTRADATA_ENC_INPUT_HDR10PLUS))
			(ctrl->val & EXTRADATA_ENC_INPUT_HDR10PLUS)) {
			inst->bufq[OUTPUT_PORT].num_planes = 2;

		/* Needs internal calculation of extradata */
		rc = msm_comm_try_get_bufreqs(inst);
		if (rc) {
			dprintk(VIDC_ERR,
				"Failed to get buffer requirements: %d\n", rc);
			break;
		}

		if (inst->bufq[OUTPUT_PORT].num_planes == 2) {
			buff_req_buffer = get_buff_req_buffer(inst,
						HAL_BUFFER_EXTRADATA_INPUT);
			if (!buff_req_buffer) {
@@ -1596,11 +1662,16 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
				break;
			}

			buff_req_buffer->buffer_size =
				get_enc_input_extra_size(inst,
					ctrl->val);
			inst->bufq[OUTPUT_PORT].plane_sizes[1] =
					buff_req_buffer->buffer_size;
		}

		if (inst->bufq[CAPTURE_PORT].num_planes == 2) {
		if (ctrl->val & EXTRADATA_ADVANCED) {
			inst->bufq[CAPTURE_PORT].num_planes = 2;

			buff_req_buffer = get_buff_req_buffer(inst,
						HAL_BUFFER_EXTRADATA_OUTPUT);
			if (!buff_req_buffer) {
@@ -1610,6 +1681,8 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
				break;
			}

			buff_req_buffer->buffer_size =
				get_enc_output_extra_size(inst, ctrl->val);
			inst->bufq[CAPTURE_PORT].plane_sizes[1] =
					buff_req_buffer->buffer_size;
		}
+0 −9
Original line number Diff line number Diff line
@@ -1631,15 +1631,6 @@ static int try_get_ctrl_for_instance(struct msm_vidc_inst *inst,
			return -EINVAL;
		}

		if (inst->session_type == MSM_VIDC_DECODER &&
			!(inst->flags & VIDC_THUMBNAIL) &&
			inst->fmts[OUTPUT_PORT].fourcc ==
				V4L2_PIX_FMT_VP9 &&
			bufreq->buffer_count_min_host <
				MIN_NUM_OUTPUT_BUFFERS_VP9)
			bufreq->buffer_count_min_host =
				MIN_NUM_OUTPUT_BUFFERS_VP9;

		ctrl->val = bufreq->buffer_count_min_host;
		dprintk(VIDC_DBG, "g_min: %x : hal_buffer %d min buffers %d\n",
			hash32_ptr(inst->session), HAL_BUFFER_INPUT, ctrl->val);
+7 −37
Original line number Diff line number Diff line
@@ -3487,11 +3487,13 @@ struct hal_buffer_requirements *get_buff_req_buffer(
	return NULL;
}

static int convert_color_fmt(int v4l2_fmt)
u32 msm_comm_convert_color_fmt(u32 v4l2_fmt)
{
	switch (v4l2_fmt) {
	case V4L2_PIX_FMT_NV12:
		return COLOR_FMT_NV12;
	case V4L2_PIX_FMT_NV12_512:
		return COLOR_FMT_NV12_512;
	case V4L2_PIX_FMT_SDE_Y_CBCR_H2V2_P010_VENUS:
		return COLOR_FMT_P010;
	case V4L2_PIX_FMT_NV12_UBWC:
@@ -3499,6 +3501,9 @@ static int convert_color_fmt(int v4l2_fmt)
	case V4L2_PIX_FMT_NV12_TP10_UBWC:
		return COLOR_FMT_NV12_BPP10_UBWC;
	default:
		dprintk(VIDC_WARN,
			"Invalid v4l2 color fmt FMT : %x, Set default(NV12)",
			v4l2_fmt);
		return COLOR_FMT_NV12;
	}
}
@@ -3573,7 +3578,7 @@ static int set_dpb_only_buffers(struct msm_vidc_inst *inst,

	/* For DPB buffers, Always use FW count */
	num_buffers = output_buf->buffer_count_min;
	hfi_fmt = convert_color_fmt(inst->clk_data.dpb_fourcc);
	hfi_fmt = msm_comm_convert_color_fmt(inst->clk_data.dpb_fourcc);
	buffer_size = VENUS_BUFFER_SIZE(hfi_fmt,
			inst->prop.width[CAPTURE_PORT],
			inst->prop.height[CAPTURE_PORT]);
@@ -5799,41 +5804,6 @@ int msm_comm_session_continue(void *instance)
	return rc;
}

u32 get_frame_size_nv12(int plane, u32 height, u32 width)
{
	return VENUS_BUFFER_SIZE(COLOR_FMT_NV12, width, height);
}

u32 get_frame_size_nv12_ubwc(int plane, u32 height, u32 width)
{
	return VENUS_BUFFER_SIZE(COLOR_FMT_NV12_UBWC, width, height);
}

u32 get_frame_size_rgba(int plane, u32 height, u32 width)
{
	return VENUS_BUFFER_SIZE(COLOR_FMT_RGBA8888, width, height);
}

u32 get_frame_size_nv21(int plane, u32 height, u32 width)
{
	return VENUS_BUFFER_SIZE(COLOR_FMT_NV21, width, height);
}

u32 get_frame_size_tp10_ubwc(int plane, u32 height, u32 width)
{
	return VENUS_BUFFER_SIZE(COLOR_FMT_NV12_BPP10_UBWC, width, height);
}

u32 get_frame_size_p010(int plane, u32 height, u32 width)
{
	return VENUS_BUFFER_SIZE(COLOR_FMT_P010, width, height);
}

u32 get_frame_size_nv12_512(int plane, u32 height, u32 width)
{
	return VENUS_BUFFER_SIZE(COLOR_FMT_NV12_512, width, height);
}

void print_vidc_buffer(u32 tag, const char *str, struct msm_vidc_inst *inst,
		struct msm_vidc_buffer *mbuf)
{
+1 −7
Original line number Diff line number Diff line
@@ -217,13 +217,7 @@ int msm_comm_get_v4l2_level(int fourcc, int level);
int msm_comm_session_continue(void *instance);
int msm_vidc_send_pending_eos_buffers(struct msm_vidc_inst *inst);
enum hal_uncompressed_format msm_comm_get_hal_uncompressed(int fourcc);
u32 get_frame_size_nv12(int plane, u32 height, u32 width);
u32 get_frame_size_nv12_512(int plane, u32 height, u32 width);
u32 get_frame_size_nv12_ubwc(int plane, u32 height, u32 width);
u32 get_frame_size_rgba(int plane, u32 height, u32 width);
u32 get_frame_size_nv21(int plane, u32 height, u32 width);
u32 get_frame_size_tp10_ubwc(int plane, u32 height, u32 width);
u32 get_frame_size_p010(int plane, u32 height, u32 width);
u32 msm_comm_convert_color_fmt(u32 v4l2_fmt);
struct vb2_buffer *msm_comm_get_vb_using_vidc_buffer(
		struct msm_vidc_inst *inst, struct msm_vidc_buffer *mbuf);
struct msm_vidc_buffer *msm_comm_get_buffer_using_device_planes(
Loading