Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(983)

Unified Diff: gpu/ipc/client/command_buffer_proxy_impl.cc

Issue 2318933005: Validate all flush IDs if the unvalidated list gets too long. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move cleanup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/client/command_buffer_proxy_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/client/command_buffer_proxy_impl.cc
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc
index 395dcddc18eb5425b6ee37362d6e7e1906ce4bb8..2f4a67fc604a1acf9a988cbe64a42de6abeac95e 100644
--- a/gpu/ipc/client/command_buffer_proxy_impl.cc
+++ b/gpu/ipc/client/command_buffer_proxy_impl.cc
@@ -266,7 +266,6 @@ void CommandBufferProxyImpl::Flush(int32_t put_offset) {
const uint32_t flush_id = channel_->OrderingBarrier(
route_id_, stream_id_, put_offset, ++flush_count_, latency_info_,
put_offset_changed, true, &highest_verified_flush_id);
- UpdateVerifiedReleases(highest_verified_flush_id);
if (put_offset_changed) {
DCHECK(flush_id);
const uint64_t fence_sync_release = next_fence_sync_release_ - 1;
@@ -276,6 +275,7 @@ void CommandBufferProxyImpl::Flush(int32_t put_offset) {
std::make_pair(fence_sync_release, flush_id));
}
}
+ CleanupFlushedReleases(highest_verified_flush_id);
}
if (put_offset_changed)
@@ -298,7 +298,6 @@ void CommandBufferProxyImpl::OrderingBarrier(int32_t put_offset) {
const uint32_t flush_id = channel_->OrderingBarrier(
route_id_, stream_id_, put_offset, ++flush_count_, latency_info_,
put_offset_changed, false, &highest_verified_flush_id);
- UpdateVerifiedReleases(highest_verified_flush_id);
if (put_offset_changed) {
DCHECK(flush_id);
@@ -309,6 +308,7 @@ void CommandBufferProxyImpl::OrderingBarrier(int32_t put_offset) {
std::make_pair(fence_sync_release, flush_id));
}
}
+ CleanupFlushedReleases(highest_verified_flush_id);
}
if (put_offset_changed)
@@ -746,6 +746,18 @@ void CommandBufferProxyImpl::UpdateVerifiedReleases(uint32_t verified_flush) {
}
}
+void CommandBufferProxyImpl::CleanupFlushedReleases(
+ uint32_t highest_verified_flush_id) {
+ DCHECK(channel_);
+ static const uint32_t kMaxUnverifiedFlushes = 1000;
+ if (flushed_release_flush_id_.size() > kMaxUnverifiedFlushes) {
+ // Prevent list of unverified flushes from growing indefinitely.
+ highest_verified_flush_id =
+ channel_->ValidateFlushIDReachedServer(stream_id_, false);
+ }
+ UpdateVerifiedReleases(highest_verified_flush_id);
+}
+
gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const {
return reinterpret_cast<gpu::CommandBufferSharedState*>(
shared_state_shm_->memory());
« no previous file with comments | « gpu/ipc/client/command_buffer_proxy_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698