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

Commit 1f496322 authored by Wei Wang's avatar Wei Wang Committed by Automerger Merge Worker
Browse files

Merge "SurfaceFlinger: add custom taskprofiles for SF threads" into sc-dev am:...

Merge "SurfaceFlinger: add custom taskprofiles for SF threads" into sc-dev am: fa14db8a am: 062e7cbc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14950181

Change-Id: I9e6ea3a0389403d3b41b081510eb7b016d6fac9a
parents 79cf5e21 062e7cbc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include <android-base/stringprintf.h>
#include <private/gui/SyncFeatures.h>
#include <processgroup/processgroup.h>
#include <utils/Trace.h>

#include "gl/GLESRenderEngine.h"
@@ -80,6 +81,10 @@ status_t RenderEngineThreaded::setSchedFifo(bool enabled) {
void RenderEngineThreaded::threadMain(CreateInstanceFactory factory) NO_THREAD_SAFETY_ANALYSIS {
    ATRACE_CALL();

    if (!SetTaskProfiles(0, {"SFRenderEnginePolicy"})) {
        ALOGW("Failed to set render-engine task profile!");
    }

    if (setSchedFifo(true) != NO_ERROR) {
        ALOGW("Couldn't set SCHED_FIFO");
    }
+7 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@
#include <log/log.h>
#include <private/android_filesystem_config.h>
#include <private/gui/SyncFeatures.h>
#include <processgroup/processgroup.h>
#include <renderengine/RenderEngine.h>
#include <sys/types.h>
#include <ui/ColorSpace.h>
@@ -785,6 +786,12 @@ void SurfaceFlinger::init() {
                                    ? renderengine::RenderEngine::ContextPriority::REALTIME
                                    : renderengine::RenderEngine::ContextPriority::MEDIUM)
                    .build()));

    // Set SF main policy after initializing RenderEngine which has its own policy.
    if (!SetTaskProfiles(0, {"SFMainPolicy"})) {
        ALOGW("Failed to set main task profile");
    }

    mCompositionEngine->setTimeStats(mTimeStats);
    mCompositionEngine->setHwComposer(getFactory().createHWComposer(mHwcServiceName));
    mCompositionEngine->getHwComposer().setCallback(this);