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

Commit b5260907 authored by Solti's avatar Solti
Browse files

include system ANGLE usage as ANGLE usage

This CL set the system ANGLE usage as GpuStatsInfo::Driver::ANGLE.
Previously it was categorized as GpuStatsInfo::Driver::GL.
The reason is ANGLE will be shipped as a system driver, not as APK.  We
want to monitor the adoption of system ANGLE driver.

Test: collect the GPU stats before and after the CL.  Check the GPU
stats reflects ANGLE traffic.  See details in b/294867368#comment17

Bug: b/294867368
Change-Id: I5fcc6a9b86f186ec5058cd3b2ddc262b4ef1b352
parent ecc2be94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ public:
        GL_UPDATED = 2,
        VULKAN = 3,
        VULKAN_UPDATED = 4,
        ANGLE = 5,
        ANGLE = 5, // cover both system ANGLE and ANGLE APK
    };

    enum Stats {
+8 −1
Original line number Diff line number Diff line
@@ -567,6 +567,7 @@ Loader::driver_t* Loader::attempt_to_load_angle(egl_connection_t* cnx) {
        return nullptr;
    }

    // use ANGLE APK driver
    android::GraphicsEnv::getInstance().setDriverToLoad(android::GpuStatsInfo::Driver::ANGLE);
    driver_t* hnd = nullptr;

@@ -635,7 +636,13 @@ Loader::driver_t* Loader::attempt_to_load_updated_driver(egl_connection_t* cnx)
Loader::driver_t* Loader::attempt_to_load_system_driver(egl_connection_t* cnx, const char* suffix,
                                                        const bool exact) {
    ATRACE_CALL();
    if (strcmp(suffix, "angle") == 0) {
        // use system ANGLE driver
        android::GraphicsEnv::getInstance().setDriverToLoad(android::GpuStatsInfo::Driver::ANGLE);
    } else {
        android::GraphicsEnv::getInstance().setDriverToLoad(android::GpuStatsInfo::Driver::GL);
    }

    driver_t* hnd = nullptr;
    void* dso = load_system_driver("GLES", suffix, exact);
    if (dso) {
+2 −2
Original line number Diff line number Diff line
@@ -163,11 +163,11 @@ void GpuStats::insertDriverStats(const std::string& driverPackageName,
        addLoadingTime(driver, driverLoadingTime, &appInfo);
        appInfo.appPackageName = appPackageName;
        appInfo.driverVersionCode = driverVersionCode;
        appInfo.angleInUse = driverPackageName == "angle";
        appInfo.angleInUse = driver == GpuStatsInfo::Driver::ANGLE;
        appInfo.lastAccessTime = std::chrono::system_clock::now();
        mAppStats.insert({appStatsKey, appInfo});
    } else {
        mAppStats[appStatsKey].angleInUse = driverPackageName == "angle";
        mAppStats[appStatsKey].angleInUse = driver == GpuStatsInfo::Driver::ANGLE;
        addLoadingTime(driver, driverLoadingTime, &mAppStats[appStatsKey]);
        mAppStats[appStatsKey].lastAccessTime = std::chrono::system_clock::now();
    }