Forráskód Böngészése

video: driver: modify internal buffer counts for vp9

modify internal buffer counts for vp9. fix comv and
noncomv buffer count to 0 for vp9 as they are not
supported for this codec.

Change-Id: I5d504128ab587c425d4cd4cfd2059241e8d256aa
Signed-off-by: Darshana Patil <[email protected]>
Darshana Patil 4 éve
szülő
commit
02346b9728

+ 1 - 1
driver/variant/iris2/src/msm_vidc_buffer_iris2.c

@@ -600,7 +600,7 @@ int msm_buffer_min_count_iris2(struct msm_vidc_inst *inst,
 		case MSM_VIDC_BUF_NON_COMV:
 		case MSM_VIDC_BUF_LINE:
 		case MSM_VIDC_BUF_PERSIST:
-			count = 1;
+			count = msm_vidc_internal_buffer_count(inst, buffer_type);
 			break;
 		case MSM_VIDC_BUF_DPB:
 			count = msm_buffer_decoder_dpb_count(inst);

+ 2 - 0
driver/vidc/inc/msm_vidc_buffer.h

@@ -21,6 +21,8 @@ u32 msm_vidc_input_min_count(struct msm_vidc_inst *inst);
 u32 msm_vidc_output_min_count(struct msm_vidc_inst *inst);
 u32 msm_vidc_input_extra_count(struct msm_vidc_inst *inst);
 u32 msm_vidc_output_extra_count(struct msm_vidc_inst *inst);
+u32 msm_vidc_internal_buffer_count(struct msm_vidc_inst *inst,
+	enum msm_vidc_buffer_type buffer_type);
 u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst);
 u32 msm_vidc_decoder_output_size(struct msm_vidc_inst *inst);
 u32 msm_vidc_decoder_input_meta_size(struct msm_vidc_inst *inst);

+ 33 - 0
driver/vidc/src/msm_vidc_buffer.c

@@ -163,6 +163,39 @@ u32 msm_vidc_output_extra_count(struct msm_vidc_inst *inst)
 	return count;
 }
 
+u32 msm_vidc_internal_buffer_count(struct msm_vidc_inst *inst,
+	enum msm_vidc_buffer_type buffer_type)
+{
+	u32 count = 0;
+
+	if (!inst) {
+		d_vpr_e("%s: invalid params\n", __func__);
+		return 0;
+	}
+
+	if (is_decode_session(inst)) {
+		if (buffer_type == MSM_VIDC_BUF_BIN ||
+			buffer_type == MSM_VIDC_BUF_LINE ||
+			buffer_type == MSM_VIDC_BUF_PERSIST) {
+			count = 1;
+		} else if (buffer_type == MSM_VIDC_BUF_COMV ||
+			buffer_type == MSM_VIDC_BUF_NON_COMV) {
+			if (inst->codec == MSM_VIDC_HEVC ||
+				inst->codec == MSM_VIDC_H264)
+				count = 1;
+			else
+				count = 0;
+		} else {
+			d_vpr_e("%s: unsupported buffer type %#x\n",
+				__func__, buffer_type);
+			count = 0;
+		}
+	}
+	//todo: add enc support if needed
+
+	return count;
+}
+
 u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
 {
 	u32 frame_size, num_mbs;