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

Unified Diff: content/common/gpu/client/gpu_channel_host.h

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted mojo readme, changed wait() to take a pointer Created 5 years, 2 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
Index: content/common/gpu/client/gpu_channel_host.h
diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h
index 46dd9343d49f4fe3b2cdd5bfb09c152d3a47578c..a161a78a8912cd2f8a4c64641cc39c08b80352b8 100644
--- a/content/common/gpu/client/gpu_channel_host.h
+++ b/content/common/gpu/client/gpu_channel_host.h
@@ -107,13 +107,14 @@ class GpuChannelHost : public IPC::Sender,
// Set an ordering barrier. AsyncFlushes any pending barriers on other
// routes. Combines multiple OrderingBarriers into a single AsyncFlush.
- void OrderingBarrier(int32 route_id,
- int32 stream_id,
- int32 put_offset,
- uint32 flush_count,
- const std::vector<ui::LatencyInfo>& latency_info,
- bool put_offset_changed,
- bool do_flush);
+ // Returns the flush ID for the stream or 0 if put offset was not changed.
+ uint32_t OrderingBarrier(int32 route_id,
+ int32 stream_id,
+ int32 put_offset,
+ uint32 flush_count,
+ const std::vector<ui::LatencyInfo>& latency_info,
+ bool put_offset_changed,
+ bool do_flush);
// Create and connect to a command buffer in the GPU process.
scoped_ptr<CommandBufferProxyImpl> CreateViewCommandBuffer(
@@ -181,6 +182,19 @@ class GpuChannelHost : public IPC::Sender,
// Generate a stream ID guaranteed to be unique for this channel.
int32 GenerateStreamID();
+ // Sends a synchronous nop to the server which validate that all previous IPC
+ // messages have been received. Once the synchronous nop has been sent to the
+ // server all previous flushes will all be marked as validated, including
+ // flushes for other streams on the same channel. Once a validation has been
+ // sent, it will return the highest validated flush id for the stream.
+ // If the validation fails (which can only happen upon context lost), the
+ // highest validated flush id will not change. If no flush ID were ever
+ // validated then it will return 0 (Note the lowest valid flush ID is 1).
+ uint32_t ValidateFlushIDReachedServer(int32 stream_id);
+
+ // Returns the highest validated flush ID for a given stream.
+ uint32_t GetHighestValidatedFlushID(int32 stream_id);
+
private:
friend class base::RefCountedThreadSafe<GpuChannelHost>;
@@ -234,10 +248,17 @@ class GpuChannelHost : public IPC::Sender,
StreamFlushInfo();
~StreamFlushInfo();
+ // These are global per stream.
+ uint32_t next_stream_flush_id;
+ uint32_t flushed_stream_flush_id;
+ uint32_t verified_stream_flush_id;
+
+ // These are local per context.
bool flush_pending;
int32 route_id;
int32 put_offset;
uint32 flush_count;
+ uint32_t flush_id;
std::vector<ui::LatencyInfo> latency_info;
};
@@ -249,7 +270,7 @@ class GpuChannelHost : public IPC::Sender,
void Connect(const IPC::ChannelHandle& channel_handle,
base::WaitableEvent* shutdown_event);
bool InternalSend(IPC::Message* msg);
- void InternalFlush(int32 stream_id);
+ void InternalFlush(StreamFlushInfo* flush_info);
// Threading notes: all fields are constant during the lifetime of |this|
// except:
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.cc ('k') | content/common/gpu/client/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698