| OLD | NEW |
| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // Already released, run the callback now. | 225 // Already released, run the callback now. |
| 226 callback.Run(); | 226 callback.Run(); |
| 227 return true; | 227 return true; |
| 228 } | 228 } |
| 229 | 229 |
| 230 void SyncPointClientState::ReleaseFenceSync(uint64_t release) { | 230 void SyncPointClientState::ReleaseFenceSync(uint64_t release) { |
| 231 // Call callbacks without the lock to avoid possible deadlocks. | 231 // Call callbacks without the lock to avoid possible deadlocks. |
| 232 std::vector<base::Closure> callback_list; | 232 std::vector<base::Closure> callback_list; |
| 233 { | 233 { |
| 234 base::AutoLock auto_lock(fence_sync_lock_); | 234 base::AutoLock auto_lock(fence_sync_lock_); |
| 235 DCHECK_GT(release, fence_sync_release_); | 235 DLOG_IF(ERROR, release <= fence_sync_release_) |
| 236 << "Client submitted fence releases out of order."; |
| 236 | 237 |
| 237 fence_sync_release_ = release; | 238 fence_sync_release_ = release; |
| 238 while (!release_callback_queue_.empty() && | 239 while (!release_callback_queue_.empty() && |
| 239 release_callback_queue_.top().release_count <= release) { | 240 release_callback_queue_.top().release_count <= release) { |
| 240 callback_list.push_back(release_callback_queue_.top().callback_closure); | 241 callback_list.push_back(release_callback_queue_.top().callback_closure); |
| 241 release_callback_queue_.pop(); | 242 release_callback_queue_.pop(); |
| 242 } | 243 } |
| 243 } | 244 } |
| 244 | 245 |
| 245 for (const base::Closure& closure : callback_list) { | 246 for (const base::Closure& closure : callback_list) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); | 442 DCHECK_LT(static_cast<size_t>(namespace_id), arraysize(client_maps_)); |
| 442 | 443 |
| 443 base::AutoLock auto_lock(client_maps_lock_); | 444 base::AutoLock auto_lock(client_maps_lock_); |
| 444 ClientMap& client_map = client_maps_[namespace_id]; | 445 ClientMap& client_map = client_maps_[namespace_id]; |
| 445 ClientMap::iterator it = client_map.find(client_id); | 446 ClientMap::iterator it = client_map.find(client_id); |
| 446 DCHECK(it != client_map.end()); | 447 DCHECK(it != client_map.end()); |
| 447 client_map.erase(it); | 448 client_map.erase(it); |
| 448 } | 449 } |
| 449 | 450 |
| 450 } // namespace gpu | 451 } // namespace gpu |
| OLD | NEW |