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

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

Snap for 10884074 from 3bdb1331 to 24Q1-release

Change-Id: Ibed12b14e8660083b2c6f40e18cb0a6a962e6de9
parents ef6509eb 3bdb1331
Loading
Loading
Loading
Loading
+59 −34
Original line number Diff line number Diff line
@@ -29,8 +29,8 @@ std::vector<unique_fd> getRandomFds(FuzzedDataProvider* provider) {
    const char* fdType;

    std::vector<unique_fd> fds = provider->PickValueInArray<
            std::function<std::vector<unique_fd>()>>({
            [&]() {
            std::function<std::vector<unique_fd>()>>(
            {[&]() {
                 fdType = "ashmem";
                 std::vector<unique_fd> ret;
                 ret.push_back(unique_fd(
@@ -62,6 +62,31 @@ std::vector<unique_fd> getRandomFds(FuzzedDataProvider* provider) {
                 ret.push_back(unique_fd(pipefds[1]));
                 return ret;
             },
             [&]() {
                 fdType = "tempfd";
                 char name[PATH_MAX];
#if defined(__ANDROID__)
                 snprintf(name, sizeof(name), "/data/local/tmp/android-tempfd-test-%d-XXXXXX",
                          getpid());
#else
                 snprintf(name, sizeof(name), "/tmp/android-tempfd-test-%d-XXXXXX", getpid());
#endif
                 int fd = mkstemp(name);
                 CHECK_NE(fd, -1) << "Failed to create file " << name << ", errno: " << errno;
                 unlink(name);
                 if (provider->ConsumeBool()) {
                     CHECK_NE(TEMP_FAILURE_RETRY(
                                      ftruncate(fd,
                                                provider->ConsumeIntegralInRange<size_t>(0, 4096))),
                              -1)
                             << "Failed to truncate file, errno: " << errno;
                 }

                 std::vector<unique_fd> ret;
                 ret.push_back(unique_fd(fd));
                 return ret;
             }

            })();

    for (const auto& fd : fds) CHECK(fd.ok()) << fd.get() << " " << fdType;
+5 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,7 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay
        flags |= ISurfaceComposer::eEarlyWakeupEnd;
    }

    sp<IBinder> applyToken = mApplyToken ? mApplyToken : sApplyToken;
    sp<IBinder> applyToken = mApplyToken ? mApplyToken : getDefaultApplyToken();

    sp<ISurfaceComposer> sf(ComposerService::getComposerService());
    sf->setTransactionState(mFrameTimelineInfo, composerStates, displayStates, flags, applyToken,
@@ -1249,11 +1249,15 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay

sp<IBinder> SurfaceComposerClient::Transaction::sApplyToken = new BBinder();

std::mutex SurfaceComposerClient::Transaction::sApplyTokenMutex;

sp<IBinder> SurfaceComposerClient::Transaction::getDefaultApplyToken() {
    std::scoped_lock lock{sApplyTokenMutex};
    return sApplyToken;
}

void SurfaceComposerClient::Transaction::setDefaultApplyToken(sp<IBinder> applyToken) {
    std::scoped_lock lock{sApplyTokenMutex};
    sApplyToken = applyToken;
}

+1 −0
Original line number Diff line number Diff line
@@ -422,6 +422,7 @@ public:
    class Transaction : public Parcelable {
    private:
        static sp<IBinder> sApplyToken;
        static std::mutex sApplyTokenMutex;
        void releaseBufferIfOverwriting(const layer_state_t& state);
        static void mergeFrameTimelineInfo(FrameTimelineInfo& t, const FrameTimelineInfo& other);

+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ void GpuMem::initialize() {
    mInitialized.store(true);
}

void GpuMem::setGpuMemTotalMap(bpf::BpfMap<uint64_t, uint64_t>& map) {
void GpuMem::setGpuMemTotalMap(bpf::BpfMapRO<uint64_t, uint64_t>& map) {
    mGpuMemTotalMap = std::move(map);
}

+2 −2
Original line number Diff line number Diff line
@@ -44,12 +44,12 @@ private:
    friend class TestableGpuMem;

    // set gpu memory total map
    void setGpuMemTotalMap(bpf::BpfMap<uint64_t, uint64_t>& map);
    void setGpuMemTotalMap(bpf::BpfMapRO<uint64_t, uint64_t>& map);

    // indicate whether ebpf has been initialized
    std::atomic<bool> mInitialized = false;
    // bpf map for GPU memory total data
    android::bpf::BpfMap<uint64_t, uint64_t> mGpuMemTotalMap;
    android::bpf::BpfMapRO<uint64_t, uint64_t> mGpuMemTotalMap;

    // gpu memory tracepoint event category
    static constexpr char kGpuMemTraceGroup[] = "gpu_mem";
Loading