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

Commit c291cec2 authored by Chinmay Sawarkar's avatar Chinmay Sawarkar
Browse files

msm: vidc: Update input buffer counts in set format



Input buffer counts, ie Dec Bitstream and Enc Yuv,
depend on input resolution. Hence they should be recalculated
in set format. Stale values can result in excess memory usage.

CRs-Fixed: 2548727
Change-Id: I57c87270a6613da290f14484897cef16e964e27a
Signed-off-by: default avatarChinmay Sawarkar <chinmays@codeaurora.org>
parent 33a71be9
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -651,6 +651,19 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
		mplane->plane_fmt[0].sizeimage =
			msm_vidc_calculate_dec_input_frame_size(inst);

		/* Driver can recalculate buffer count only for
		 * only for bitstream port. Decoder YUV port reconfig
		 * should not overwrite the FW calculated buffer
		 * count.
		 */
		rc = msm_vidc_calculate_buffer_counts(inst);
		if (rc) {
			s_vpr_e(inst->sid,
				"%s failed to calculate buffer count\n",
				__func__);
			return rc;
		}

		rc = msm_vidc_check_session_supported(inst);
		if (rc) {
			s_vpr_e(inst->sid,
+8 −0
Original line number Diff line number Diff line
@@ -1384,6 +1384,14 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
			inst->bit_depth = MSM_VIDC_BIT_DEPTH_10;
		}

		rc = msm_vidc_calculate_buffer_counts(inst);
		if (rc) {
			s_vpr_e(inst->sid,
				"%s failed to calculate buffer count\n",
				__func__);
			return rc;
		}

		rc = msm_vidc_check_session_supported(inst);
		if (rc) {
			s_vpr_e(inst->sid,