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

Commit 27914294 authored by Jason Sams's avatar Jason Sams
Browse files

Add prop to force cap compute threading.

bug=6124869

Change-Id: Ibf2cc388f3906cea2741382ff5e522e3b416393c
parent d1c8c129
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -228,7 +228,12 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) {

    int cpu = sysconf(_SC_NPROCESSORS_ONLN);
    ALOGV("%p Launching thread(s), CPUs %i", rsc, cpu);
    if (cpu < 2) cpu = 0;
    if(rsc->props.mDebugMaxThreads && (cpu > (int)rsc->props.mDebugMaxThreads)) {
        cpu = rsc->props.mDebugMaxThreads;
    }
    if (cpu < 2) {
        cpu = 0;
    }

    dc->mWorkers.mCount = (uint32_t)cpu;
    dc->mWorkers.mThreadId = (pthread_t *) calloc(dc->mWorkers.mCount, sizeof(pthread_t));
+10 −9
Original line number Diff line number Diff line
@@ -178,10 +178,10 @@ void Context::setupProgramStore() {
    mFragmentStore->setup(this, &mStateFragmentStore);
}

static bool getProp(const char *str) {
static uint32_t getProp(const char *str) {
    char buf[PROPERTY_VALUE_MAX];
    property_get(str, buf, "0");
    return 0 != strcmp(buf, "0");
    return atoi(buf);
}

void Context::displayDebugStats() {
@@ -211,13 +211,14 @@ void * Context::threadProc(void *vrsc) {
    setpriority(PRIO_PROCESS, rsc->mNativeThreadId, ANDROID_PRIORITY_DISPLAY);
    rsc->mThreadPriority = ANDROID_PRIORITY_DISPLAY;
#endif //ANDROID_RS_SERIALIZE
    rsc->props.mLogTimes = getProp("debug.rs.profile");
    rsc->props.mLogScripts = getProp("debug.rs.script");
    rsc->props.mLogObjects = getProp("debug.rs.object");
    rsc->props.mLogShaders = getProp("debug.rs.shader");
    rsc->props.mLogShadersAttr = getProp("debug.rs.shader.attributes");
    rsc->props.mLogShadersUniforms = getProp("debug.rs.shader.uniforms");
    rsc->props.mLogVisual = getProp("debug.rs.visual");
    rsc->props.mLogTimes = getProp("debug.rs.profile") != 0;
    rsc->props.mLogScripts = getProp("debug.rs.script") != 0;
    rsc->props.mLogObjects = getProp("debug.rs.object") != 0;
    rsc->props.mLogShaders = getProp("debug.rs.shader") != 0;
    rsc->props.mLogShadersAttr = getProp("debug.rs.shader.attributes") != 0;
    rsc->props.mLogShadersUniforms = getProp("debug.rs.shader.uniforms") != 0;
    rsc->props.mLogVisual = getProp("debug.rs.visual") != 0;
    rsc->props.mDebugMaxThreads = getProp("debug.rs.max-threads");

    if (!rsdHalInit(rsc, 0, 0)) {
        rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed initializing GL");
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ public:
        bool mLogShadersAttr;
        bool mLogShadersUniforms;
        bool mLogVisual;
        uint32_t mDebugMaxThreads;
    } props;

    mutable struct {