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

Commit 1d7e2fc8 authored by Xin Li's avatar Xin Li
Browse files

Merge Android10 QPR1 into AOSP master

Bug: 145570283
Change-Id: I044d0762cbf1c870afffda7ea2b8739fdfc47570
parents 46ba04df f5a264a6
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -40,7 +40,6 @@
    <feature name="android.software.voice_recognizers" notLowRam="true" />
    <feature name="android.software.voice_recognizers" notLowRam="true" />
    <feature name="android.software.backup" />
    <feature name="android.software.backup" />
    <feature name="android.software.home_screen" />
    <feature name="android.software.home_screen" />
    <feature name="android.software.print" />
    <feature name="android.software.companion_device_setup" />
    <feature name="android.software.companion_device_setup" />
    <feature name="android.software.autofill" />
    <feature name="android.software.autofill" />
    <feature name="android.software.cant_save_state" />
    <feature name="android.software.cant_save_state" />
+1 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@ static const char* native_processes_to_dump[] = {
static const char* hal_interfaces_to_dump[] {
static const char* hal_interfaces_to_dump[] {
        "android.hardware.audio@2.0::IDevicesFactory",
        "android.hardware.audio@2.0::IDevicesFactory",
        "android.hardware.audio@4.0::IDevicesFactory",
        "android.hardware.audio@4.0::IDevicesFactory",
        "android.hardware.audio@5.0::IDevicesFactory",
        "android.hardware.biometrics.face@1.0::IBiometricsFace",
        "android.hardware.biometrics.face@1.0::IBiometricsFace",
        "android.hardware.bluetooth@1.0::IBluetoothHci",
        "android.hardware.bluetooth@1.0::IBluetoothHci",
        "android.hardware.camera.provider@2.4::ICameraProvider",
        "android.hardware.camera.provider@2.4::ICameraProvider",
+3 −3
Original line number Original line Diff line number Diff line
@@ -269,14 +269,14 @@ static sp<IGpuService> getGpuService() {
    return interface_cast<IGpuService>(binder);
    return interface_cast<IGpuService>(binder);
}
}


void GraphicsEnv::setCpuVulkanInUse() {
void GraphicsEnv::setTargetStats(const Stats stats, const uint64_t value) {
    ATRACE_CALL();
    ATRACE_CALL();


    // Use the same stats lock to protect getGpuService() as well.
    std::lock_guard<std::mutex> lock(mStatsLock);
    std::lock_guard<std::mutex> lock(mStatsLock);
    const sp<IGpuService> gpuService = getGpuService();
    const sp<IGpuService> gpuService = getGpuService();
    if (gpuService) {
    if (gpuService) {
        gpuService->setCpuVulkanInUse(mGpuStats.appPackageName, mGpuStats.driverVersionCode);
        gpuService->setTargetStats(mGpuStats.appPackageName, mGpuStats.driverVersionCode, stats,
                                   value);
    }
    }
}
}


+14 −5
Original line number Original line Diff line number Diff line
@@ -92,15 +92,17 @@ public:
        return reply.readParcelableVector(outStats);
        return reply.readParcelableVector(outStats);
    }
    }


    virtual void setCpuVulkanInUse(const std::string& appPackageName,
    virtual void setTargetStats(const std::string& appPackageName, const uint64_t driverVersionCode,
                                   const uint64_t driverVersionCode) {
                                const GraphicsEnv::Stats stats, const uint64_t value) {
        Parcel data, reply;
        Parcel data, reply;
        data.writeInterfaceToken(IGpuService::getInterfaceDescriptor());
        data.writeInterfaceToken(IGpuService::getInterfaceDescriptor());


        data.writeUtf8AsUtf16(appPackageName);
        data.writeUtf8AsUtf16(appPackageName);
        data.writeUint64(driverVersionCode);
        data.writeUint64(driverVersionCode);
        data.writeInt32(static_cast<int32_t>(stats));
        data.writeUint64(value);


        remote()->transact(BnGpuService::SET_CPU_VULKAN_IN_USE, data, &reply, IBinder::FLAG_ONEWAY);
        remote()->transact(BnGpuService::SET_TARGET_STATS, data, &reply, IBinder::FLAG_ONEWAY);
    }
    }
};
};


@@ -174,7 +176,7 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep


            return OK;
            return OK;
        }
        }
        case SET_CPU_VULKAN_IN_USE: {
        case SET_TARGET_STATS: {
            CHECK_INTERFACE(IGpuService, data, reply);
            CHECK_INTERFACE(IGpuService, data, reply);


            std::string appPackageName;
            std::string appPackageName;
@@ -183,7 +185,14 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep
            uint64_t driverVersionCode;
            uint64_t driverVersionCode;
            if ((status = data.readUint64(&driverVersionCode)) != OK) return status;
            if ((status = data.readUint64(&driverVersionCode)) != OK) return status;


            setCpuVulkanInUse(appPackageName, driverVersionCode);
            int32_t stats;
            if ((status = data.readInt32(&stats)) != OK) return status;

            uint64_t value;
            if ((status = data.readUint64(&value)) != OK) return status;

            setTargetStats(appPackageName, driverVersionCode,
                           static_cast<GraphicsEnv::Stats>(stats), value);


            return OK;
            return OK;
        }
        }
+5 −1
Original line number Original line Diff line number Diff line
@@ -43,6 +43,10 @@ public:
        ANGLE = 5,
        ANGLE = 5,
    };
    };


    enum Stats {
        CPU_VULKAN_IN_USE = 0,
    };

private:
private:
    struct GpuStats {
    struct GpuStats {
        std::string driverPackageName;
        std::string driverPackageName;
@@ -96,7 +100,7 @@ public:
    void setGpuStats(const std::string& driverPackageName, const std::string& driverVersionName,
    void setGpuStats(const std::string& driverPackageName, const std::string& driverVersionName,
                     uint64_t versionCode, int64_t driverBuildTime,
                     uint64_t versionCode, int64_t driverBuildTime,
                     const std::string& appPackageName, const int32_t vulkanVersion);
                     const std::string& appPackageName, const int32_t vulkanVersion);
    void setCpuVulkanInUse();
    void setTargetStats(const Stats stats, const uint64_t value = 0);
    void setDriverToLoad(Driver driver);
    void setDriverToLoad(Driver driver);
    void setDriverLoaded(Api api, bool isDriverLoaded, int64_t driverLoadingTime);
    void setDriverLoaded(Api api, bool isDriverLoaded, int64_t driverLoadingTime);
    void sendGpuStatsLocked(Api api, bool isDriverLoaded, int64_t driverLoadingTime);
    void sendGpuStatsLocked(Api api, bool isDriverLoaded, int64_t driverLoadingTime);
Loading