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 /gpu/command_buffer | |
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}
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r-- | gpu/command_buffer/client/client_test_helper.h | 5 | ||||
-rw-r--r-- | gpu/command_buffer/client/context_support.h | 7 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.cc | 25 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.h | 4 | ||||
-rw-r--r-- | gpu/command_buffer/client/gpu_control.h | 17 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 7 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.h | 6 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_mock.h | 2 | ||||
-rw-r--r-- | gpu/command_buffer/service/in_process_command_buffer.cc | 19 | ||||
-rw-r--r-- | gpu/command_buffer/service/in_process_command_buffer.h | 5 | ||||
-rw-r--r-- | gpu/command_buffer/service/sync_point_manager.cc | 65 | ||||
-rw-r--r-- | gpu/command_buffer/service/sync_point_manager.h | 25 | ||||
-rw-r--r-- | gpu/command_buffer/tests/gl_manager.cc | 19 | ||||
-rw-r--r-- | gpu/command_buffer/tests/gl_manager.h | 5 |
14 files changed, 1 insertions, 210 deletions
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; |