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

Commit 0864e4f9 authored by Shadman Shadid's avatar Shadman Shadid Committed by Android (Google) Code Review
Browse files

Merge "Fix render thread priority for allocateBuffers" into main

parents 5f72385f 25345d82
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -937,15 +937,22 @@ public:
          : Surface(igbp, controlledByApp, scHandle), mBbq(bbq) {}

    void allocateBuffers() override {
        ATRACE_CALL();
        uint32_t reqWidth = mReqWidth ? mReqWidth : mUserWidth;
        uint32_t reqHeight = mReqHeight ? mReqHeight : mUserHeight;
        auto gbp = getIGraphicBufferProducer();
        std::thread ([reqWidth, reqHeight, gbp=getIGraphicBufferProducer(),
        std::thread allocateThread([reqWidth, reqHeight, gbp = getIGraphicBufferProducer(),
                                    reqFormat = mReqFormat, reqUsage = mReqUsage]() {
            if (com_android_graphics_libgui_flags_allocate_buffer_priority()) {
                androidSetThreadName("allocateBuffers");
                pid_t tid = gettid();
                androidSetThreadPriority(tid, ANDROID_PRIORITY_DISPLAY);
            }

            gbp->allocateBuffers(reqWidth, reqHeight,
                                 reqFormat, reqUsage);

        }).detach();
        });
        allocateThread.detach();
    }

    status_t setFrameRate(float frameRate, int8_t compatibility,
+11 −0
Original line number Diff line number Diff line
@@ -142,3 +142,14 @@ flag {
  bug: "340934031"
  is_fixed_read_only: true
} # wb_media_migration

flag {
  name: "allocate_buffer_priority"
  namespace: "wear_system_health"
  description: "Boost priority for buffer allocation"
  bug: "399701430"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
  is_fixed_read_only: true
} # allocate_buffer_priority