Przeglądaj źródła

video: driver: Skip subscription/delivery when not required

Avoid sending subscribe or delivery comannds to firmware
when no metadata is enabled by client.

Change-Id: I379aa018b676ebc9b7e327757213371dbf089d53
Signed-off-by: Mihir Ganu <[email protected]>
Mihir Ganu 4 lat temu
rodzic
commit
0750c2bb02

+ 6 - 0
driver/vidc/src/msm_vdec.c

@@ -1003,6 +1003,9 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
 		}
 	};
 
+	if (!count)
+		return 0;
+
 	rc = venus_hfi_session_command(inst,
 			HFI_CMD_SUBSCRIBE_MODE,
 			port,
@@ -1042,6 +1045,9 @@ static int msm_vdec_set_delivery_mode_metadata(struct msm_vidc_inst *inst,
 		}
 	};
 
+	if (!count)
+		return 0;
+
 	rc = venus_hfi_session_command(inst,
 			HFI_CMD_DELIVERY_MODE,
 			port,

+ 6 - 0
driver/vidc/src/msm_venc.c

@@ -659,6 +659,9 @@ static int msm_venc_metadata_delivery(struct msm_vidc_inst *inst,
 		}
 	};
 
+	if (!count)
+		return 0;
+
 	rc = venus_hfi_session_command(inst,
 			HFI_CMD_DELIVERY_MODE,
 			port,
@@ -703,6 +706,9 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
 		}
 	};
 
+	if (!count)
+		return 0;
+
 	rc = venus_hfi_session_command(inst,
 			HFI_CMD_SUBSCRIBE_MODE,
 			port,

+ 1 - 1
driver/vidc/src/venus_hfi_response.c

@@ -1200,7 +1200,7 @@ static int handle_session_response(struct msm_vidc_core *core,
 				else if (packet->port == HFI_PORT_RAW)
 					rc = queue_response_work(inst, RESP_WORK_OUTPUT_PSC,
 						(void *)hdr, hdr->size);
-					goto exit;
+				goto exit;
 			} else if (packet->type == HFI_CMD_BUFFER &&
 						packet->port == HFI_PORT_RAW &&
 						check_last_flag(inst, packet)) {