Game Driver: plumb driver choice and loading time to GpuStats
This change plumb the below info from GL and Vulkan loader:
1. Intended driver to use
2. Whether intended driver is loaded
3. Total driver loading time
Bug: 123529932
Test: Build, flash and boot. Verify the GpuService receiver side.
Change-Id: I967d4361bf0e04c02390c7555617575c19ecadd4
diff --git a/libs/graphicsenv/IGpuService.cpp b/libs/graphicsenv/IGpuService.cpp
index 762a27b..2a57caf 100644
--- a/libs/graphicsenv/IGpuService.cpp
+++ b/libs/graphicsenv/IGpuService.cpp
@@ -28,8 +28,9 @@
explicit BpGpuService(const sp<IBinder>& impl) : BpInterface<IGpuService>(impl) {}
virtual void setGpuStats(const std::string& driverPackageName,
- const std::string& driverVersionName, const uint64_t driverVersionCode,
- const std::string& appPackageName) {
+ const std::string& driverVersionName, uint64_t driverVersionCode,
+ const std::string& appPackageName, GraphicsEnv::Driver driver,
+ bool isDriverLoaded, int64_t driverLoadingTime) {
Parcel data, reply;
data.writeInterfaceToken(IGpuService::getInterfaceDescriptor());
@@ -37,6 +38,9 @@
data.writeUtf8AsUtf16(driverVersionName);
data.writeUint64(driverVersionCode);
data.writeUtf8AsUtf16(appPackageName);
+ data.writeInt32(static_cast<int32_t>(driver));
+ data.writeBool(isDriverLoaded);
+ data.writeInt64(driverLoadingTime);
remote()->transact(BnGpuService::SET_GPU_STATS, data, &reply);
}
@@ -65,7 +69,18 @@
std::string appPackageName;
if ((status = data.readUtf8FromUtf16(&appPackageName)) != OK) return status;
- setGpuStats(driverPackageName, driverVersionName, driverVersionCode, appPackageName);
+ int32_t driver;
+ if ((status = data.readInt32(&driver)) != OK) return status;
+
+ bool isDriverLoaded;
+ if ((status = data.readBool(&isDriverLoaded)) != OK) return status;
+
+ int64_t driverLoadingTime;
+ if ((status = data.readInt64(&driverLoadingTime)) != OK) return status;
+
+ setGpuStats(driverPackageName, driverVersionName, driverVersionCode, appPackageName,
+ static_cast<GraphicsEnv::Driver>(driver), isDriverLoaded,
+ driverLoadingTime);
return OK;
}