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

Commit 69148e27 authored by Vinay Kalia's avatar Vinay Kalia Committed by Deva Ramasubramanian
Browse files

msm: vidc: Increase output buffer count for DCVS



To get more residency at lower voltage corner, buffer count needs
to be increased for resolutions for which DCVS is enabled. This
change lowers the power consumption during video playback of higher
resolutions but at the cost of increase in memory.

Change-Id: I2d0adc5e0483bba5c4f4dd6d0070ef8a518a3597
Signed-off-by: default avatarVinay Kalia <vkalia@codeaurora.org>
parent 31f8dcc9
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1652,7 +1652,15 @@ static int msm_vdec_queue_setup(struct vb2_queue *q,
			break;
		}

		*num_buffers = max(*num_buffers, bufreq->buffer_count_min);
		/* Pretend as if FW itself is asking for
		 * additional buffers.
		 * *num_buffers += MSM_VIDC_ADDITIONAL_BUFS_FOR_DCVS
		 * is wrong since it will end up increasing the count
		 * on every call to reqbufs if *num_bufs is larger
		 * than min requirement.
		 */
		*num_buffers = max(*num_buffers, bufreq->buffer_count_min
			+ msm_dcvs_get_extra_buff_count(inst));

		min_buff_count = (!!(inst->flags & VIDC_THUMBNAIL)) ?
			MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS :
+0 −3
Original line number Diff line number Diff line
@@ -28,9 +28,6 @@
	__rc; \
})

#define IS_VALID_DCVS_SESSION(__cur_mbpf, __min_mbpf) \
		((__cur_mbpf) >= (__min_mbpf))

#define SUM_ARRAY(__arr, __start, __end) ({\
		int __index;\
		typeof((__arr)[0]) __sum = 0;\
+4 −1
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst)

	if (!inst) {
		dprintk(VIDC_ERR, "%s Invalid args\n", __func__);
		return -EINVAL;
		return 0;
	}

	if (inst->session_type == MSM_VIDC_ENCODER) {
@@ -587,6 +587,9 @@ int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst)
			if (!inst->dcvs.is_additional_buff_added)
				extra_buffer = DCVS_ENC_EXTRA_OUTPUT_BUFFERS;
		}
	} else if (inst->session_type == MSM_VIDC_DECODER) {
		if (msm_dcvs_check_supported(inst))
			extra_buffer = DCVS_DEC_EXTRA_OUTPUT_BUFFERS;
	}
	return extra_buffer;
}
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
#define DCVS_ENC_HIGH_THR 9
/* extra o/p buffers in case of encoder dcvs */
#define DCVS_ENC_EXTRA_OUTPUT_BUFFERS 2
/* extra o/p buffers in case of decoder dcvs */
#define DCVS_DEC_EXTRA_OUTPUT_BUFFERS 4
/* Default threshold to reduce the core frequency */
#define DCVS_NOMINAL_THRESHOLD 8
/* Default threshold to increase the core frequency */