diff options
author | dyen <dyen@chromium.org> | 2016-01-22 15:38:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-22 23:40:29 +0000 |
commit | 7246e45b7da6c14b1384658481ec49b45b5b488c (patch) | |
tree | 3690ae84ea9e9117591178597e6aa3e09fde007b | |
parent | 65740e3efadf5dad31f11b6d50eb6b63ccb3f2d7 (diff) | |
download | chromium_src-7246e45b7da6c14b1384658481ec49b45b5b488c.zip chromium_src-7246e45b7da6c14b1384658481ec49b45b5b488c.tar.gz chromium_src-7246e45b7da6c14b1384658481ec49b45b5b488c.tar.bz2 |
Removed last references to old sync points.
BUG=514815, 373452
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1615253006
Cr-Commit-Position: refs/heads/master@{#371082}
35 files changed, 1 insertions, 411 deletions
diff --git a/cc/test/test_context_support.cc b/cc/test/test_context_support.cc index bf033fc..6959d8c 100644 --- a/cc/test/test_context_support.cc +++ b/cc/test/test_context_support.cc @@ -19,14 +19,6 @@ TestContextSupport::TestContextSupport() TestContextSupport::~TestContextSupport() {} -void TestContextSupport::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - sync_point_callbacks_.push_back(callback); - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&TestContextSupport::CallAllSyncPointCallbacks, - weak_ptr_factory_.GetWeakPtr())); -} - void TestContextSupport::SignalSyncToken(const gpu::SyncToken& sync_token, const base::Closure& callback) { sync_point_callbacks_.push_back(callback); @@ -71,15 +63,6 @@ void TestContextSupport::SetScheduleOverlayPlaneCallback( void TestContextSupport::Swap() { } -uint32_t TestContextSupport::InsertFutureSyncPointCHROMIUM() { - NOTIMPLEMENTED(); - return 0; -} - -void TestContextSupport::RetireSyncPointCHROMIUM(uint32_t sync_point) { - NOTIMPLEMENTED(); -} - void TestContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) { } diff --git a/cc/test/test_context_support.h b/cc/test/test_context_support.h index d82c7ae..18d7efa 100644 --- a/cc/test/test_context_support.h +++ b/cc/test/test_context_support.h @@ -26,8 +26,6 @@ class TestContextSupport : public gpu::ContextSupport { ~TestContextSupport() override; // gpu::ContextSupport implementation. - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalSyncToken(const gpu::SyncToken& sync_token, const base::Closure& callback) override; void SignalQuery(uint32_t query, const base::Closure& callback) override; @@ -35,8 +33,6 @@ class TestContextSupport : public gpu::ContextSupport { void Swap() override; void PartialSwapBuffers(const gfx::Rect& sub_buffer) override; void CommitOverlayPlanes() override; - uint32_t InsertFutureSyncPointCHROMIUM() override; - void RetireSyncPointCHROMIUM(uint32_t sync_point) override; void ScheduleOverlayPlane(int plane_z_order, gfx::OverlayTransform plane_transform, unsigned overlay_texture_id, diff --git a/components/mus/gles2/command_buffer_driver.cc b/components/mus/gles2/command_buffer_driver.cc index d6a0dae..a909517 100644 --- a/components/mus/gles2/command_buffer_driver.cc +++ b/components/mus/gles2/command_buffer_driver.cc @@ -128,8 +128,6 @@ bool CommandBufferDriver::Initialize( sync_point_client_ = gpu_state_->sync_point_manager()->CreateSyncPointClient( sync_point_order_data_, GetNamespaceID(), command_buffer_id_); decoder_->set_engine(scheduler_.get()); - decoder_->SetWaitSyncPointCallback(base::Bind( - &CommandBufferDriver::OnWaitSyncPoint, base::Unretained(this))); decoder_->SetFenceSyncReleaseCallback(base::Bind( &CommandBufferDriver::OnFenceSyncRelease, base::Unretained(this))); decoder_->SetWaitFenceSyncCallback(base::Bind( @@ -444,19 +442,6 @@ void CommandBufferDriver::OnUpdateVSyncParameters( } } -bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) { - DCHECK(CalledOnValidThread()); - DCHECK(scheduler_->scheduled()); - if (!sync_point) - return true; - - scheduler_->SetScheduled(false); - gpu_state_->sync_point_manager()->AddSyncPointCallback( - sync_point, base::Bind(&gpu::GpuScheduler::SetScheduled, - scheduler_->AsWeakPtr(), true)); - return scheduler_->scheduled(); -} - void CommandBufferDriver::OnFenceSyncRelease(uint64_t release) { DCHECK(CalledOnValidThread()); if (!sync_point_client_->client_state()->IsFenceSyncReleased(release)) diff --git a/components/mus/gles2/command_buffer_driver.h b/components/mus/gles2/command_buffer_driver.h index b65a2e2..08ee3c1 100644 --- a/components/mus/gles2/command_buffer_driver.h +++ b/components/mus/gles2/command_buffer_driver.h @@ -111,7 +111,6 @@ class CommandBufferDriver : base::NonThreadSafe { // Callbacks: void OnUpdateVSyncParameters(const base::TimeTicks timebase, const base::TimeDelta interval); - bool OnWaitSyncPoint(uint32_t sync_point); void OnFenceSyncRelease(uint64_t release); bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, uint64_t command_buffer_id, diff --git a/components/mus/gles2/command_buffer_impl.cc b/components/mus/gles2/command_buffer_impl.cc index 3666522..aa8fa3b 100644 --- a/components/mus/gles2/command_buffer_impl.cc +++ b/components/mus/gles2/command_buffer_impl.cc @@ -67,9 +67,6 @@ void CommandBufferImpl::DidLoseContext(uint32_t reason) { } CommandBufferImpl::~CommandBufferImpl() { - // Retire all sync points. - for (uint32_t sync_point : sync_points_) - gpu_state_->sync_point_manager()->RetireSyncPoint(sync_point); if (observer_) observer_->OnCommandBufferImplDestroyed(); } diff --git a/components/mus/gles2/command_buffer_impl.h b/components/mus/gles2/command_buffer_impl.h index e4ea15b..cbe91cf 100644 --- a/components/mus/gles2/command_buffer_impl.h +++ b/components/mus/gles2/command_buffer_impl.h @@ -94,7 +94,6 @@ class CommandBufferImpl : public mojom::CommandBuffer { scoped_refptr<GpuState> gpu_state_; scoped_ptr<CommandBufferDriver> driver_; scoped_ptr<mojo::Binding<CommandBuffer>> binding_; - std::deque<uint32_t> sync_points_; CommandBufferImplObserver* observer_; mojom::CommandBufferLostContextObserverPtr loss_observer_; diff --git a/components/mus/gles2/command_buffer_local.cc b/components/mus/gles2/command_buffer_local.cc index 9d2deab..421c4c3 100644 --- a/components/mus/gles2/command_buffer_local.cc +++ b/components/mus/gles2/command_buffer_local.cc @@ -293,25 +293,6 @@ int32_t CommandBufferLocal::CreateGpuMemoryBufferImage(size_t width, return CreateImage(buffer->AsClientBuffer(), width, height, internal_format); } -uint32_t CommandBufferLocal::InsertSyncPoint() { - NOTREACHED(); - return 0; -} - -uint32_t CommandBufferLocal::InsertFutureSyncPoint() { - NOTREACHED(); - return 0; -} - -void CommandBufferLocal::RetireSyncPoint(uint32_t sync_point) { - NOTREACHED(); -} - -void CommandBufferLocal::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - NOTREACHED(); -} - void CommandBufferLocal::SignalQuery(uint32_t query_id, const base::Closure& callback) { DCHECK(CalledOnValidThread()); diff --git a/components/mus/gles2/command_buffer_local.h b/components/mus/gles2/command_buffer_local.h index 73e1482..4743523 100644 --- a/components/mus/gles2/command_buffer_local.h +++ b/components/mus/gles2/command_buffer_local.h @@ -83,11 +83,6 @@ class CommandBufferLocal : public gpu::CommandBuffer, size_t height, unsigned internal_format, unsigned usage) override; - uint32_t InsertSyncPoint() override; - uint32_t InsertFutureSyncPoint() override; - void RetireSyncPoint(uint32_t sync_point) override; - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalQuery(uint32_t query_id, const base::Closure& callback) override; void SetLock(base::Lock*) override; bool IsGpuChannelLost() override; diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc index 3991feb..027936f 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.cc +++ b/content/common/gpu/client/command_buffer_proxy_impl.cc @@ -620,29 +620,6 @@ bool CommandBufferProxyImpl::CanWaitUnverifiedSyncToken( return true; } -uint32_t CommandBufferProxyImpl::InsertSyncPoint() { - CheckLock(); - NOTREACHED(); - return 0; -} - -uint32_t CommandBufferProxyImpl::InsertFutureSyncPoint() { - CheckLock(); - NOTREACHED(); - return 0; -} - -void CommandBufferProxyImpl::RetireSyncPoint(uint32_t sync_point) { - CheckLock(); - NOTREACHED(); -} - -void CommandBufferProxyImpl::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - CheckLock(); - NOTREACHED(); -} - void CommandBufferProxyImpl::SignalQuery(uint32_t query, const base::Closure& callback) { CheckLock(); diff --git a/content/common/gpu/client/command_buffer_proxy_impl.h b/content/common/gpu/client/command_buffer_proxy_impl.h index 17589a7..2f0ed90 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.h +++ b/content/common/gpu/client/command_buffer_proxy_impl.h @@ -116,11 +116,6 @@ class CommandBufferProxyImpl size_t height, unsigned internal_format, unsigned usage) override; - uint32_t InsertSyncPoint() override; - uint32_t InsertFutureSyncPoint() override; - void RetireSyncPoint(uint32_t sync_point) override; - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalQuery(uint32_t query, const base::Closure& callback) override; void SetLock(base::Lock* lock) override; bool IsGpuChannelLost() override; diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h index 0be2899..e125c76 100644 --- a/gpu/command_buffer/client/client_test_helper.h +++ b/gpu/command_buffer/client/client_test_helper.h @@ -108,11 +108,6 @@ class MockClientGpuControl : public GpuControl { size_t height, unsigned internalformat, unsigned usage)); - MOCK_METHOD0(InsertSyncPoint, uint32_t()); - MOCK_METHOD0(InsertFutureSyncPoint, uint32_t()); - MOCK_METHOD1(RetireSyncPoint, void(uint32_t id)); - MOCK_METHOD2(SignalSyncPoint, - void(uint32_t id, const base::Closure& callback)); MOCK_METHOD2(SignalQuery, void(uint32_t query, const base::Closure& callback)); MOCK_METHOD1(CreateStreamTexture, uint32_t(uint32_t)); diff --git a/gpu/command_buffer/client/context_support.h b/gpu/command_buffer/client/context_support.h index 1e71190..0e7c75c 100644 --- a/gpu/command_buffer/client/context_support.h +++ b/gpu/command_buffer/client/context_support.h @@ -21,10 +21,6 @@ struct SyncToken; class ContextSupport { public: - // Runs |callback| when a sync point is reached. - virtual void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) = 0; - // Runs |callback| when a sync token is signalled. virtual void SignalSyncToken(const SyncToken& sync_token, const base::Closure& callback) = 0; @@ -52,9 +48,6 @@ class ContextSupport { const gfx::Rect& display_bounds, const gfx::RectF& uv_rect) = 0; - virtual uint32_t InsertFutureSyncPointCHROMIUM() = 0; - virtual void RetireSyncPointCHROMIUM(uint32_t sync_point) = 0; - // Returns an ID that can be used to globally identify the share group that // this context's resources belong to. virtual uint64_t ShareGroupTracingGUID() const = 0; diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index b9e3bee..6d6e1a5 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -313,15 +313,6 @@ void GLES2Implementation::RunIfContextNotLost(const base::Closure& callback) { callback.Run(); } -void GLES2Implementation::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - gpu_control_->SignalSyncPoint( - sync_point, - base::Bind(&GLES2Implementation::RunIfContextNotLost, - weak_ptr_factory_.GetWeakPtr(), - callback)); -} - void GLES2Implementation::SignalSyncToken(const gpu::SyncToken& sync_token, const base::Closure& callback) { if (sync_token.HasData() && @@ -5547,22 +5538,6 @@ GLboolean GLES2Implementation::UnmapBufferCHROMIUM(GLuint target) { return true; } -GLuint GLES2Implementation::InsertFutureSyncPointCHROMIUM() { - GPU_CLIENT_SINGLE_THREAD_CHECK(); - GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInsertFutureSyncPointCHROMIUM"); - DCHECK(capabilities_.future_sync_points); - return gpu_control_->InsertFutureSyncPoint(); -} - -void GLES2Implementation::RetireSyncPointCHROMIUM(GLuint sync_point) { - GPU_CLIENT_SINGLE_THREAD_CHECK(); - GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRetireSyncPointCHROMIUM(" - << sync_point << ")"); - DCHECK(capabilities_.future_sync_points); - helper_->CommandBufferHelper::Flush(); - gpu_control_->RetireSyncPoint(sync_point); -} - uint64_t GLES2Implementation::ShareGroupTracingGUID() const { return share_group_->TracingGUID(); } diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h index 5750766..e0b8494 100644 --- a/gpu/command_buffer/client/gles2_implementation.h +++ b/gpu/command_buffer/client/gles2_implementation.h @@ -211,8 +211,6 @@ class GLES2_IMPL_EXPORT GLES2Implementation unsigned overlay_texture_id, const gfx::Rect& display_bounds, const gfx::RectF& uv_rect) override; - GLuint InsertFutureSyncPointCHROMIUM() override; - void RetireSyncPointCHROMIUM(GLuint sync_point) override; uint64_t ShareGroupTracingGUID() const override; void GetProgramInfoCHROMIUMHelper(GLuint program, @@ -257,8 +255,6 @@ class GLES2_IMPL_EXPORT GLES2Implementation void FreeEverything(); // ContextSupport implementation. - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalSyncToken(const gpu::SyncToken& sync_token, const base::Closure& callback) override; void SignalQuery(uint32_t query, const base::Closure& callback) override; diff --git a/gpu/command_buffer/client/gpu_control.h b/gpu/command_buffer/client/gpu_control.h index c8d20be..28cd67a 100644 --- a/gpu/command_buffer/client/gpu_control.h +++ b/gpu/command_buffer/client/gpu_control.h @@ -55,23 +55,6 @@ class GPU_EXPORT GpuControl { unsigned internalformat, unsigned usage) = 0; - // Inserts a sync point, returning its ID. Sync point IDs are global and can - // be used for cross-context synchronization. - virtual uint32_t InsertSyncPoint() = 0; - - // Inserts a future sync point, returning its ID. Sync point IDs are global - // and can be used for cross-context synchronization. The sync point won't be - // retired immediately. - virtual uint32_t InsertFutureSyncPoint() = 0; - - // Retires a future sync point. This will signal contexts that are waiting - // on it to start executing. - virtual void RetireSyncPoint(uint32_t sync_point) = 0; - - // Runs |callback| when a sync point is reached. - virtual void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) = 0; - // Runs |callback| when a query created via glCreateQueryEXT() has cleared // passed the glEndQueryEXT() point. virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 5082e29..a35e179 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -621,7 +621,6 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { const ContextState* GetContextState() override { return &state_; } void SetShaderCacheCallback(const ShaderCacheCallback& callback) override; - void SetWaitSyncPointCallback(const WaitSyncPointCallback& callback) override; void SetFenceSyncReleaseCallback( const FenceSyncReleaseCallback& callback) override; void SetWaitFenceSyncCallback(const WaitFenceSyncCallback& callback) override; @@ -1962,7 +1961,6 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { scoped_ptr<ImageManager> image_manager_; - WaitSyncPointCallback wait_sync_point_callback_; FenceSyncReleaseCallback fence_sync_release_callback_; WaitFenceSyncCallback wait_fence_sync_callback_; @@ -3970,11 +3968,6 @@ void GLES2DecoderImpl::SetShaderCacheCallback( shader_cache_callback_ = callback; } -void GLES2DecoderImpl::SetWaitSyncPointCallback( - const WaitSyncPointCallback& callback) { - wait_sync_point_callback_ = callback; -} - void GLES2DecoderImpl::SetFenceSyncReleaseCallback( const FenceSyncReleaseCallback& callback) { fence_sync_release_callback_ = callback; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index 3a4825f..03e9822 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -65,7 +65,6 @@ class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, public CommonDecoder { public: typedef error::Error Error; - typedef base::Callback<bool(uint32_t id)> WaitSyncPointCallback; typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; typedef base::Callback<bool(gpu::CommandBufferNamespace namespace_id, uint64_t command_buffer_id, @@ -232,11 +231,6 @@ class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, // A callback for messages from the decoder. virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; - // Sets the callback for waiting on a sync point. The callback returns the - // scheduling status (i.e. true if the channel is still scheduled). - virtual void SetWaitSyncPointCallback( - const WaitSyncPointCallback& callback) = 0; - // Sets the callback for fence sync release and wait calls. The wait call // returns true if the channel is still scheduled. virtual void SetFenceSyncReleaseCallback( diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h index bc954f8..66dee88 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h @@ -118,8 +118,6 @@ class MockGLES2Decoder : public GLES2Decoder { MOCK_METHOD0(GetLogger, Logger*()); MOCK_METHOD1(SetShaderCacheCallback, void(const ShaderCacheCallback& callback)); - MOCK_METHOD1(SetWaitSyncPointCallback, - void(const WaitSyncPointCallback& callback)); MOCK_METHOD1(SetFenceSyncReleaseCallback, void(const FenceSyncReleaseCallback& callback)); MOCK_METHOD1(SetWaitFenceSyncCallback, diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc index ccc5111..df7923c 100644 --- a/gpu/command_buffer/service/in_process_command_buffer.cc +++ b/gpu/command_buffer/service/in_process_command_buffer.cc @@ -823,25 +823,6 @@ int32_t InProcessCommandBuffer::CreateGpuMemoryBufferImage( return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); } -uint32_t InProcessCommandBuffer::InsertSyncPoint() { - NOTREACHED(); - return 0; -} - -uint32_t InProcessCommandBuffer::InsertFutureSyncPoint() { - NOTREACHED(); - return 0; -} - -void InProcessCommandBuffer::RetireSyncPoint(uint32_t sync_point) { - NOTREACHED(); -} - -void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point, - const base::Closure& callback) { - NOTREACHED(); -} - void InProcessCommandBuffer::FenceSyncReleaseOnGpuThread(uint64_t release) { DCHECK(!sync_point_client_->client_state()->IsFenceSyncReleased(release)); gles2::MailboxManager* mailbox_manager = diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h index 8137400..58c214f 100644 --- a/gpu/command_buffer/service/in_process_command_buffer.h +++ b/gpu/command_buffer/service/in_process_command_buffer.h @@ -122,11 +122,6 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer, size_t height, unsigned internalformat, unsigned usage) override; - uint32_t InsertSyncPoint() override; - uint32_t InsertFutureSyncPoint() override; - void RetireSyncPoint(uint32_t sync_point) override; - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalQuery(uint32_t query_id, const base::Closure& callback) override; void SetLock(base::Lock*) override; bool IsGpuChannelLost() override; diff --git a/gpu/command_buffer/service/sync_point_manager.cc b/gpu/command_buffer/service/sync_point_manager.cc index 74aca52..c3d7d68 100644 --- a/gpu/command_buffer/service/sync_point_manager.cc +++ b/gpu/command_buffer/service/sync_point_manager.cc @@ -20,8 +20,6 @@ namespace gpu { -static const int kMaxSyncBase = INT_MAX; - namespace { void RunOnThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner, @@ -340,11 +338,7 @@ SyncPointClient::SyncPointClient(SyncPointManager* sync_point_manager, namespace_id_(namespace_id), client_id_(client_id) {} -SyncPointManager::SyncPointManager(bool allow_threaded_wait) - : // To reduce the risk that a sync point created in a previous GPU process - // will be in flight in the next GPU process, randomize the starting sync - // point number. http://crbug.com/373452 - next_sync_point_(base::RandInt(1, kMaxSyncBase)) { +SyncPointManager::SyncPointManager(bool allow_threaded_wait) { global_order_num_.GetNext(); } @@ -389,63 +383,6 @@ scoped_refptr<SyncPointClientState> SyncPointManager::GetSyncPointClientState( return nullptr; } -uint32_t SyncPointManager::GenerateSyncPoint() { - base::AutoLock lock(lock_); - uint32_t sync_point = next_sync_point_++; - // When an integer overflow occurs, don't return 0. - if (!sync_point) - sync_point = next_sync_point_++; - - // Note: wrapping would take days for a buggy/compromized renderer that would - // insert sync points in a loop, but if that were to happen, better explicitly - // crash the GPU process than risk worse. - // For normal operation (at most a few per frame), it would take ~a year to - // wrap. - CHECK(sync_point_map_.find(sync_point) == sync_point_map_.end()); - sync_point_map_.insert(std::make_pair(sync_point, ClosureList())); - return sync_point; -} - -void SyncPointManager::RetireSyncPoint(uint32_t sync_point) { - ClosureList list; - { - base::AutoLock lock(lock_); - SyncPointMap::iterator it = sync_point_map_.find(sync_point); - if (it == sync_point_map_.end()) { - LOG(ERROR) << "Attempted to retire sync point that" - " didn't exist or was already retired."; - return; - } - list.swap(it->second); - sync_point_map_.erase(it); - } - for (ClosureList::iterator i = list.begin(); i != list.end(); ++i) - i->Run(); -} - -void SyncPointManager::AddSyncPointCallback(uint32_t sync_point, - const base::Closure& callback) { - { - base::AutoLock lock(lock_); - SyncPointMap::iterator it = sync_point_map_.find(sync_point); - if (it != sync_point_map_.end()) { - it->second.push_back(callback); - return; - } - } - callback.Run(); -} - -bool SyncPointManager::IsSyncPointRetired(uint32_t sync_point) { - base::AutoLock lock(lock_); - return IsSyncPointRetiredLocked(sync_point); -} - -bool SyncPointManager::IsSyncPointRetiredLocked(uint32_t sync_point) { - lock_.AssertAcquired(); - return sync_point_map_.find(sync_point) == sync_point_map_.end(); -} - uint32_t SyncPointManager::GenerateOrderNumber() { return global_order_num_.GetNext(); } diff --git a/gpu/command_buffer/service/sync_point_manager.h b/gpu/command_buffer/service/sync_point_manager.h index 13e848f..8c39441 100644 --- a/gpu/command_buffer/service/sync_point_manager.h +++ b/gpu/command_buffer/service/sync_point_manager.h @@ -284,31 +284,12 @@ class GPU_EXPORT SyncPointManager { scoped_refptr<SyncPointClientState> GetSyncPointClientState( CommandBufferNamespace namespace_id, uint64_t client_id); - // Generates a sync point, returning its ID. This can me called on any thread. - // IDs start at a random number. Never return 0. - uint32_t GenerateSyncPoint(); - - // Retires a sync point. This will call all the registered callbacks for this - // sync point. This can only be called on the main thread. - void RetireSyncPoint(uint32_t sync_point); - - // Adds a callback to the sync point. The callback will be called when the - // sync point is retired, or immediately (from within that function) if the - // sync point was already retired (or not created yet). This can only be - // called on the main thread. - void AddSyncPointCallback(uint32_t sync_point, const base::Closure& callback); - - bool IsSyncPointRetired(uint32_t sync_point); - private: friend class SyncPointClient; friend class SyncPointOrderData; - typedef std::vector<base::Closure> ClosureList; - typedef base::hash_map<uint32_t, ClosureList> SyncPointMap; typedef base::hash_map<uint64_t, SyncPointClient*> ClientMap; - bool IsSyncPointRetiredLocked(uint32_t sync_point); uint32_t GenerateOrderNumber(); void DestroySyncPointClient(CommandBufferNamespace namespace_id, uint64_t client_id); @@ -320,12 +301,6 @@ class GPU_EXPORT SyncPointManager { base::Lock client_maps_lock_; ClientMap client_maps_[NUM_COMMAND_BUFFER_NAMESPACES]; - // Protects the 2 fields below. Note: callbacks shouldn't be called with this - // held. - base::Lock lock_; - SyncPointMap sync_point_map_; - uint32_t next_sync_point_; - DISALLOW_COPY_AND_ASSIGN(SyncPointManager); }; diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc index 812d8fd..92664315 100644 --- a/gpu/command_buffer/tests/gl_manager.cc +++ b/gpu/command_buffer/tests/gl_manager.cc @@ -484,25 +484,6 @@ void GLManager::DestroyImage(int32_t id) { image_manager->RemoveImage(id); } -uint32_t GLManager::InsertSyncPoint() { - NOTIMPLEMENTED(); - return 0u; -} - -uint32_t GLManager::InsertFutureSyncPoint() { - NOTIMPLEMENTED(); - return 0u; -} - -void GLManager::RetireSyncPoint(uint32_t sync_point) { - NOTIMPLEMENTED(); -} - -void GLManager::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - NOTIMPLEMENTED(); -} - void GLManager::SignalQuery(uint32_t query, const base::Closure& callback) { NOTIMPLEMENTED(); } diff --git a/gpu/command_buffer/tests/gl_manager.h b/gpu/command_buffer/tests/gl_manager.h index 5ff83f0..02d01e4 100644 --- a/gpu/command_buffer/tests/gl_manager.h +++ b/gpu/command_buffer/tests/gl_manager.h @@ -127,11 +127,6 @@ class GLManager : private GpuControl { size_t height, unsigned internalformat, unsigned usage) override; - uint32_t InsertSyncPoint() override; - uint32_t InsertFutureSyncPoint() override; - void RetireSyncPoint(uint32_t sync_point) override; - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalQuery(uint32_t query, const base::Closure& callback) override; void SetLock(base::Lock*) override; bool IsGpuChannelLost() override; diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc index 6152408..3ad04c7 100644 --- a/gpu/gles2_conform_support/egl/display.cc +++ b/gpu/gles2_conform_support/egl/display.cc @@ -308,25 +308,6 @@ int32_t Display::CreateGpuMemoryBufferImage(size_t width, return -1; } -uint32_t Display::InsertSyncPoint() { - NOTIMPLEMENTED(); - return 0u; -} - -uint32_t Display::InsertFutureSyncPoint() { - NOTIMPLEMENTED(); - return 0u; -} - -void Display::RetireSyncPoint(uint32_t sync_point) { - NOTIMPLEMENTED(); -} - -void Display::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - NOTIMPLEMENTED(); -} - void Display::SignalQuery(uint32_t query, const base::Closure& callback) { NOTIMPLEMENTED(); } diff --git a/gpu/gles2_conform_support/egl/display.h b/gpu/gles2_conform_support/egl/display.h index acbf48f..9aa0fb7 100644 --- a/gpu/gles2_conform_support/egl/display.h +++ b/gpu/gles2_conform_support/egl/display.h @@ -91,11 +91,6 @@ class Display : private gpu::GpuControl { size_t height, unsigned internalformat, unsigned usage) override; - uint32_t InsertSyncPoint() override; - uint32_t InsertFutureSyncPoint() override; - void RetireSyncPoint(uint32_t sync_point) override; - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalQuery(uint32_t query, const base::Closure& callback) override; void SetLock(base::Lock*) override; bool IsGpuChannelLost() override; diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc index a4ece0c..5706af0 100644 --- a/mojo/gles2/command_buffer_client_impl.cc +++ b/mojo/gles2/command_buffer_client_impl.cc @@ -271,26 +271,6 @@ int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage( return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); } -uint32_t CommandBufferClientImpl::InsertSyncPoint() { - NOTREACHED(); - return 0; -} - -uint32_t CommandBufferClientImpl::InsertFutureSyncPoint() { - NOTREACHED(); - return 0; -} - -void CommandBufferClientImpl::RetireSyncPoint(uint32_t sync_point) { - NOTREACHED(); -} - -void CommandBufferClientImpl::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - // TODO(piman) - NOTIMPLEMENTED(); -} - void CommandBufferClientImpl::SignalQuery(uint32_t query, const base::Closure& callback) { // TODO(piman) diff --git a/mojo/gles2/command_buffer_client_impl.h b/mojo/gles2/command_buffer_client_impl.h index 3eb4aa4..2152150 100644 --- a/mojo/gles2/command_buffer_client_impl.h +++ b/mojo/gles2/command_buffer_client_impl.h @@ -68,11 +68,6 @@ class CommandBufferClientImpl size_t height, unsigned internalformat, unsigned usage) override; - uint32_t InsertSyncPoint() override; - uint32_t InsertFutureSyncPoint() override; - void RetireSyncPoint(uint32_t sync_point) override; - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalQuery(uint32_t query, const base::Closure& callback) override; void SetLock(base::Lock*) override; bool IsGpuChannelLost() override; diff --git a/mojo/gles2/gles2_impl.cc b/mojo/gles2/gles2_impl.cc index fdd6763..bb117f5 100644 --- a/mojo/gles2/gles2_impl.cc +++ b/mojo/gles2/gles2_impl.cc @@ -25,11 +25,6 @@ const int32_t kNone = 0x3038; // EGL_NONE base::LazyInstance<base::ThreadLocalPointer<gpu::gles2::GLES2Interface> >::Leaky g_gpu_interface; -void RunSignalSyncCallback(MojoGLES2SignalSyncPointCallback callback, - void* closure) { - callback(closure); -} - } // namespace extern "C" { @@ -74,16 +69,6 @@ void MojoGLES2SwapBuffers() { g_gpu_interface.Get().Get()->SwapBuffers(); } -void MojoGLES2SignalSyncPoint( - MojoGLES2Context context, - uint32_t sync_point, - MojoGLES2SignalSyncPointCallback callback, - void* closure) { - DCHECK(context); - static_cast<GLES2Context*>(context)->context_support()->SignalSyncPoint( - sync_point, base::Bind(&RunSignalSyncCallback, callback, closure)); -} - void* MojoGLES2GetGLES2Interface(MojoGLES2Context context) { return static_cast<GLES2Context*>(context)->interface(); } diff --git a/mojo/public/c/gles2/gles2.h b/mojo/public/c/gles2/gles2.h index b8196b9..247084d 100644 --- a/mojo/public/c/gles2/gles2.h +++ b/mojo/public/c/gles2/gles2.h @@ -28,11 +28,6 @@ MOJO_GLES2_EXPORT MojoGLES2Context MOJO_GLES2_EXPORT void MojoGLES2DestroyContext(MojoGLES2Context context); MOJO_GLES2_EXPORT void MojoGLES2MakeCurrent(MojoGLES2Context context); MOJO_GLES2_EXPORT void MojoGLES2SwapBuffers(void); -MOJO_GLES2_EXPORT void MojoGLES2SignalSyncPoint( - MojoGLES2Context context, - uint32_t sync_point, - MojoGLES2SignalSyncPointCallback callback, - void* closure); // TODO(piman): We shouldn't have to leak this interface, especially in a // type-unsafe way. diff --git a/mojo/public/c/gles2/gles2_types.h b/mojo/public/c/gles2/gles2_types.h index 75be18b..3ecf4db 100644 --- a/mojo/public/c/gles2/gles2_types.h +++ b/mojo/public/c/gles2/gles2_types.h @@ -17,7 +17,6 @@ extern "C" { typedef struct MojoGLES2ContextPrivate* MojoGLES2Context; typedef void (*MojoGLES2ContextLost)(void* closure); -typedef void (*MojoGLES2SignalSyncPointCallback)(void* closure); #ifdef __cplusplus } // extern "C" diff --git a/mojo/public/platform/native/gles2_thunks.cc b/mojo/public/platform/native/gles2_thunks.cc index 95da13b..2350fce 100644 --- a/mojo/public/platform/native/gles2_thunks.cc +++ b/mojo/public/platform/native/gles2_thunks.cc @@ -44,14 +44,6 @@ void* MojoGLES2GetGLES2Interface(MojoGLES2Context context) { return g_control_thunks.GLES2GetGLES2Interface(context); } -void MojoGLES2SignalSyncPoint(MojoGLES2Context context, - uint32_t sync_point, - MojoGLES2SignalSyncPointCallback callback, - void* closure) { - assert(g_control_thunks.GLES2SignalSyncPoint); - g_control_thunks.GLES2SignalSyncPoint(context, sync_point, callback, closure); -} - extern "C" THUNK_EXPORT size_t MojoSetGLES2ControlThunks( const MojoGLES2ControlThunks* gles2_control_thunks) { if (gles2_control_thunks->size >= sizeof(g_control_thunks)) diff --git a/mojo/public/platform/native/gles2_thunks.h b/mojo/public/platform/native/gles2_thunks.h index b94d3f9..cd9cc75 100644 --- a/mojo/public/platform/native/gles2_thunks.h +++ b/mojo/public/platform/native/gles2_thunks.h @@ -31,11 +31,6 @@ struct MojoGLES2ControlThunks { // TODO(piman): We shouldn't have to leak this interface, especially in a // type-unsafe way. void* (*GLES2GetGLES2Interface)(MojoGLES2Context context); - - void (*GLES2SignalSyncPoint)(MojoGLES2Context context, - uint32_t sync_point, - MojoGLES2SignalSyncPointCallback callback, - void* closure); }; #pragma pack(pop) @@ -49,7 +44,6 @@ inline MojoGLES2ControlThunks MojoMakeGLES2ControlThunks() { MojoGLES2MakeCurrent, MojoGLES2SwapBuffers, MojoGLES2GetGLES2Interface, - MojoGLES2SignalSyncPoint, }; return gles2_control_thunks; diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc index 00c92eb..0a7524b 100644 --- a/ppapi/proxy/ppapi_command_buffer_proxy.cc +++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc @@ -236,25 +236,6 @@ int32_t PpapiCommandBufferProxy::GetExtraCommandBufferData() const { return 0; } -uint32_t PpapiCommandBufferProxy::InsertSyncPoint() { - NOTREACHED(); - return 0; -} - -uint32_t PpapiCommandBufferProxy::InsertFutureSyncPoint() { - NOTREACHED(); - return 0; -} - -void PpapiCommandBufferProxy::RetireSyncPoint(uint32_t sync_point) { - NOTREACHED(); -} - -void PpapiCommandBufferProxy::SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) { - NOTREACHED(); -} - void PpapiCommandBufferProxy::SignalQuery(uint32_t query, const base::Closure& callback) { NOTREACHED(); diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h index 8e34506..486e310 100644 --- a/ppapi/proxy/ppapi_command_buffer_proxy.h +++ b/ppapi/proxy/ppapi_command_buffer_proxy.h @@ -62,11 +62,6 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer, size_t height, unsigned internalformat, unsigned usage) override; - uint32_t InsertSyncPoint() override; - uint32_t InsertFutureSyncPoint() override; - void RetireSyncPoint(uint32_t sync_point) override; - void SignalSyncPoint(uint32_t sync_point, - const base::Closure& callback) override; void SignalQuery(uint32_t query, const base::Closure& callback) override; void SetLock(base::Lock*) override; bool IsGpuChannelLost() override; |