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

Commit ca8cc535 authored by Zhijun He's avatar Zhijun He Committed by Android (Google) Code Review
Browse files

Merge "Camera3Device: make request thread SCHED_FIFO for all cases" into nyc-mr1-dev

parents 77305a67 7ee4c077
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -2042,20 +2042,16 @@ status_t Camera3Device::configureStreamsLocked() {
    // across configure_streams() calls
    mRequestThread->configurationComplete(mIsConstrainedHighSpeedConfiguration);

    // Boost priority of request thread for high speed recording to SCHED_FIFO
    if (mIsConstrainedHighSpeedConfiguration) {
    // Boost priority of request thread to SCHED_FIFO.
    pid_t requestThreadTid = mRequestThread->getTid();
    res = requestPriority(getpid(), requestThreadTid,
                kConstrainedHighSpeedThreadPriority, /*asynchronous*/ false);
            kRequestThreadPriority, /*asynchronous*/ false);
    if (res != OK) {
        ALOGW("Can't set realtime priority for request processing thread: %s (%d)",
                strerror(-res), res);
    } else {
        ALOGD("Set real time priority for request queue thread (tid %d)", requestThreadTid);
    }
    } else {
        // TODO: Set/restore normal priority for normal use cases
    }

    // Update device state

+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ class Camera3Device :
    static const size_t        kInFlightWarnLimit = 20;
    static const size_t        kInFlightWarnLimitHighSpeed = 256; // batch size 32 * pipe depth 8
    // SCHED_FIFO priority for request submission thread in HFR mode
    static const int           kConstrainedHighSpeedThreadPriority = 1;
    static const int           kRequestThreadPriority = 1;

    struct                     RequestTrigger;
    // minimal jpeg buffer size: 256KB + blob header