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

Commit 7879747f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12391343 from ec741152 to 24Q4-release

Change-Id: Ie2a1324933895fe5e2f744f968b1aaf93290bd74
parents 0bfc4046 ec741152
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -160,8 +160,7 @@ typedef struct ASurfaceTransactionStats ASurfaceTransactionStats;
 * Available since API level 29.
 */
typedef void (*ASurfaceTransaction_OnComplete)(void* _Null_unspecified context,
                                               ASurfaceTransactionStats* _Nonnull stats)
        __INTRODUCED_IN(29);
                                               ASurfaceTransactionStats* _Nonnull stats);

/**
 * The ASurfaceTransaction_OnCommit callback is invoked when transaction is applied and the updates
@@ -189,8 +188,7 @@ typedef void (*ASurfaceTransaction_OnComplete)(void* _Null_unspecified context,
 * Available since API level 31.
 */
typedef void (*ASurfaceTransaction_OnCommit)(void* _Null_unspecified context,
                                             ASurfaceTransactionStats* _Nonnull stats)
        __INTRODUCED_IN(31);
                                             ASurfaceTransactionStats* _Nonnull stats);

/**
 * The ASurfaceTransaction_OnBufferRelease callback is invoked when a buffer that was passed in
@@ -219,7 +217,7 @@ typedef void (*ASurfaceTransaction_OnCommit)(void* _Null_unspecified context,
 * Available since API level 36.
 */
typedef void (*ASurfaceTransaction_OnBufferRelease)(void* _Null_unspecified context,
                                                    int release_fence_fd) __INTRODUCED_IN(36);
                                                    int release_fence_fd);

/**
 * Returns the timestamp of when the frame was latched by the framework. Once a frame is
+9 −0
Original line number Diff line number Diff line
@@ -47,6 +47,13 @@ struct Resampler {
     */
    virtual void resampleMotionEvent(std::chrono::nanoseconds frameTime, MotionEvent& motionEvent,
                                     const InputMessage* futureSample) = 0;

    /**
     * Returns resample latency. Resample latency is the time difference between frame time and
     * resample time. More precisely, let frameTime and resampleTime be two timestamps, and
     * frameTime > resampleTime. Resample latency is defined as frameTime - resampleTime.
     */
    virtual std::chrono::nanoseconds getResampleLatency() const = 0;
};

class LegacyResampler final : public Resampler {
@@ -63,6 +70,8 @@ public:
    void resampleMotionEvent(std::chrono::nanoseconds frameTime, MotionEvent& motionEvent,
                             const InputMessage* futureSample) override;

    std::chrono::nanoseconds getResampleLatency() const override;

private:
    struct Pointer {
        PointerProperties properties;
+7 −9
Original line number Diff line number Diff line
@@ -499,11 +499,11 @@ static void testThreadPoolOverSaturated(sp<IBinderRpcTest> iface, size_t numCall

    EXPECT_GE(epochMsAfter, epochMsBefore + 2 * sleepMs);

    // Potential flake, but make sure calls are handled in parallel. Due
    // to past flakes, this only checks that the amount of time taken has
    // some parallelism. Other tests such as ThreadPoolGreaterThanEqualRequested
    // check this more exactly.
    EXPECT_LE(epochMsAfter, epochMsBefore + (numCalls - 1) * sleepMs);
    // b/272429574, b/365294257
    // This flakes too much to test. Parallelization is tested
    // in ThreadPoolGreaterThanEqualRequested and other tests.
    // Test to make sure calls are handled in parallel.
    // EXPECT_LE(epochMsAfter, epochMsBefore + (numCalls - 1) * sleepMs);
}

TEST_P(BinderRpc, ThreadPoolOverSaturated) {
@@ -515,8 +515,7 @@ TEST_P(BinderRpc, ThreadPoolOverSaturated) {
    constexpr size_t kNumCalls = kNumThreads + 3;
    auto proc = createRpcTestSocketServerProcess({.numThreads = kNumThreads});

    // b/272429574 - below 500ms, the test fails
    testThreadPoolOverSaturated(proc.rootIface, kNumCalls, 500 /*ms*/);
    testThreadPoolOverSaturated(proc.rootIface, kNumCalls, 200 /*ms*/);
}

TEST_P(BinderRpc, ThreadPoolLimitOutgoing) {
@@ -530,8 +529,7 @@ TEST_P(BinderRpc, ThreadPoolLimitOutgoing) {
    auto proc = createRpcTestSocketServerProcess(
            {.numThreads = kNumThreads, .numOutgoingConnections = kNumOutgoingConnections});

    // b/272429574 - below 500ms, the test fails
    testThreadPoolOverSaturated(proc.rootIface, kNumCalls, 500 /*ms*/);
    testThreadPoolOverSaturated(proc.rootIface, kNumCalls, 200 /*ms*/);
}

TEST_P(BinderRpc, ThreadingStressTest) {
+8 −1
Original line number Diff line number Diff line
@@ -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, ...)                                                                           \
@@ -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
@@ -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);
@@ -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.
+9 −1
Original line number Diff line number Diff line
@@ -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