Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f31d60c5 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by android-build-merger
Browse files

Merge changes from topic 'b/62420820' into oc-dr1-dev

am: 1c19ca68

Change-Id: I448a1f3b9745ba30369296eac35393b3dc9940d3
parents 50df3109 1c19ca68
Loading
Loading
Loading
Loading
+12 −3
Original line number Original line Diff line number Diff line
@@ -2326,8 +2326,12 @@ status_t Camera3Device::registerInFlight(uint32_t frameNumber,
    if (res < 0) return res;
    if (res < 0) return res;


    if (mInFlightMap.size() == 1) {
    if (mInFlightMap.size() == 1) {
        // hold mLock to prevent race with disconnect
        Mutex::Autolock l(mLock);
        if (mStatusTracker != nullptr) {
            mStatusTracker->markComponentActive(mInFlightStatusId);
            mStatusTracker->markComponentActive(mInFlightStatusId);
        }
        }
    }


    return OK;
    return OK;
}
}
@@ -2353,9 +2357,13 @@ void Camera3Device::removeInFlightMapEntryLocked(int idx) {


    // Indicate idle inFlightMap to the status tracker
    // Indicate idle inFlightMap to the status tracker
    if (mInFlightMap.size() == 0) {
    if (mInFlightMap.size() == 0) {
        // hold mLock to prevent race with disconnect
        Mutex::Autolock l(mLock);
        if (mStatusTracker != nullptr) {
            mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE);
            mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE);
        }
        }
    }
    }
}


void Camera3Device::removeInFlightRequestIfReadyLocked(int idx) {
void Camera3Device::removeInFlightRequestIfReadyLocked(int idx) {


@@ -3590,7 +3598,8 @@ status_t Camera3Device::RequestThread::clear(
            // Abort the input buffers for reprocess requests.
            // Abort the input buffers for reprocess requests.
            if ((*it)->mInputStream != NULL) {
            if ((*it)->mInputStream != NULL) {
                camera3_stream_buffer_t inputBuffer;
                camera3_stream_buffer_t inputBuffer;
                status_t res = (*it)->mInputStream->getInputBuffer(&inputBuffer);
                status_t res = (*it)->mInputStream->getInputBuffer(&inputBuffer,
                        /*respectHalLimit*/ false);
                if (res != OK) {
                if (res != OK) {
                    ALOGW("%s: %d: couldn't get input buffer while clearing the request "
                    ALOGW("%s: %d: couldn't get input buffer while clearing the request "
                            "list: %s (%d)", __FUNCTION__, __LINE__, strerror(-res), res);
                            "list: %s (%d)", __FUNCTION__, __LINE__, strerror(-res), res);
+2 −2
Original line number Original line Diff line number Diff line
@@ -544,7 +544,7 @@ status_t Camera3Stream::returnBuffer(const camera3_stream_buffer &buffer,
    return res;
    return res;
}
}


status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer) {
status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit) {
    ATRACE_CALL();
    ATRACE_CALL();
    Mutex::Autolock l(mLock);
    Mutex::Autolock l(mLock);
    status_t res = OK;
    status_t res = OK;
@@ -557,7 +557,7 @@ status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer) {
    }
    }


    // Wait for new buffer returned back if we are running into the limit.
    // Wait for new buffer returned back if we are running into the limit.
    if (getHandoutInputBufferCountLocked() == camera3_stream::max_buffers) {
    if (getHandoutInputBufferCountLocked() == camera3_stream::max_buffers && respectHalLimit) {
        ALOGV("%s: Already dequeued max input buffers (%d), wait for next returned one.",
        ALOGV("%s: Already dequeued max input buffers (%d), wait for next returned one.",
                __FUNCTION__, camera3_stream::max_buffers);
                __FUNCTION__, camera3_stream::max_buffers);
        res = mInputBufferReturnedSignal.waitRelative(mLock, kWaitForBufferDuration);
        res = mInputBufferReturnedSignal.waitRelative(mLock, kWaitForBufferDuration);
+3 −1
Original line number Original line Diff line number Diff line
@@ -308,8 +308,10 @@ class Camera3Stream :
     * For bidirectional streams, this method applies to the input-side
     * For bidirectional streams, this method applies to the input-side
     * buffers.
     * buffers.
     *
     *
     * Normally this call will block until the handed out buffer count is less than the stream
     * max buffer count; if respectHalLimit is set to false, this is ignored.
     */
     */
    status_t         getInputBuffer(camera3_stream_buffer *buffer);
    status_t         getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit = true);


    /**
    /**
     * Return a buffer to the stream after use by the HAL.
     * Return a buffer to the stream after use by the HAL.
+3 −1
Original line number Original line Diff line number Diff line
@@ -232,8 +232,10 @@ class Camera3StreamInterface : public virtual RefBase {
     * For bidirectional streams, this method applies to the input-side
     * For bidirectional streams, this method applies to the input-side
     * buffers.
     * buffers.
     *
     *
     * Normally this call will block until the handed out buffer count is less than the stream
     * max buffer count; if respectHalLimit is set to false, this is ignored.
     */
     */
    virtual status_t getInputBuffer(camera3_stream_buffer *buffer) = 0;
    virtual status_t getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit = true) = 0;


    /**
    /**
     * Return a buffer to the stream after use by the HAL.
     * Return a buffer to the stream after use by the HAL.