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

Commit 019d4c8a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: disable batching for concurrent usecase"

parents d24fb5c4 a3bca696
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -816,8 +816,26 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
	inst->bufq[CAPTURE_PORT].num_planes = 1;
	inst->prop.fps = DEFAULT_FPS;
	inst->clk_data.operating_rate = 0;
	if (core->resources.decode_batching)
	if (core->resources.decode_batching) {
		struct msm_vidc_inst *temp;

		inst->batch.size = MAX_DEC_BATCH_SIZE;
		inst->decode_batching = true;

		mutex_lock(&core->lock);
		list_for_each_entry(temp, &core->instances, list) {
			if (temp != inst &&
				temp->state != MSM_VIDC_CORE_INVALID &&
				is_decode_session(temp) &&
				!is_thumbnail_session(temp)) {
				inst->decode_batching = false;
				dprintk(VIDC_DBG,
					"decode-batching disabled in multiple sessions\n");
				break;
			}
		}
		mutex_unlock(&core->lock);
	}

	/* By default, initialize CAPTURE port to UBWC YUV format */
	fmt = msm_comm_get_pixel_fmt_fourcc(vdec_formats,
+1 −2
Original line number Diff line number Diff line
@@ -1185,8 +1185,7 @@ int msm_vidc_get_extra_buff_count(struct msm_vidc_inst *inst,
	 * batch size count of extra buffers added on output port
	 */
	if (is_output_buffer(inst, buffer_type)) {
		if (inst->core->resources.decode_batching &&
			is_decode_session(inst) &&
		if (inst->decode_batching && is_decode_session(inst) &&
			count < inst->batch.size)
			count = inst->batch.size;
	}
+2 −3
Original line number Diff line number Diff line
@@ -2892,7 +2892,7 @@ bool is_batching_allowed(struct msm_vidc_inst *inst)
	 * - not a thumbnail session
	 * - UBWC color format
	 */
	if (inst->core->resources.decode_batching && is_decode_session(inst) &&
	if (inst->decode_batching && is_decode_session(inst) &&
		(inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_H264 ||
		inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_HEVC ||
		inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9) &&
@@ -3198,8 +3198,7 @@ static int msm_comm_init_buffer_count(struct msm_vidc_inst *inst)
				HAL_BUFFER_INPUT);
	bufreq->buffer_count_min = inst->fmts[port].input_min_count;
	/* batching needs minimum batch size count of input buffers */
	if (inst->core->resources.decode_batching &&
		is_decode_session(inst) &&
	if (inst->decode_batching && is_decode_session(inst) &&
		bufreq->buffer_count_min < inst->batch.size)
		bufreq->buffer_count_min = inst->batch.size;
	bufreq->buffer_count_min_host = bufreq->buffer_count_actual =
+1 −0
Original line number Diff line number Diff line
@@ -487,6 +487,7 @@ struct msm_vidc_inst {
	struct batch_mode batch;
	struct timer_list batch_timer;
	struct work_struct batch_work;
	bool decode_batching;
};

extern struct msm_vidc_drv *vidc_driver;