Commit 2074f318 authored by Saman Sami's avatar Saman Sami Committed by Commit Bot

Add metric for number of cache hits in DrmOverlayManager

Since each cache miss can result in one frame with no overlays, we
would like to make sure it doesn't regress as we work towards fixing
https://crbug.com/756454

Bug: 756454
Change-Id: Iae7cbaddf5974ece8e0078d9ea265752fa016fff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1941047
Commit-Queue: Saman Sami <samans@chromium.org>
Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721179}
parent 0daf82c5
......@@ -23288,6 +23288,17 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Compositing.Display.DrmOverlayManager.CacheHit" enum="Boolean"
expires_after="2020-09-01">
<owner>samans@chromium.org</owner>
<owner>rjkroege@chromium.org</owner>
<summary>
Indicates whether DrmOverlayManager was able to find the overlay
configuration in its cache. Recorded when DrmOverlayManager is asked to
verify an overlay configuration.
</summary>
</histogram>
<histogram name="Compositing.Display.FlattenedRenderPassCount" units="units"
expires_after="2020-07-02">
<owner>backer@chromium.org</owner>
......@@ -8,6 +8,7 @@
#include <memory>
#include <utility>
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/ozone/platform/drm/common/drm_overlay_candidates.h"
......@@ -84,6 +85,7 @@ void DrmOverlayManager::CheckOverlaySupport(
iter = cache.Put(result_candidates, std::move(value));
}
bool cache_hit = false;
OverlayValidationCacheValue& value = iter->second;
if (value.request_num < kThrottleRequestSize) {
value.request_num++;
......@@ -91,11 +93,8 @@ void DrmOverlayManager::CheckOverlaySupport(
value.request_num++;
if (value.status.back() == OVERLAY_STATUS_PENDING)
SendOverlayValidationRequest(result_candidates, widget);
} else {
// We haven't received an answer yet.
if (value.status.back() == OVERLAY_STATUS_PENDING)
return;
} else if (value.status.back() != OVERLAY_STATUS_PENDING) {
cache_hit = true;
size_t size = candidates->size();
const std::vector<OverlayStatus>& status = value.status;
DCHECK_EQ(size, status.size());
......@@ -105,6 +104,7 @@ void DrmOverlayManager::CheckOverlaySupport(
candidates->at(i).overlay_handled = status[i] == OVERLAY_STATUS_ABLE;
}
}
UMA_HISTOGRAM_BOOLEAN("DrmOverlayManager.CacheHit", cache_hit);
}
bool DrmOverlayManager::CanHandleCandidate(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment