Jelajahi Sumber

video: driver: update condition to allow dynamic controls

When client queues input buffer with dynamic controls associated
with it and also sends drain command, it is possible that driver
state changes to DRAIN_LAST_FLAG and after that driver tries to apply
dynamic controls. For encoder currently, dynamic controls are
allowed only in START AND START_OUTPUT state. To resolve this
timing issue updated condition to allow dynamic controls as along
as master port is streaming.

Change-Id: I3fe6aa9f8ca8f89e7fffaf90940618cc6643b21b
Signed-off-by: Darshana Patil <[email protected]>
Darshana Patil 3 tahun lalu
induk
melakukan
fc3b1b5466
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      driver/vidc/src/msm_vidc_driver.c

+ 5 - 1
driver/vidc/src/msm_vidc_driver.c

@@ -1322,7 +1322,11 @@ bool msm_vidc_allow_s_ctrl(struct msm_vidc_inst *inst, u32 id)
 			}
 		}
 	} else if (is_encode_session(inst)) {
-		if (inst->state == MSM_VIDC_START || inst->state == MSM_VIDC_START_OUTPUT) {
+		if (!inst->bufq[OUTPUT_PORT].vb2q->streaming) {
+			allow = true;
+			goto exit;
+		}
+		if (inst->bufq[OUTPUT_PORT].vb2q->streaming) {
 			switch (id) {
 			case V4L2_CID_MPEG_VIDEO_BITRATE:
 			case V4L2_CID_MPEG_VIDEO_GOP_SIZE: