From d986181df8ff886301adaf20404f886c730ba2c7 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 13 Feb 2019 11:51:55 -0800 Subject: 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 --- libs/graphicsenv/IGpuService.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'libs/graphicsenv/IGpuService.cpp') diff --git a/libs/graphicsenv/IGpuService.cpp b/libs/graphicsenv/IGpuService.cpp index 762a27b799..2a57caf739 100644 --- a/libs/graphicsenv/IGpuService.cpp +++ b/libs/graphicsenv/IGpuService.cpp @@ -28,8 +28,9 @@ public: explicit BpGpuService(const sp& impl) : BpInterface(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 @@ public: data.writeUtf8AsUtf16(driverVersionName); data.writeUint64(driverVersionCode); data.writeUtf8AsUtf16(appPackageName); + data.writeInt32(static_cast(driver)); + data.writeBool(isDriverLoaded); + data.writeInt64(driverLoadingTime); remote()->transact(BnGpuService::SET_GPU_STATS, data, &reply); } @@ -65,7 +69,18 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep 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(driver), isDriverLoaded, + driverLoadingTime); return OK; } -- cgit v1.2.3-59-g8ed1b