From 88f6ad7bf1bd893aef3b9a2ce48a3be817b03973 Mon Sep 17 00:00:00 2001 From: Kevin DuBois Date: Thu, 13 Dec 2018 10:14:59 -0800 Subject: composer: add time filtering to display histogram Adds the ability to filter the content sample by timestamp and or a framecount. This lets API user limit the returned sample to data most proximate to the time that the user is interested in it. Fixes: 120992129 Test: boot Test: new unit test for ringbuffer logic. Test: color_sampling_tool Test: TestAPI app limiting by maxframes Test: VtsHalGraphicsComposerV2_3Target (32/36 as before) Change-Id: I8dd9efc9935570f0f1ab015476ffa8883651073e --- sdm/libs/hwc2/hwc_display_primary.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sdm/libs/hwc2/hwc_display_primary.cpp') diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp index 830549aa..360b5d87 100644 --- a/sdm/libs/hwc2/hwc_display_primary.cpp +++ b/sdm/libs/hwc2/hwc_display_primary.cpp @@ -741,10 +741,13 @@ HWC2::Error HWCDisplayPrimary::SetDisplayedContentSamplingEnabled(int32_t enable api_sampling_vote = false; } - if (api_sampling_vote || vndservice_sampling_vote) { - histogram.start(); + auto start = api_sampling_vote || vndservice_sampling_vote; + if (start && max_frames == 0) { + histogram.start(); + } else if (start) { + histogram.start(max_frames); } else { - histogram.stop(); + histogram.stop(); } return HWC2::Error::None; } -- cgit v1.2.3