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

Commit 900a550e authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "Add debug sysprops to disable sched fifo in surfaceflinger" into main

parents bdb3bc4f 4944c111
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <future>

#include <android-base/stringprintf.h>
#include <common/FlagManager.h>
#include <common/trace.h>
#include <private/gui/SyncFeatures.h>
#include <processgroup/processgroup.h>
@@ -60,7 +61,7 @@ status_t RenderEngineThreaded::setSchedFifo(bool enabled) {

    struct sched_param param = {0};
    int sched_policy;
    if (enabled) {
    if (enabled && !FlagManager::getInstance().disable_sched_fifo_re()) {
        sched_policy = SCHED_FIFO;
        param.sched_priority = kFifoPriority;
    } else {
+3 −1
Original line number Diff line number Diff line
@@ -357,7 +357,9 @@ void AidlComposer::registerCallback(HWC2::ComposerCallback& callback) {
    mAidlComposerCallback = ndk::SharedRefBase::make<AidlIComposerCallbackWrapper>(callback);

    ndk::SpAIBinder binder = mAidlComposerCallback->asBinder();
    if (!FlagManager::getInstance().disable_sched_fifo_composer_callback()) {
        AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_FIFO, 2);
    }

    const auto status = mAidlComposerClient->registerCallback(mAidlComposerCallback);
    if (!status.isOk()) {
+4 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <aidl/android/hardware/graphics/common/DisplayHotplugEvent.h>
#include <android/binder_manager.h>
#include <android/hardware/graphics/composer/2.1/types.h>
#include <common/FlagManager.h>
#include <common/trace.h>
#include <composer-command-buffer/2.2/ComposerCommandBuffer.h>
#include <hidl/HidlTransportSupport.h>
@@ -301,7 +302,9 @@ std::string HidlComposer::dumpDebugInfo() {
}

void HidlComposer::registerCallback(const sp<IComposerCallback>& callback) {
    if (!FlagManager::getInstance().disable_sched_fifo_composer_callback()) {
        android::hardware::setMinSchedulerPolicy(callback, SCHED_FIFO, 2);
    }

    auto ret = [&]() {
        if (mClient_2_4) {
+2 −1
Original line number Diff line number Diff line
@@ -344,7 +344,8 @@ sp<EventThreadConnection> EventThread::createEventConnection(
    auto connection = sp<EventThreadConnection>::make(const_cast<EventThread*>(this),
                                                      IPCThreadState::self()->getCallingUid(),
                                                      eventRegistration);
    if (FlagManager::getInstance().misc1()) {
    if (FlagManager::getInstance().misc1() &&
        !FlagManager::getInstance().disable_sched_fifo_sf_sched()) {
        const int policy = SCHED_FIFO;
        connection->setMinSchedulerPolicy(policy, sched_get_priority_min(policy));
    }
+5 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <sys/timerfd.h>
#include <sys/unistd.h>

#include <common/FlagManager.h>
#include <common/trace.h>
#include <ftl/concat.h>
#include <ftl/enum.h>
@@ -155,9 +156,11 @@ bool Timer::dispatch() {
    setDebugState(DebugState::Running);
    struct sched_param param = {0};
    param.sched_priority = 2;
    if (!FlagManager::getInstance().disable_sched_fifo_sf_sched()) {
        if (pthread_setschedparam(pthread_self(), SCHED_FIFO, &param) != 0) {
            ALOGW("Failed to set SCHED_FIFO on dispatch thread");
        }
    }

    if (pthread_setname_np(pthread_self(), "TimerDispatch") != 0) {
        ALOGW("Failed to set thread name on dispatch thread");
Loading