diff options
Diffstat (limited to 'libs/graphicsenv/GraphicsEnv.cpp')
-rw-r--r-- | libs/graphicsenv/GraphicsEnv.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp index 2f84f86431..407f77d88b 100644 --- a/libs/graphicsenv/GraphicsEnv.cpp +++ b/libs/graphicsenv/GraphicsEnv.cpp @@ -263,6 +263,17 @@ static sp<IGpuService> getGpuService() { return interface_cast<IGpuService>(binder); } +void GraphicsEnv::setCpuVulkanInUse() { + ATRACE_CALL(); + + // Use the same stats lock to protect getGpuService() as well. + std::lock_guard<std::mutex> lock(mStatsLock); + const sp<IGpuService> gpuService = getGpuService(); + if (gpuService) { + gpuService->setCpuVulkanInUse(mGpuStats.appPackageName, mGpuStats.driverVersionCode); + } +} + void GraphicsEnv::sendGpuStatsLocked(GraphicsEnv::Api api, bool isDriverLoaded, int64_t driverLoadingTime) { ATRACE_CALL(); |