QCamera2: HAL3: Improve camera startup time

Send 1st request before STREAM_ON so that the setting can be applied
sooner. Now the first output can be as early as the 2nd sensor frame.
The first sensor frame is usally skipped at the hardware level.

Test: Camera CTS and GoogleCamera manual test.
Bug: 35937454
Change-Id: Ib187e4b5bc7dadfb65c177e8a101fe674d40f30f
diff --git a/msm8998/QCamera2/HAL3/QCamera3HWI.h b/msm8998/QCamera2/HAL3/QCamera3HWI.h
index 2af6974..6d068de 100644
--- a/msm8998/QCamera2/HAL3/QCamera3HWI.h
+++ b/msm8998/QCamera2/HAL3/QCamera3HWI.h
@@ -500,7 +500,7 @@
         List<RequestedBufferInfo> buffers;
         List<InternalRequest> internalRequestList;
         int blob_request;
-        uint8_t bUrgentReceived;
+        uint8_t bUseFirstPartial; // Use first available partial result in case of jumpstart.
         nsecs_t timestamp;
         camera3_stream_buffer_t *input_buffer;
         const camera_metadata_t *settings;
@@ -655,6 +655,11 @@
     int (*LINK_get_surface_pixel_alignment)();
     uint32_t mSurfaceStridePadding;
 
+    bool mFirstMetadataCallback;
+    void sendPartialMetadataWithLock(metadata_buffer_t *metadata,
+            const pendingRequestIterator requestIter,
+            bool lastUrgentMetadataInBatch);
+
     State mState;
     //Dual camera related params
     bool mIsDeviceLinked;