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

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

Snap for 8090552 from a0579e73 to tm-d1-release

Change-Id: Ic99eb84220f0404f85de24a570de11acdf3a0883
parents b6f09730 a0579e73
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ impl<'a> BorrowedParcel<'a> {
    {
        let start = self.get_data_position();
        let parcelable_size: i32 = self.read()?;
        if parcelable_size < 0 {
        if parcelable_size < 4 {
            return Err(StatusCode::BAD_VALUE);
        }

+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ cc_defaults {
        "libcutils",
        "libgfxstats",
        "libgpumem",
        "libgpuwork",
        "libgpumemtracer",
        "libgraphicsenv",
        "liblog",
+18 −3
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <binder/PermissionCache.h>
#include <cutils/properties.h>
#include <gpumem/GpuMem.h>
#include <gpuwork/GpuWork.h>
#include <gpustats/GpuStats.h>
#include <private/android_filesystem_config.h>
#include <tracing/GpuMemTracer.h>
@@ -50,13 +51,20 @@ const char* const GpuService::SERVICE_NAME = "gpu";

GpuService::GpuService()
      : mGpuMem(std::make_shared<GpuMem>()),
        mGpuWork(std::make_shared<gpuwork::GpuWork>()),
        mGpuStats(std::make_unique<GpuStats>()),
        mGpuMemTracer(std::make_unique<GpuMemTracer>()) {
    std::thread asyncInitThread([this]() {

    std::thread gpuMemAsyncInitThread([this]() {
        mGpuMem->initialize();
        mGpuMemTracer->initialize(mGpuMem);
    });
    asyncInitThread.detach();
    gpuMemAsyncInitThread.detach();

    std::thread gpuWorkAsyncInitThread([this]() {
        mGpuWork->initialize();
    });
    gpuWorkAsyncInitThread.detach();
};

void GpuService::setGpuStats(const std::string& driverPackageName,
@@ -124,6 +132,7 @@ status_t GpuService::doDump(int fd, const Vector<String16>& args, bool /*asProto
        bool dumpDriverInfo = false;
        bool dumpMem = false;
        bool dumpStats = false;
        bool dumpWork = false;
        size_t numArgs = args.size();

        if (numArgs) {
@@ -134,9 +143,11 @@ status_t GpuService::doDump(int fd, const Vector<String16>& args, bool /*asProto
                    dumpDriverInfo = true;
                } else if (args[index] == String16("--gpumem")) {
                    dumpMem = true;
                } else if (args[index] == String16("--gpuwork")) {
                    dumpWork = true;
                }
            }
            dumpAll = !(dumpDriverInfo || dumpMem || dumpStats);
            dumpAll = !(dumpDriverInfo || dumpMem || dumpStats || dumpWork);
        }

        if (dumpAll || dumpDriverInfo) {
@@ -151,6 +162,10 @@ status_t GpuService::doDump(int fd, const Vector<String16>& args, bool /*asProto
            mGpuStats->dump(args, &result);
            result.append("\n");
        }
         if (dumpAll || dumpWork) {
            mGpuWork->dump(args, &result);
            result.append("\n");
        }
    }

    write(fd, result.c_str(), result.size());
+5 −0
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@

namespace android {

namespace gpuwork {
class GpuWork;
}

class GpuMem;
class GpuStats;
class GpuMemTracer;
@@ -77,6 +81,7 @@ private:
     * Attributes
     */
    std::shared_ptr<GpuMem> mGpuMem;
    std::shared_ptr<gpuwork::GpuWork> mGpuWork;
    std::unique_ptr<GpuStats> mGpuStats;
    std::unique_ptr<GpuMemTracer> mGpuMemTracer;
    std::mutex mLock;
+61 −0
Original line number Diff line number Diff line
// Copyright 2022 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package {
    default_applicable_licenses: ["frameworks_native_license"],
}

cc_library_shared {
    name: "libgpuwork",
    srcs: [
        "GpuWork.cpp",
    ],
    header_libs: [
        "gpu_work_structs",
    ],
    shared_libs: [
        "libbase",
        "libbinder",
        "libbpf_bcc",
        "libbpf_android",
        "libcutils",
        "liblog",
        "libstatslog",
        "libstatspull",
        "libutils",
    ],
    export_include_dirs: [
        "include",
    ],
    export_header_lib_headers: [
        "gpu_work_structs",
    ],
    export_shared_lib_headers: [
        "libbase",
        "libbpf_android",
        "libstatspull",
    ],
    cppflags: [
        "-Wall",
        "-Werror",
        "-Wformat",
        "-Wthread-safety",
        "-Wunused",
        "-Wunreachable-code",
    ],
    required: [
        "bpfloader",
        "gpu_work.o",
    ],
}
Loading