sm6375-common: power-libperfmgr: ADPF: fix abnormal high uclamp

"GPU completion" task inherits a high uclamp value from RenderThread.
But it's not in the ADPF thread list, so it remains a high uclamp value.
Use SetTaskProfiles("ResetUclampGrp") and
SetTaskProfiles("NoResetUclampGrp") to manage the uclamp_fork_reset for
tasks.

Bug: 191973176
Bug: 192149875
Test: vendor/google_testing/pts/tests/common/utils/perf/run_pts/jank_test.sh
Test: adb shell cat /proc/vendor_sched/dump_task
Change-Id: I6aed171e88c0a6db5f762e7c791344bb3f4b7a90
This commit is contained in:
Jimmy Shiu 2024-07-18 12:56:42 +05:30 committed by Anand S
commit 09fff35998
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61
5 changed files with 90 additions and 40 deletions

View file

@ -41,13 +41,14 @@ using std::chrono::nanoseconds;
using std::chrono::steady_clock;
using std::chrono::time_point;
static const int32_t kMaxUclampValue = 1024;
struct AppHintDesc {
AppHintDesc(int32_t tgid, int32_t uid, std::vector<int> threadIds, int uclamp_min)
AppHintDesc(int32_t tgid, int32_t uid, std::vector<int> threadIds)
: tgid(tgid),
uid(uid),
threadIds(std::move(threadIds)),
duration(0LL),
current_min(uclamp_min),
current_min(0),
is_active(true),
update_count(0),
integral_error(0),
@ -79,6 +80,7 @@ class PowerHintSession : public BnPowerHintSession {
const std::vector<WorkDuration> &actualDurations) override;
bool isActive();
bool isStale();
const std::vector<int> &getTidList() const;
private:
class StaleHandler : public MessageHandler {
@ -99,7 +101,7 @@ class PowerHintSession : public BnPowerHintSession {
private:
void setStale();
void updateUniveralBoostMode();
int setUclamp(int32_t max, int32_t min);
int setUclamp(int32_t min, int32_t max = kMaxUclampValue);
std::string getIdString() const;
AppHintDesc *mDescriptor = nullptr;
sp<StaleHandler> mStaleHandler;