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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 1489573003: Added an extra sync token field for extra command buffer identification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index b8785bc64a6fe12bee74f6c88a3e595c0b9084bc..ac20e2a3b36f3b8af4dff826aef3716ff580b27e 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -449,6 +449,7 @@ int32_t CommandBufferProxyImpl::CreateImage(ClientBuffer buffer,
if (image_fence_sync) {
gpu::SyncToken sync_token(GetNamespaceID(), GetCommandBufferID(),
+ GetExtraCommandBufferData(),
image_fence_sync);
// Force a synchronous IPC to validate sync token.
@@ -519,6 +520,10 @@ uint64_t CommandBufferProxyImpl::GetCommandBufferID() const {
return command_buffer_id_;
}
+uint32_t CommandBufferProxyImpl::GetExtraCommandBufferData() const {
+ return static_cast<uint32_t>(stream_id_);
+}
+
uint64_t CommandBufferProxyImpl::GenerateFenceSyncRelease() {
return next_fence_sync_release_++;
}
@@ -577,8 +582,18 @@ bool CommandBufferProxyImpl::CanWaitUnverifiedSyncToken(
// Can only wait on an unverified sync token if it is from the same channel.
const uint64_t token_channel = sync_token->command_buffer_id() >> 32;
const uint64_t channel = command_buffer_id_ >> 32;
- return (sync_token->namespace_id() == gpu::CommandBufferNamespace::GPU_IO &&
- token_channel == channel);
+ if (sync_token->namespace_id() != gpu::CommandBufferNamespace::GPU_IO &&
piman 2015/11/30 20:59:23 || instead of &&
David Yen 2015/11/30 22:45:06 Done.
+ token_channel != channel) {
+ return false;
+ }
+
+ // If waiting on a different stream, flush pending commands on that stream.
+ const int32_t release_stream_id =
+ static_cast<int32_t>(sync_token->extra_data_field());
+ if (release_stream_id != stream_id_)
+ channel_->FlushPendingStream(release_stream_id);
+
+ return true;
}
uint32 CommandBufferProxyImpl::InsertSyncPoint() {

Powered by Google App Engine
This is Rietveld 408576698