Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0da6c8f5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add a new GpuService API to query persist.graphics.egl" into main

parents b0be6a6a d3e4c5ba
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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;
}
+18 −0
Original line number Diff line number Diff line
@@ -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());
@@ -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);

+7 −0
Original line number Diff line number Diff line
@@ -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"
}
+2 −0
Original line number Diff line number Diff line
@@ -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();

+4 −0
Original line number Diff line number Diff line
@@ -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;
};
@@ -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