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

Commit f269a1de authored by Matt Buckley's avatar Matt Buckley Committed by Android (Google) Code Review
Browse files

Merge "Add HWUI session tagging" into main

parents cce96562 a518f329
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#define ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H

#include <stdint.h>
#include <android/performance_hint.h>

__BEGIN_DECLS

@@ -75,6 +76,15 @@ enum SessionHint: int32_t {
    GPU_LOAD_RESET = 7,
};

// Allows access to PowerHAL's SessionTags without needing to import its AIDL
enum class SessionTag : int32_t {
  OTHER = 0,
  SURFACEFLINGER = 1,
  HWUI = 2,
  GAME = 3,
  APP = 4,
};

/**
 * Sends performance hints to inform the hint session of changes in the workload.
 *
@@ -83,14 +93,22 @@ enum SessionHint: int32_t {
 * @return 0 on success
 *         EPIPE if communication with the system service has failed.
 */
int APerformanceHint_sendHint(void* session, SessionHint hint);
int APerformanceHint_sendHint(APerformanceHintSession* session, SessionHint hint);

/**
 * Return the list of thread ids, this API should only be used for testing only.
 */
int APerformanceHint_getThreadIds(void* aPerformanceHintSession,
int APerformanceHint_getThreadIds(APerformanceHintSession* session,
                                  int32_t* const threadIds, size_t* const size);

/**
 * Creates a session with additional options
 */
APerformanceHintSession* APerformanceHint_createSessionInternal(APerformanceHintManager* manager,
                                        const int32_t* threadIds, size_t size,
                                        int64_t initialTargetWorkDurationNanos, SessionTag tag);


__END_DECLS

#endif // ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H