camera: update AU_LINUX_ANDROID_LA.BF64.1.2.9.05.01.00.089.230

1d0e294 Camera3: Do not block process_capture_request for a reprocess request
073c23a Revert "QCamera2/HAL3: Disable analysis stream for HFR"
57b01eb Camera3: Enable log message for buffer drop

Change-Id: I872ccd08a3ad57bed07f111030c79e00517bcc0c
diff --git a/QCamera2/HAL3/QCamera3HWI.cpp b/QCamera2/HAL3/QCamera3HWI.cpp
old mode 100755
new mode 100644
index 68331ef..b641755
--- a/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/QCamera2/HAL3/QCamera3HWI.cpp
@@ -360,7 +360,7 @@
     gCamCapability[cameraId]->min_num_pp_bufs = 3;
 
     pthread_cond_init(&mRequestCond, NULL);
-    mPendingRequest = 0;
+    mPendingLiveRequest = 0;
     mCurrentRequestId = -1;
     pthread_mutex_init(&mMutex, NULL);
 
@@ -1414,8 +1414,7 @@
     }
 
     // Create analysis stream all the time, even when h/w support is not available
-    // TODO: This is WAR. Need to enable analysis stream for HFR as well
-    if (mOpMode != CAMERA3_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE) {
+    {
         mAnalysisChannel = new QCamera3SupportChannel(
                 mCameraHandle->camera_handle,
                 mCameraHandle->ops,
@@ -2070,7 +2069,6 @@
                     mCallbackOps->process_capture_result(mCallbackOps, &result);
 
                     erasePendingRequest(k);
-                    mPendingRequest--;
                     break;
                 }
             }
@@ -2348,6 +2346,8 @@
 
     for (pendingRequestIterator i = mPendingRequestsList.begin();
             i != mPendingRequestsList.end() && i->frame_number <= frame_number;) {
+        // Flush out all entries with less or equal frame numbers.
+
         camera3_capture_result_t result;
         memset(&result, 0, sizeof(camera3_capture_result_t));
 
@@ -2355,9 +2355,6 @@
         i->partial_result_cnt++;
         result.partial_result = i->partial_result_cnt;
 
-        // Flush out all entries with less or equal frame numbers.
-        mPendingRequest--;
-
         // Check whether any stream buffer corresponding to this is dropped or not
         // If dropped, then send the ERROR_BUFFER for the corresponding stream
         // The API does not expect a blob buffer to be dropped
@@ -2373,14 +2370,14 @@
                    for (uint32_t k = 0; k < p_cam_frame_drop->cam_stream_ID.num_streams; k++) {
                        if (streamID == p_cam_frame_drop->cam_stream_ID.streamID[k]) {
                            // Send Error notify to frameworks with CAMERA3_MSG_ERROR_BUFFER
-                           CDBG("%s: Start of reporting error frame#=%u, streamID=%u",
+                           ALOGW("%s: Start of reporting error frame#=%u, streamID=%u",
                                    __func__, i->frame_number, streamID);
                            notify_msg.type = CAMERA3_MSG_ERROR;
                            notify_msg.message.error.frame_number = i->frame_number;
                            notify_msg.message.error.error_code = CAMERA3_MSG_ERROR_BUFFER ;
                            notify_msg.message.error.error_stream = j->stream;
                            mCallbackOps->notify(mCallbackOps, &notify_msg);
-                           CDBG("%s: End of reporting error frame#=%u, streamID=%u",
+                           ALOGW("%s: End of reporting error frame#=%u, streamID=%u",
                                   __func__, i->frame_number, streamID);
                            PendingFrameDropInfo PendingFrameDrop;
                            PendingFrameDrop.frame_number=i->frame_number;
@@ -2389,6 +2386,9 @@
                            mPendingFrameDropList.push_back(PendingFrameDrop);
                       }
                    }
+               } else {
+                   ALOGE("%s: JPEG buffer dropped for frame number %d",
+                           __func__, i->frame_number);
                }
             }
         }
@@ -2429,6 +2429,7 @@
                 CDBG("%s: Input request metadata notify frame_number = %u, capture_time = %llu",
                        __func__, i->frame_number, notify_msg.message.shutter.timestamp);
             } else {
+                mPendingLiveRequest--;
                 CameraMetadata dummyMetadata;
                 dummyMetadata.update(ANDROID_SENSOR_TIMESTAMP,
                         &i->timestamp, 1);
@@ -2441,6 +2442,7 @@
             CDBG("%s: Support notification !!!! notify frame_number = %u, capture_time = %llu",
                        __func__, i->frame_number, notify_msg.message.shutter.timestamp);
         } else {
+            mPendingLiveRequest--;
             /* Clear notify_msg structure */
             camera3_notify_msg_t notify_msg;
             memset(&notify_msg, 0, sizeof(camera3_notify_msg_t));
@@ -2526,7 +2528,7 @@
                         uint32_t streamID = channel->getStreamID(channel->getStreamTypeMask());
                         if((m->stream_ID == streamID) && (m->frame_number==frame_number)) {
                             j->buffer->status=CAMERA3_BUFFER_STATUS_ERROR;
-                            CDBG("%s: Stream STATUS_ERROR frame_number=%u, streamID=%u",
+                            ALOGW("%s: Stream STATUS_ERROR frame_number=%u, streamID=%u",
                                   __func__, frame_number, streamID);
                             m = mPendingFrameDropList.erase(m);
                             break;
@@ -2576,6 +2578,7 @@
             i != mPendingRequestsList.end() ;i++) {
         i->pipeline_depth++;
     }
+    CDBG("%s: mPendingLiveRequest = %d", __func__, mPendingLiveRequest);
     unblockRequestIfNecessary();
 
 }
@@ -2717,7 +2720,6 @@
                 mCallbackOps->process_capture_result(mCallbackOps, &result);
                 CDBG("%s: Notify reprocess now %d!", __func__, frame_number);
                 i = erasePendingRequest(i);
-                mPendingRequest--;
             } else {
                 // Cache reprocess result for later
                 PendingReprocessResult pendingResult;
@@ -2786,7 +2788,7 @@
     uint32_t minInFlightRequests = MIN_INFLIGHT_REQUESTS;
     uint32_t maxInFlightRequests = MAX_INFLIGHT_REQUESTS;
     bool isVidBufRequested = false;
-    camera3_stream_buffer_t *pInputBuffer;
+    camera3_stream_buffer_t *pInputBuffer = NULL;
 
     pthread_mutex_lock(&mMutex);
 
@@ -3085,7 +3087,7 @@
             }
         }
         mWokenUpByDaemon = false;
-        mPendingRequest = 0;
+        mPendingLiveRequest = 0;
         mFirstConfiguration = false;
     }
 
@@ -3375,8 +3377,11 @@
             /* reset to zero coz, the batch is queued */
             mToBeQueuedVidBufs = 0;
         }
+        mPendingLiveRequest++;
     }
 
+    CDBG("%s: mPendingLiveRequest = %d", __func__, mPendingLiveRequest);
+
     mFirstRequest = false;
     // Added a timed condition wait
     struct timespec ts;
@@ -3391,14 +3396,12 @@
       ts.tv_sec += 5;
     }
     //Block on conditional variable
-
-    mPendingRequest++;
     if (mBatchSize) {
         /* For HFR, more buffers are dequeued upfront to improve the performance */
         minInFlightRequests = (MIN_INFLIGHT_REQUESTS + 1) * mBatchSize;
         maxInFlightRequests = MAX_INFLIGHT_REQUESTS * mBatchSize;
     }
-    while (mPendingRequest >= minInFlightRequests) {
+    while ((mPendingLiveRequest >= minInFlightRequests) && !pInputBuffer) {
         if (!isValidTimeout) {
             CDBG("%s: Blocking on conditional wait", __func__);
             pthread_cond_wait(&mRequestCond, &mMutex);
@@ -3415,7 +3418,7 @@
         CDBG("%s: Unblocked", __func__);
         if (mWokenUpByDaemon) {
             mWokenUpByDaemon = false;
-            if (mPendingRequest < maxInFlightRequests)
+            if (mPendingLiveRequest < maxInFlightRequests)
                 break;
         }
     }
@@ -3514,7 +3517,7 @@
     pthread_mutex_lock(&mMutex);
 
     // Unblock process_capture_request
-    mPendingRequest = 0;
+    mPendingLiveRequest = 0;
     pthread_cond_signal(&mRequestCond);
 
     rc = notifyErrorForPendingRequests();
diff --git a/QCamera2/HAL3/QCamera3HWI.h b/QCamera2/HAL3/QCamera3HWI.h
index 40478ed..13161ab 100644
--- a/QCamera2/HAL3/QCamera3HWI.h
+++ b/QCamera2/HAL3/QCamera3HWI.h
@@ -362,7 +362,7 @@
     List<PendingFrameDropInfo> mPendingFrameDropList;
     PendingBuffersMap mPendingBuffersMap;
     pthread_cond_t mRequestCond;
-    uint32_t mPendingRequest;
+    uint32_t mPendingLiveRequest;
     bool mWokenUpByDaemon;
     int32_t mCurrentRequestId;
     cam_stream_size_info_t mStreamConfigInfo;