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

Side by Side Diff: gpu/command_buffer/service/sync_point_manager.cc

Issue 1972443002: Insert CHECK to look for abnormal flushes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use UINT64_MAX instead (Does not change code, see try jobs from patch #1). Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/sync_point_manager.h" 5 #include "gpu/command_buffer/service/sync_point_manager.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 closure.Run(); 248 closure.Run();
249 } 249 }
250 } 250 }
251 251
252 void SyncPointClientState::ReleaseFenceSyncLocked( 252 void SyncPointClientState::ReleaseFenceSyncLocked(
253 uint64_t release, 253 uint64_t release,
254 std::vector<base::Closure>* callback_list) { 254 std::vector<base::Closure>* callback_list) {
255 fence_sync_lock_.AssertAcquired(); 255 fence_sync_lock_.AssertAcquired();
256 DCHECK_GT(release, fence_sync_release_); 256 DCHECK_GT(release, fence_sync_release_);
257 257
258 // TODO(dyen): https://www.crbug.com/606112 - Hack in a DCHECK which should be
259 // fine under normal circumstances. Under normal usage, this would only
260 // trigger if flushes are arriving out of order.
261 DCHECK(release == fence_sync_release_ + 1 || release == UINT64_MAX);
piman 2016/05/11 01:24:11 nit: make it a CHECK if you want to catch release
David Yen 2016/05/11 17:27:27 Done.
258 fence_sync_release_ = release; 262 fence_sync_release_ = release;
259 while (!release_callback_queue_.empty() && 263 while (!release_callback_queue_.empty() &&
260 release_callback_queue_.top().release_count <= release) { 264 release_callback_queue_.top().release_count <= release) {
261 callback_list->push_back(release_callback_queue_.top().callback_closure); 265 callback_list->push_back(release_callback_queue_.top().callback_closure);
262 release_callback_queue_.pop(); 266 release_callback_queue_.pop();
263 } 267 }
264 } 268 }
265 269
266 void SyncPointClientState::SetOnWaitCallback(const OnWaitCallback& callback) { 270 void SyncPointClientState::SetOnWaitCallback(const OnWaitCallback& callback) {
267 on_wait_callback_ = callback; 271 on_wait_callback_ = callback;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); 423 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_));
420 424
421 base::AutoLock auto_lock(client_maps_lock_); 425 base::AutoLock auto_lock(client_maps_lock_);
422 ClientMap& client_map = client_maps_[namespace_id]; 426 ClientMap& client_map = client_maps_[namespace_id];
423 ClientMap::iterator it = client_map.find(client_id); 427 ClientMap::iterator it = client_map.find(client_id);
424 DCHECK(it != client_map.end()); 428 DCHECK(it != client_map.end());
425 client_map.erase(it); 429 client_map.erase(it);
426 } 430 }
427 431
428 } // namespace gpu 432 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698