Commit cb8a0fc6 authored by Khushal's avatar Khushal Committed by Commit Bot

gpu: Respect sync token dependencies for UpdateSyncToken.

This was inadvertantly removed with change [1]. The reason it likely
hasn't been an issue in practice is the use-cases which rely on this
API are updates to GMBs on the CPU. We already need to wait on fences
to ensure the GPU side work is complete before writing to the memory on
the CPU so the sync token wait ends up being moot.

Still restoring the code for now since I don't understand all the
use-cases that rely on it to decide whether it can be removed.

[1]: https://chromium-review.googlesource.com/c/chromium/src/+/1611102

R=ericrk@chromium.org

Bug: 900706
Change-Id: I174716cad94bae7f33ef80d79b677af7ea1e6d6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750103
Commit-Queue: Khushal <khushalsagar@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686229}
parent ec2975a1
...@@ -177,6 +177,8 @@ void SharedImageInterfaceProxy::UpdateSharedImage( ...@@ -177,6 +177,8 @@ void SharedImageInterfaceProxy::UpdateSharedImage(
const Mailbox& mailbox) { const Mailbox& mailbox) {
std::vector<SyncToken> dependencies; std::vector<SyncToken> dependencies;
if (sync_token.HasData()) { if (sync_token.HasData()) {
DCHECK(!acquire_fence);
dependencies.push_back(sync_token); dependencies.push_back(sync_token);
SyncToken& new_token = dependencies.back(); SyncToken& new_token = dependencies.back();
if (!new_token.verified_flush()) { if (!new_token.verified_flush()) {
...@@ -202,9 +204,10 @@ void SharedImageInterfaceProxy::UpdateSharedImage( ...@@ -202,9 +204,10 @@ void SharedImageInterfaceProxy::UpdateSharedImage(
route_id_, mailbox, ++next_release_id_, acquire_fence_handle)); route_id_, mailbox, ++next_release_id_, acquire_fence_handle));
return; return;
} }
last_flush_id_ = last_flush_id_ = host_->EnqueueDeferredMessage(
host_->EnqueueDeferredMessage(GpuChannelMsg_UpdateSharedImage( GpuChannelMsg_UpdateSharedImage(route_id_, mailbox, ++next_release_id_,
route_id_, mailbox, ++next_release_id_, acquire_fence_handle)); acquire_fence_handle),
std::move(dependencies));
} }
} }
......
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