Loading libs/graphicsenv/GraphicsEnv.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -746,6 +746,18 @@ void GraphicsEnv::nativeToggleAngleAsSystemDriver(bool enabled) { gpuService->toggleAngleAsSystemDriver(enabled); } std::string GraphicsEnv::nativeGetPersistGraphicsEgl() { if (!graphicsenv_flags::query_persist_graphics_egl()) { return ""; } const sp<IGpuService> gpuService = getGpuService(); if (!gpuService) { ALOGE("No GPU service"); return ""; } return gpuService->getPersistGraphicsEgl(); } bool GraphicsEnv::shouldUseSystemAngle() { return mShouldUseSystemAngle; } Loading libs/graphicsenv/IGpuService.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,18 @@ public: IBinder::FLAG_ONEWAY); } std::string getPersistGraphicsEgl() override { Parcel data, reply; data.writeInterfaceToken(IGpuService::getInterfaceDescriptor()); status_t error = remote()->transact(BnGpuService::GET_PERSIST_GRAPHICS_EGL, data, &reply); std::string persistGraphicsEgl; if (error == OK) { error = reply.readUtf8FromUtf16(&persistGraphicsEgl); } return persistGraphicsEgl; } std::string getUpdatableDriverPath() override { Parcel data, reply; data.writeInterfaceToken(IGpuService::getInterfaceDescriptor()); Loading Loading @@ -286,6 +298,12 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep toggleAngleAsSystemDriver(enableAngleAsSystemDriver); return OK; } case GET_PERSIST_GRAPHICS_EGL: { CHECK_INTERFACE(IGpuService, data, reply); std::string persistGraphicsEgl = getPersistGraphicsEgl(); return reply->writeUtf8AsUtf16(persistGraphicsEgl); } case GET_FEATURE_CONFIG_OVERRIDES: { CHECK_INTERFACE(IGpuService, data, reply); Loading libs/graphicsenv/graphicsenv_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,10 @@ flag { description: "This flag controls the ANGLE Feature Overrides in GraphicsEnv." bug: "372694741" } flag { name: "query_persist_graphics_egl" namespace: "gpu" description: "This flag controls the ability to query persist.graphics.egl through GpuService" bug: "408439360" } libs/graphicsenv/include/graphicsenv/GraphicsEnv.h +2 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,8 @@ public: std::vector<const char*>& disabled); // Set the persist.graphics.egl system property value. void nativeToggleAngleAsSystemDriver(bool enabled); // Get the persist.graphics.egl system property value. std::string nativeGetPersistGraphicsEgl(); bool shouldUseSystemAngle(); bool shouldUseNativeDriver(); Loading libs/graphicsenv/include/graphicsenv/IGpuService.h +4 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,9 @@ public: // sets ANGLE as system GLES driver if enabled==true by setting persist.graphics.egl to true. virtual void toggleAngleAsSystemDriver(bool enabled) = 0; // gets persist.graphics.egl value virtual std::string getPersistGraphicsEgl() = 0; // Get the list of features to override. virtual FeatureOverrides getFeatureOverrides() = 0; }; Loading @@ -72,6 +75,7 @@ public: SET_TARGET_STATS_ARRAY, ADD_VULKAN_ENGINE_NAME, GET_FEATURE_CONFIG_OVERRIDES, GET_PERSIST_GRAPHICS_EGL, // Always append new enum to the end. }; Loading Loading
libs/graphicsenv/GraphicsEnv.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -746,6 +746,18 @@ void GraphicsEnv::nativeToggleAngleAsSystemDriver(bool enabled) { gpuService->toggleAngleAsSystemDriver(enabled); } std::string GraphicsEnv::nativeGetPersistGraphicsEgl() { if (!graphicsenv_flags::query_persist_graphics_egl()) { return ""; } const sp<IGpuService> gpuService = getGpuService(); if (!gpuService) { ALOGE("No GPU service"); return ""; } return gpuService->getPersistGraphicsEgl(); } bool GraphicsEnv::shouldUseSystemAngle() { return mShouldUseSystemAngle; } Loading
libs/graphicsenv/IGpuService.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,18 @@ public: IBinder::FLAG_ONEWAY); } std::string getPersistGraphicsEgl() override { Parcel data, reply; data.writeInterfaceToken(IGpuService::getInterfaceDescriptor()); status_t error = remote()->transact(BnGpuService::GET_PERSIST_GRAPHICS_EGL, data, &reply); std::string persistGraphicsEgl; if (error == OK) { error = reply.readUtf8FromUtf16(&persistGraphicsEgl); } return persistGraphicsEgl; } std::string getUpdatableDriverPath() override { Parcel data, reply; data.writeInterfaceToken(IGpuService::getInterfaceDescriptor()); Loading Loading @@ -286,6 +298,12 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep toggleAngleAsSystemDriver(enableAngleAsSystemDriver); return OK; } case GET_PERSIST_GRAPHICS_EGL: { CHECK_INTERFACE(IGpuService, data, reply); std::string persistGraphicsEgl = getPersistGraphicsEgl(); return reply->writeUtf8AsUtf16(persistGraphicsEgl); } case GET_FEATURE_CONFIG_OVERRIDES: { CHECK_INTERFACE(IGpuService, data, reply); Loading
libs/graphicsenv/graphicsenv_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,10 @@ flag { description: "This flag controls the ANGLE Feature Overrides in GraphicsEnv." bug: "372694741" } flag { name: "query_persist_graphics_egl" namespace: "gpu" description: "This flag controls the ability to query persist.graphics.egl through GpuService" bug: "408439360" }
libs/graphicsenv/include/graphicsenv/GraphicsEnv.h +2 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,8 @@ public: std::vector<const char*>& disabled); // Set the persist.graphics.egl system property value. void nativeToggleAngleAsSystemDriver(bool enabled); // Get the persist.graphics.egl system property value. std::string nativeGetPersistGraphicsEgl(); bool shouldUseSystemAngle(); bool shouldUseNativeDriver(); Loading
libs/graphicsenv/include/graphicsenv/IGpuService.h +4 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,9 @@ public: // sets ANGLE as system GLES driver if enabled==true by setting persist.graphics.egl to true. virtual void toggleAngleAsSystemDriver(bool enabled) = 0; // gets persist.graphics.egl value virtual std::string getPersistGraphicsEgl() = 0; // Get the list of features to override. virtual FeatureOverrides getFeatureOverrides() = 0; }; Loading @@ -72,6 +75,7 @@ public: SET_TARGET_STATS_ARRAY, ADD_VULKAN_ENGINE_NAME, GET_FEATURE_CONFIG_OVERRIDES, GET_PERSIST_GRAPHICS_EGL, // Always append new enum to the end. }; Loading