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

Commit 17ce0bbf authored by Praneeth Paladugu's avatar Praneeth Paladugu
Browse files

msm: vidc: Fix an issue in encoder extradata output buffer index



The buffer requirements are stored based on the buffer type.
The buffer type value could be different from the index of the
buffer. To access the right buffer driver needs to compare the
buffer types and shouldn't use the buffer type as index. This
change fixes the same.

Change-Id: I4d928a1218c2be9349b3970fc3812f9a751452d3
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
parent 7182485d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2434,6 +2434,8 @@ int msm_venc_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
	int i;
	u32 height, width;
	int extra_idx = 0;
	struct hal_buffer_requirements *buff_req_buffer;

	if (!inst || !f) {
		dprintk(VIDC_ERR,
			"Invalid input, inst = %p, format = %p\n", inst, f);
@@ -2460,9 +2462,12 @@ int msm_venc_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)) {
			buff_req_buffer =
				get_buff_req_buffer(inst,
					HAL_BUFFER_EXTRADATA_OUTPUT);
			f->fmt.pix_mp.plane_fmt[extra_idx].sizeimage =
				inst->buff_req.buffer
				[HAL_BUFFER_EXTRADATA_OUTPUT].buffer_size;
				buff_req_buffer ?
				buff_req_buffer->buffer_size : 0;
		}
		for (i = 0; i < fmt->num_planes; ++i) {
			inst->bufq[CAPTURE_PORT].vb2_bufq.plane_sizes[i] =