diff options
author | Glenn Kasten <gkasten@google.com> | 2013-07-15 14:45:07 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-07-19 09:30:37 -0700 |
commit | 4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61 (patch) | |
tree | c7ed5d9b71f919bf664dd0cb6cbdd1c3de2f9241 /services/audioflinger/FastMixer.h | |
parent | 0d61251648b5110bfc33ef5b3d19bbf65db0a7b5 (diff) | |
download | frameworks_av-4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61.zip frameworks_av-4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61.tar.gz frameworks_av-4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61.tar.bz2 |
Use AudioSystem::setLowRamDevice() to configure memory
Bug: 9798886
Change-Id: I9321e3f369f1ed9429ae222e3926ebdeb012b8b0
Diffstat (limited to 'services/audioflinger/FastMixer.h')
-rw-r--r-- | services/audioflinger/FastMixer.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/services/audioflinger/FastMixer.h b/services/audioflinger/FastMixer.h index 2ab1d04..6158925 100644 --- a/services/audioflinger/FastMixer.h +++ b/services/audioflinger/FastMixer.h @@ -85,10 +85,14 @@ struct FastTrackDump { // Only POD types are permitted, and the contents shouldn't be trusted (i.e. do range checks). // It has a different lifetime than the FastMixer, and so it can't be a member of FastMixer. struct FastMixerDumpState { - FastMixerDumpState(); + FastMixerDumpState( +#ifdef FAST_MIXER_STATISTICS + uint32_t samplingN = kSamplingNforLowRamDevice +#endif + ); /*virtual*/ ~FastMixerDumpState(); - void dump(int fd); // should only be called on a stable copy, not the original + void dump(int fd) const; // should only be called on a stable copy, not the original FastMixerState::Command mCommand; // current command uint32_t mWriteSequence; // incremented before and after each write() @@ -106,8 +110,15 @@ struct FastMixerDumpState { #ifdef FAST_MIXER_STATISTICS // Recently collected samples of per-cycle monotonic time, thread CPU time, and CPU frequency. - // kSamplingN is the size of the sampling frame, and must be a power of 2 <= 0x8000. + // kSamplingN is max size of sampling frame (statistics), and must be a power of 2 <= 0x8000. + // The sample arrays are virtually allocated based on this compile-time constant, + // but are only initialized and used based on the runtime parameter mSamplingN. static const uint32_t kSamplingN = 0x8000; + // Compile-time constant for a "low RAM device", must be a power of 2 <= kSamplingN. + // This value was chosen such that each array uses 1 small page (4 Kbytes). + static const uint32_t kSamplingNforLowRamDevice = 0x400; + // Corresponding runtime maximum size of sample arrays, must be a power of 2 <= kSamplingN. + uint32_t mSamplingN; // The bounds define the interval of valid samples, and are represented as follows: // newest open (excluded) endpoint = lower 16 bits of bounds, modulo N // oldest closed (included) endpoint = upper 16 bits of bounds, modulo N @@ -119,6 +130,8 @@ struct FastMixerDumpState { #ifdef CPU_FREQUENCY_STATISTICS uint32_t mCpukHz[kSamplingN]; // absolute CPU clock frequency in kHz, bits 0-3 are CPU# #endif + // Increase sampling window after construction, must be a power of 2 <= kSamplingN + void increaseSamplingN(uint32_t samplingN); #endif }; |