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

Commit 240b1357 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13899080 from 9ec93b30 to 25Q4-release

Change-Id: I2aa060018ecdd4b919a06451a41f92dc2560eb50
parents 218a59ff 9ec93b30
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@

#define LOG_TAG "GraphicBufferAllocator"
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#define ATRACE_ALLOC_COUNTER_NAME "mem.gralloc.buffers"
#define ATRACE_ALLOC_TRACK_NAME "mem.gralloc.allocations"

#include <ui/GraphicBufferAllocator.h>

@@ -41,6 +43,7 @@ namespace android {
// ---------------------------------------------------------------------------

using base::StringAppendF;
using base::StringPrintf;

ANDROID_SINGLETON_STATIC_INSTANCE( GraphicBufferAllocator )

@@ -183,6 +186,13 @@ auto GraphicBufferAllocator::allocate(const AllocationRequest& request) -> Alloc
    rec.requestorName = request.requestorName;
    list.add(result.handle, rec);

    if (ATRACE_ENABLED()) {
        ATRACE_INT64(ATRACE_ALLOC_COUNTER_NAME, list.size());
        std::string allocInfo = std::format("[{}] {}x{} - {:p}", rec.requestorName, width, height,
                                            static_cast<const void*>(result.handle));
        ATRACE_INSTANT_FOR_TRACK(ATRACE_ALLOC_TRACK_NAME, allocInfo.c_str());
    }

    return result;
}

@@ -249,6 +259,13 @@ status_t GraphicBufferAllocator::allocateHelper(uint32_t width, uint32_t height,
    rec.requestorName = std::move(requestorName);
    list.add(*handle, rec);

    if (ATRACE_ENABLED()) {
        ATRACE_INT64(ATRACE_ALLOC_COUNTER_NAME, list.size());
        std::string allocInfo = std::format("[{}] {}x{} - {:p}", rec.requestorName, width, height,
                                            static_cast<const void*>(handle));
        ATRACE_INSTANT_FOR_TRACK(ATRACE_ALLOC_TRACK_NAME, allocInfo.c_str());
    }

    return NO_ERROR;
}
status_t GraphicBufferAllocator::allocate(uint32_t width, uint32_t height, PixelFormat format,
@@ -288,6 +305,11 @@ status_t GraphicBufferAllocator::free(buffer_handle_t handle)
    KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
    list.removeItem(handle);

    if (ATRACE_ENABLED()) {
        ATRACE_INT64(ATRACE_ALLOC_COUNTER_NAME, list.size());
        std::string freeInfo = std::format("free - {:p}", static_cast<const void*>(handle));
        ATRACE_INSTANT_FOR_TRACK(ATRACE_ALLOC_TRACK_NAME, freeInfo.c_str());
    }
    return NO_ERROR;
}

+4 −1
Original line number Diff line number Diff line
@@ -75,7 +75,10 @@ Transactions with the same applyToken. By default each process and each buffer p
provides a unique ApplyToken. This prevents clients from affecting one another, and possibly
slowing each other down.


Transactions from different processes can be ordered with barriers.
Process A can enqueue a transaction with a WAIT token `t`.  It will not be applied
(up to expiration timeout) until a transaction from process B with a SIGNAL for
the same token `t` is applied.

## Architecture
SurfaceFlinger FrontEnd intends to optimize for predictability and performance because state
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ std::vector<unsigned> getModeDivisorsFromAnchorList(const DisplayMode& mode, Fps
}

std::vector<unsigned> getModeDivisors(const DisplayMode& mode, FpsRange range,
                                      std::vector<Fps> anchorList, size_t numFrameRates,
                                      const std::vector<Fps>& anchorList, size_t numFrameRates,
                                      bool enableFrameRateOverride) {
    if (!enableFrameRateOverride) {
        return {1};
+1 −2
Original line number Diff line number Diff line
@@ -721,8 +721,7 @@ VSyncPredictor::VsyncTimeline::VsyncTimeline(TimePoint knownVsync, Period idealP
void VSyncPredictor::VsyncTimeline::freeze(Model model, TimePoint lastVsync,
                                           std::vector<FrameRateOverride> frameRateOverrides) {
    LOG_ALWAYS_FATAL_IF(mValidUntil.has_value());
    if (FlagManager::getInstance().vsync_predictor_rate_change_with_aligned_sequence() &&
        !frameRateOverrides.empty() && mLastVsyncSequence) {
    if (!frameRateOverrides.empty() && mLastVsyncSequence) {
        const int64_t renderRatePhase =
                getFreezeSequencePhase(model, lastVsync, std::move(frameRateOverrides));
        lastVsync = TimePoint::fromNs(lastVsync.ns() + model.slope * renderRatePhase);
+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@
    }
  ],
  "presubmit": [
    {
      "name": "surfaceflinger_flag_check"
    },
    {
      "name": "libsurfaceflinger_unittest"
    },
Loading