summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yiwei Zhang <zzyiwei@google.com> 2019-12-20 14:37:21 -0800
committer Yiwei Zhang <zzyiwei@google.com> 2019-12-20 14:45:35 -0800
commit011538f1ed7d102dc1e96911466805cdea63eecd (patch)
treede02fa6b157c158417ad628257387c7a62915b24
parent80be60e1adc451b3e37a115cf690401eee54229e (diff)
GpuStats: track whether the app creates ES1 context
Bug: 146661131 Test: adb shell dumpsys gpu Change-Id: I54e6953368ea8e2ced7477ee64796580dc14c39e
-rw-r--r--libs/graphicsenv/GpuStatsInfo.cpp3
-rw-r--r--libs/graphicsenv/include/graphicsenv/GpuStatsInfo.h2
-rw-r--r--opengl/libs/EGL/egl_platform_entries.cpp2
-rw-r--r--services/gpuservice/gpustats/GpuStats.cpp3
4 files changed, 10 insertions, 0 deletions
diff --git a/libs/graphicsenv/GpuStatsInfo.cpp b/libs/graphicsenv/GpuStatsInfo.cpp
index 85137f5ca9..f2d0943e86 100644
--- a/libs/graphicsenv/GpuStatsInfo.cpp
+++ b/libs/graphicsenv/GpuStatsInfo.cpp
@@ -87,6 +87,7 @@ status_t GpuStatsAppInfo::writeToParcel(Parcel* parcel) const {
if ((status = parcel->writeInt64Vector(angleDriverLoadingTime)) != OK) return status;
if ((status = parcel->writeBool(cpuVulkanInUse)) != OK) return status;
if ((status = parcel->writeBool(falsePrerotation)) != OK) return status;
+ if ((status = parcel->writeBool(gles1InUse)) != OK) return status;
return OK;
}
@@ -99,6 +100,7 @@ status_t GpuStatsAppInfo::readFromParcel(const Parcel* parcel) {
if ((status = parcel->readInt64Vector(&angleDriverLoadingTime)) != OK) return status;
if ((status = parcel->readBool(&cpuVulkanInUse)) != OK) return status;
if ((status = parcel->readBool(&falsePrerotation)) != OK) return status;
+ if ((status = parcel->readBool(&gles1InUse)) != OK) return status;
return OK;
}
@@ -108,6 +110,7 @@ std::string GpuStatsAppInfo::toString() const {
StringAppendF(&result, "driverVersionCode = %" PRIu64 "\n", driverVersionCode);
StringAppendF(&result, "cpuVulkanInUse = %d\n", cpuVulkanInUse);
StringAppendF(&result, "falsePrerotation = %d\n", falsePrerotation);
+ StringAppendF(&result, "gles1InUse = %d\n", gles1InUse);
result.append("glDriverLoadingTime:");
for (int32_t loadingTime : glDriverLoadingTime) {
StringAppendF(&result, " %d", loadingTime);
diff --git a/libs/graphicsenv/include/graphicsenv/GpuStatsInfo.h b/libs/graphicsenv/include/graphicsenv/GpuStatsInfo.h
index 7959652189..9aba69fd07 100644
--- a/libs/graphicsenv/include/graphicsenv/GpuStatsInfo.h
+++ b/libs/graphicsenv/include/graphicsenv/GpuStatsInfo.h
@@ -71,6 +71,7 @@ public:
std::vector<int64_t> angleDriverLoadingTime = {};
bool cpuVulkanInUse = false;
bool falsePrerotation = false;
+ bool gles1InUse = false;
};
/*
@@ -95,6 +96,7 @@ public:
enum Stats {
CPU_VULKAN_IN_USE = 0,
FALSE_PREROTATION = 1,
+ GLES_1_IN_USE = 2,
};
GpuStatsInfo() = default;
diff --git a/opengl/libs/EGL/egl_platform_entries.cpp b/opengl/libs/EGL/egl_platform_entries.cpp
index 1fc7927e12..5162ba4abf 100644
--- a/opengl/libs/EGL/egl_platform_entries.cpp
+++ b/opengl/libs/EGL/egl_platform_entries.cpp
@@ -984,6 +984,8 @@ EGLContext eglCreateContextImpl(EGLDisplay dpy, EGLConfig config,
if (attr == EGL_CONTEXT_CLIENT_VERSION) {
if (value == 1) {
version = egl_connection_t::GLESv1_INDEX;
+ android::GraphicsEnv::getInstance().setTargetStats(
+ android::GpuStatsInfo::Stats::GLES_1_IN_USE);
} else if (value == 2 || value == 3) {
version = egl_connection_t::GLESv2_INDEX;
}
diff --git a/services/gpuservice/gpustats/GpuStats.cpp b/services/gpuservice/gpustats/GpuStats.cpp
index 67babd496f..7fff6edc38 100644
--- a/services/gpuservice/gpustats/GpuStats.cpp
+++ b/services/gpuservice/gpustats/GpuStats.cpp
@@ -145,6 +145,9 @@ void GpuStats::insertTargetStats(const std::string& appPackageName,
case GpuStatsInfo::Stats::FALSE_PREROTATION:
mAppStats[appStatsKey].falsePrerotation = true;
break;
+ case GpuStatsInfo::Stats::GLES_1_IN_USE:
+ mAppStats[appStatsKey].gles1InUse = true;
+ break;
default:
break;
}