Loading libs/gui/BufferQueueProducer.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,10 @@ #include <system/window.h> #include <com_android_graphics_libgui_flags.h> namespace android { using namespace com::android::graphics::libgui; // Macros for include BufferQueueCore information in log messages #define BQ_LOGV(x, ...) \ Loading Loading @@ -924,6 +927,7 @@ status_t BufferQueueProducer::queueBuffer(int slot, uint64_t currentFrameNumber = 0; BufferItem item; int connectedApi; bool enableEglCpuThrottling = true; sp<Fence> lastQueuedFence; { // Autolock scope Loading Loading @@ -1097,6 +1101,9 @@ status_t BufferQueueProducer::queueBuffer(int slot, VALIDATE_CONSISTENCY(); connectedApi = mCore->mConnectedApi; if (flags::bq_producer_throttles_only_async_mode()) { enableEglCpuThrottling = mCore->mAsyncMode || mCore->mDequeueBufferCannotBlock; } lastQueuedFence = std::move(mLastQueueBufferFence); mLastQueueBufferFence = std::move(acquireFence); Loading Loading @@ -1142,7 +1149,7 @@ status_t BufferQueueProducer::queueBuffer(int slot, } // Wait without lock held if (connectedApi == NATIVE_WINDOW_API_EGL) { if (connectedApi == NATIVE_WINDOW_API_EGL && enableEglCpuThrottling) { // Waiting here allows for two full buffers to be queued but not a // third. In the event that frames take varying time, this makes a // small trade-off in favor of latency rather than throughput. Loading libs/gui/libgui_flags.aconfig +9 −1 Original line number Diff line number Diff line Loading @@ -107,3 +107,11 @@ flag { bug: "342197849" is_fixed_read_only: true } # wb_libcameraservice flag { name: "bq_producer_throttles_only_async_mode" namespace: "core_graphics" description: "BufferQueueProducer only CPU throttle on queueBuffer() in async mode." bug: "359252619" is_fixed_read_only: true } # bq_producer_throttles_only_async_mode Loading
libs/gui/BufferQueueProducer.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,10 @@ #include <system/window.h> #include <com_android_graphics_libgui_flags.h> namespace android { using namespace com::android::graphics::libgui; // Macros for include BufferQueueCore information in log messages #define BQ_LOGV(x, ...) \ Loading Loading @@ -924,6 +927,7 @@ status_t BufferQueueProducer::queueBuffer(int slot, uint64_t currentFrameNumber = 0; BufferItem item; int connectedApi; bool enableEglCpuThrottling = true; sp<Fence> lastQueuedFence; { // Autolock scope Loading Loading @@ -1097,6 +1101,9 @@ status_t BufferQueueProducer::queueBuffer(int slot, VALIDATE_CONSISTENCY(); connectedApi = mCore->mConnectedApi; if (flags::bq_producer_throttles_only_async_mode()) { enableEglCpuThrottling = mCore->mAsyncMode || mCore->mDequeueBufferCannotBlock; } lastQueuedFence = std::move(mLastQueueBufferFence); mLastQueueBufferFence = std::move(acquireFence); Loading Loading @@ -1142,7 +1149,7 @@ status_t BufferQueueProducer::queueBuffer(int slot, } // Wait without lock held if (connectedApi == NATIVE_WINDOW_API_EGL) { if (connectedApi == NATIVE_WINDOW_API_EGL && enableEglCpuThrottling) { // Waiting here allows for two full buffers to be queued but not a // third. In the event that frames take varying time, this makes a // small trade-off in favor of latency rather than throughput. Loading
libs/gui/libgui_flags.aconfig +9 −1 Original line number Diff line number Diff line Loading @@ -107,3 +107,11 @@ flag { bug: "342197849" is_fixed_read_only: true } # wb_libcameraservice flag { name: "bq_producer_throttles_only_async_mode" namespace: "core_graphics" description: "BufferQueueProducer only CPU throttle on queueBuffer() in async mode." bug: "359252619" is_fixed_read_only: true } # bq_producer_throttles_only_async_mode