Browse Source

Merge "video: driver: correct state checks for meta ports"

qctecmdr 4 years ago
parent
commit
d22cefa3b8
1 changed files with 8 additions and 2 deletions
  1. 8 2
      driver/vidc/src/msm_vidc_driver.c

+ 8 - 2
driver/vidc/src/msm_vidc_driver.c

@@ -721,14 +721,20 @@ bool msm_vidc_allow_streamoff(struct msm_vidc_inst *inst, u32 type)
 		d_vpr_e("%s: invalid params\n", __func__);
 		return false;
 	}
-	if (type == INPUT_MPLANE || type == INPUT_META_PLANE) {
+	if (type == INPUT_MPLANE) {
 		if (inst->state == MSM_VIDC_OPEN ||
 			inst->state == MSM_VIDC_START_OUTPUT)
 			allow = false;
-	} else if (type == OUTPUT_MPLANE || type == OUTPUT_META_PLANE) {
+	} else if (type == INPUT_META_PLANE) {
+		if (inst->state == MSM_VIDC_START_INPUT)
+			allow = false;
+	} else if (type == OUTPUT_MPLANE) {
 		if (inst->state == MSM_VIDC_OPEN ||
 			inst->state == MSM_VIDC_START_INPUT)
 			allow = false;
+	} else if (type == OUTPUT_META_PLANE) {
+		if (inst->state == MSM_VIDC_START_OUTPUT)
+			allow = false;
 	}
 	if (!allow)
 		s_vpr_e(inst->sid, "%s: type %d not allowed in state %s\n",