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

Commit 55ba267c authored by Jason Sams's avatar Jason Sams Committed by Android (Google) Code Review
Browse files

Merge "Add prop to force cap compute threading."

parents 2833eaf0 27914294
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line 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);
    int cpu = sysconf(_SC_NPROCESSORS_ONLN);
    ALOGV("%p Launching thread(s), CPUs %i", rsc, cpu);
    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.mCount = (uint32_t)cpu;
    dc->mWorkers.mThreadId = (pthread_t *) calloc(dc->mWorkers.mCount, sizeof(pthread_t));
    dc->mWorkers.mThreadId = (pthread_t *) calloc(dc->mWorkers.mCount, sizeof(pthread_t));
+10 −9
Original line number Original line Diff line number Diff line
@@ -178,10 +178,10 @@ void Context::setupProgramStore() {
    mFragmentStore->setup(this, &mStateFragmentStore);
    mFragmentStore->setup(this, &mStateFragmentStore);
}
}


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


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


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


    mutable struct {
    mutable struct {