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

Commit ae211b44 authored by Wei Wang's avatar Wei Wang
Browse files

Surfacefinger: Set HWC Callback to SCHED_FIFO

IComposerCallback is on critical path to correct vsync, this CL makes
the callback runs in SCHED_FIFO to minimize scheduling latency.

Bug: 133241520
Test: Build
Change-Id: Ifda73c4b33771763c2b58b25d32b805ed602369a
parent 6059fa3e
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@


#include <composer-command-buffer/2.2/ComposerCommandBuffer.h>
#include <composer-command-buffer/2.2/ComposerCommandBuffer.h>
#include <gui/BufferQueue.h>
#include <gui/BufferQueue.h>
#include <hidl/HidlTransportSupport.h>
#include <hidl/HidlTransportUtils.h>
#include <hidl/HidlTransportUtils.h>


namespace android {
namespace android {
@@ -229,6 +230,7 @@ std::string Composer::dumpDebugInfo()


void Composer::registerCallback(const sp<IComposerCallback>& callback)
void Composer::registerCallback(const sp<IComposerCallback>& callback)
{
{
    android::hardware::setMinSchedulerPolicy(callback, SCHED_FIFO, 2);
    auto ret = mClient->registerCallback(callback);
    auto ret = mClient->registerCallback(callback);
    if (!ret.isOk()) {
    if (!ret.isOk()) {
        ALOGE("failed to register IComposerCallback");
        ALOGE("failed to register IComposerCallback");