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

Commit 5af2be7a authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Generalize decoder DCVS threshold for all usecases



Previously the lower DCVS threshold assumed that the client (typically)
display would hold around 5 buffers.  However, this really isn't the
case for certain clients which might hold additional buffers for
arbitrary reasons.  This breaks the assumptions and ultimately ruins the
DCVS algorithm.

To avoid this, set the lower threshold to mean all extra buffers that
are allocated outside the minimum count that the firmware requires (plus
one to account for buffers in transit across various components).

Change-Id: Id85305243bd36ea4049bd9457d07b3d00729196b
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 266cc964
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -215,7 +215,8 @@ void msm_dcvs_init_load(struct msm_vidc_inst *inst)

	/* calculating the min and max threshold */
	if (output_buf_req->buffer_count_actual) {
		dcvs->min_threshold = DCVS_MIN_DISPLAY_BUFF;
		dcvs->min_threshold = output_buf_req->buffer_count_actual -
			output_buf_req->buffer_count_min + 1;
		dcvs->max_threshold = output_buf_req->buffer_count_actual;
		if (dcvs->max_threshold <= dcvs->min_threshold)
			dcvs->max_threshold =
@@ -307,13 +308,13 @@ void msm_dcvs_monitor_buffer(struct msm_vidc_inst *inst)
		prev_buf_count =
			dcvs->num_ftb[((dcvs->ftb_index - 2 +
				DCVS_FTB_WINDOW) % DCVS_FTB_WINDOW)];
		if (prev_buf_count == DCVS_MIN_DISPLAY_BUFF &&
			buffers_outside_fw <= DCVS_MIN_DISPLAY_BUFF) {
		if (prev_buf_count == dcvs->threshold_disp_buf_low &&
			buffers_outside_fw <= dcvs->threshold_disp_buf_low) {
			dcvs->transition_turbo = true;
		} else if (buffers_outside_fw > DCVS_MIN_DISPLAY_BUFF &&
		} else if (buffers_outside_fw > dcvs->threshold_disp_buf_low &&
			(buffers_outside_fw -
			 (prev_buf_count - buffers_outside_fw))
			< DCVS_MIN_DISPLAY_BUFF){
			< dcvs->threshold_disp_buf_low){
			dcvs->transition_turbo = true;
		}
	}
+0 −3
Original line number Diff line number Diff line
@@ -15,9 +15,6 @@
#define _MSM_VIDC_DCVS_H_
#include "msm_vidc_internal.h"

/* Minimum number of display buffers plus an extra safeguard*/
/* Minimum number of display buffers */
#define DCVS_MIN_DISPLAY_BUFF 5
/* Low threshold for encoder dcvs */
#define DCVS_ENC_LOW_THR 4
/* High threshold for encoder dcvs */