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

Commit 1af4e87b authored by Tim Van Patten's avatar Tim Van Patten
Browse files

GpuService: Add cmdFeatureOverrides

Add 'cmd gpu featureOverrides' to output the current FeatureOverrides
that were parsed by FeatureOverrideParser.

The feature overrides are intended to be used by
getPlatformDisplayAngle() in a later CL, to modify the behavior of
ANGLE.

Bug: 372694741
Test: cmd gpu featureOverrides
Flag: com.android.graphics.graphicsenv.flags.feature_overrides
Change-Id: I04c142fc6e0fd920315e41b36954c45cf032afb3
parent 96efbfe8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ cc_aconfig_library {
cc_defaults {
    name: "libgpuservice_defaults",
    defaults: [
        "aconfig_lib_cc_static_link.defaults",
        "gpuservice_defaults",
        "libfeatureoverride_deps",
        "libgfxstats_deps",
+17 −2
Original line number Diff line number Diff line
@@ -25,8 +25,10 @@
#include <binder/Parcel.h>
#include <binder/PermissionCache.h>
#include <com_android_frameworks_gpuservice_flags.h>
#include <com_android_graphics_graphicsenv_flags.h>
#include <cutils/properties.h>
#include <cutils/multiuser.h>
#include <feature_override/FeatureOverrideParser.h>
#include <gpumem/GpuMem.h>
#include <gpuwork/GpuWork.h>
#include <gpustats/GpuStats.h>
@@ -41,6 +43,7 @@
#include <memory>

namespace gpuservice_flags = com::android::frameworks::gpuservice::flags;
namespace graphicsenv_flags = com::android::graphics::graphicsenv::flags;

namespace android {

@@ -143,7 +146,6 @@ void GpuService::toggleAngleAsSystemDriver(bool enabled) {
    }
}


void GpuService::setUpdatableDriverPath(const std::string& driverPath) {
    IPCThreadState* ipc = IPCThreadState::self();
    const int pid = ipc->getCallingPid();
@@ -171,7 +173,11 @@ status_t GpuService::shellCommand(int /*in*/, int out, int err, std::vector<Stri
    for (size_t i = 0, n = args.size(); i < n; i++)
        ALOGV("  arg[%zu]: '%s'", i, String8(args[i]).c_str());

    if (args.size() >= 1) {
    if (!args.empty()) {
        if (graphicsenv_flags::feature_overrides()) {
            if (args[0] == String16("featureOverrides"))
                return cmdFeatureOverrides(out, err);
        }
        if (args[0] == String16("vkjson")) return cmdVkjson(out, err);
        if (args[0] == String16("vkprofiles")) return cmdVkprofiles(out, err);
        if (args[0] == String16("help")) return cmdHelp(out);
@@ -235,6 +241,11 @@ status_t GpuService::doDump(int fd, const Vector<String16>& args, bool /*asProto
    return NO_ERROR;
}

status_t GpuService::cmdFeatureOverrides(int out, int /*err*/) {
    dprintf(out, "%s\n", mFeatureOverrideParser.getFeatureOverrides().toString().c_str());
    return NO_ERROR;
}

namespace {

status_t cmdHelp(int out) {
@@ -247,6 +258,10 @@ status_t cmdHelp(int out) {
            "GPU Service commands:\n"
            "  vkjson      dump Vulkan properties as JSON\n"
            "  vkprofiles  print support for select Vulkan profiles\n");
    if (graphicsenv_flags::feature_overrides()) {
        fprintf(outs,
                "  featureOverrides  update and output gpuservice's feature overrides\n");
    }
    fclose(outs);
    return NO_ERROR;
}
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ private:

    status_t doDump(int fd, const Vector<String16>& args, bool asProto);

    status_t cmdFeatureOverrides(int out, int /*err*/);

    /*
     * Attributes
     */