diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-28 02:45:58 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-28 02:45:58 +0000 |
commit | a384771492ec401be0b7841ffae2cd345c094a6e (patch) | |
tree | 55716855f01e77d1fcbf945055c6473cdf17424e /content | |
parent | cecc74b7ce0d443998830809938d513b533d0836 (diff) | |
download | chromium_src-a384771492ec401be0b7841ffae2cd345c094a6e.zip chromium_src-a384771492ec401be0b7841ffae2cd345c094a6e.tar.gz chromium_src-a384771492ec401be0b7841ffae2cd345c094a6e.tar.bz2 |
Add a flush_count to the IPC messages because they come out of order.
TEST=stuff runs again
BUG=84043,84182,83956
Review URL: http://codereview.chromium.org/7086015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.cc | 21 | ||||
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.h | 4 | ||||
-rw-r--r-- | content/common/gpu/gpu_messages.h | 8 | ||||
-rw-r--r-- | content/renderer/gpu/command_buffer_proxy.cc | 7 | ||||
-rw-r--r-- | content/renderer/gpu/command_buffer_proxy.h | 1 |
5 files changed, 31 insertions, 10 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index e207372..600cab2 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -48,6 +48,7 @@ GpuCommandBufferStub::GpuCommandBufferStub( requested_attribs_(attribs), parent_texture_id_(parent_texture_id), route_id_(route_id), + last_flush_count_(0), renderer_id_(renderer_id), render_view_id_(render_view_id), watchdog_(watchdog), @@ -195,10 +196,17 @@ void GpuCommandBufferStub::OnGetState(IPC::Message* reply_message) { void GpuCommandBufferStub::OnFlush(int32 put_offset, int32 last_known_get, + int32 flush_count, IPC::Message* reply_message) { TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnFlush"); - gpu::CommandBuffer::State state = command_buffer_->FlushSync(put_offset, - last_known_get); + gpu::CommandBuffer::State state; + if (flush_count <= last_flush_count_) { + DLOG(INFO) << "!!OUT OF ORDER IPC!!"; + state = command_buffer_->GetState(); + } else { + last_flush_count_ = flush_count; + state = command_buffer_->FlushSync(put_offset, last_known_get); + } if (state.error == gpu::error::kLostContext && gfx::GLContext::LosesAllContextsOnContextLost()) channel_->LoseAllContexts(); @@ -207,9 +215,14 @@ void GpuCommandBufferStub::OnFlush(int32 put_offset, Send(reply_message); } -void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset) { +void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset, int32 flush_count) { TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnAsyncFlush"); - command_buffer_->Flush(put_offset); + if (flush_count > last_flush_count_) { + last_flush_count_ = flush_count; + command_buffer_->Flush(put_offset); + } else { + DLOG(INFO) << "!!OUT OF ORDER IPC!!"; + } // TODO(piman): Do this everytime the scheduler finishes processing a batch of // commands. MessageLoop::current()->PostTask(FROM_HERE, diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h index 601e7ef..0526b79 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -85,8 +85,9 @@ class GpuCommandBufferStub void OnGetState(IPC::Message* reply_message); void OnFlush(int32 put_offset, int32 last_known_get, + int32 flush_count, IPC::Message* reply_message); - void OnAsyncFlush(int32 put_offset); + void OnAsyncFlush(int32 put_offset, int32 flush_count); void OnCreateTransferBuffer(int32 size, int32 id_request, IPC::Message* reply_message); @@ -124,6 +125,7 @@ class GpuCommandBufferStub std::vector<int32> requested_attribs_; uint32 parent_texture_id_; int32 route_id_; + int32 last_flush_count_; // The following two fields are used on Mac OS X to identify the window // for the rendering results on the browser side. diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 2ddd0de..466367e 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -352,16 +352,18 @@ IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState, // Synchronize the put and get offsets of both processes. Caller passes its // current put offset. Current state (including get offset) is returned. -IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_Flush, +IPC_SYNC_MESSAGE_ROUTED3_1(GpuCommandBufferMsg_Flush, int32 /* put_offset */, int32 /* last_known_get */, + int32 /* flush_count */, gpu::CommandBuffer::State /* state */) // Asynchronously synchronize the put and get offsets of both processes. // Caller passes its current put offset. Current state (including get offset) // is returned via an UpdateState message. -IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_AsyncFlush, - int32 /* put_offset */) +IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush, + int32 /* put_offset */, + int32 /* flush_count */) // Return the current state of the command buffer following a request via // an AsyncGetState or AsyncFlush message. (This message is sent from the diff --git a/content/renderer/gpu/command_buffer_proxy.cc b/content/renderer/gpu/command_buffer_proxy.cc index 2eb53cb..dca13b8 100644 --- a/content/renderer/gpu/command_buffer_proxy.cc +++ b/content/renderer/gpu/command_buffer_proxy.cc @@ -24,7 +24,8 @@ CommandBufferProxy::CommandBufferProxy( int route_id) : num_entries_(0), channel_(channel), - route_id_(route_id) { + route_id_(route_id), + flush_count_(0) { } CommandBufferProxy::~CommandBufferProxy() { @@ -153,7 +154,8 @@ void CommandBufferProxy::Flush(int32 put_offset) { if (last_state_.error != gpu::error::kNoError) return; - Send(new GpuCommandBufferMsg_AsyncFlush(route_id_, put_offset)); + Send(new GpuCommandBufferMsg_AsyncFlush( + route_id_, put_offset, ++flush_count_)); } gpu::CommandBuffer::State CommandBufferProxy::FlushSync(int32 put_offset, @@ -166,6 +168,7 @@ gpu::CommandBuffer::State CommandBufferProxy::FlushSync(int32 put_offset, if (Send(new GpuCommandBufferMsg_Flush(route_id_, put_offset, last_known_get, + ++flush_count_, &state))) OnUpdateState(state); } diff --git a/content/renderer/gpu/command_buffer_proxy.h b/content/renderer/gpu/command_buffer_proxy.h index 6f88695..0cadef7 100644 --- a/content/renderer/gpu/command_buffer_proxy.h +++ b/content/renderer/gpu/command_buffer_proxy.h @@ -106,6 +106,7 @@ class CommandBufferProxy : public gpu::CommandBuffer, IPC::Channel::Sender* channel_; int route_id_; + int flush_count_; scoped_ptr<Task> notify_repaint_task_; |