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

Side by Side Diff: gpu/ipc/service/gpu_channel.h

Issue 2752393002: gpu: Add SequenceId for identifying sync point sequences. (Closed)
Patch Set: piman's review 3 Created 3 years, 9 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 | « gpu/ipc/in_process_command_buffer.cc ('k') | gpu/ipc/service/gpu_channel.cc » ('j') | 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 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_H_ 5 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_H_
6 #define GPU_IPC_SERVICE_GPU_CHANNEL_H_ 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <unordered_map> 13 #include <unordered_map>
14 14
15 #include "base/containers/hash_tables.h" 15 #include "base/containers/hash_tables.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/process/process.h" 19 #include "base/process/process.h"
20 #include "base/threading/thread_checker.h" 20 #include "base/threading/thread_checker.h"
21 #include "base/trace_event/memory_dump_provider.h" 21 #include "base/trace_event/memory_dump_provider.h"
22 #include "build/build_config.h" 22 #include "build/build_config.h"
23 #include "gpu/command_buffer/service/sync_point_manager.h"
23 #include "gpu/gpu_export.h" 24 #include "gpu/gpu_export.h"
24 #include "gpu/ipc/common/gpu_stream_constants.h" 25 #include "gpu/ipc/common/gpu_stream_constants.h"
25 #include "gpu/ipc/service/gpu_command_buffer_stub.h" 26 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
26 #include "gpu/ipc/service/gpu_memory_manager.h" 27 #include "gpu/ipc/service/gpu_memory_manager.h"
27 #include "ipc/ipc_sender.h" 28 #include "ipc/ipc_sender.h"
28 #include "ipc/ipc_sync_channel.h" 29 #include "ipc/ipc_sync_channel.h"
29 #include "ipc/message_router.h" 30 #include "ipc/message_router.h"
30 #include "ui/gfx/geometry/size.h" 31 #include "ui/gfx/geometry/size.h"
31 #include "ui/gfx/native_widget_types.h" 32 #include "ui/gfx/native_widget_types.h"
32 #include "ui/gl/gl_share_group.h" 33 #include "ui/gl/gl_share_group.h"
33 #include "ui/gl/gpu_preference.h" 34 #include "ui/gl/gpu_preference.h"
34 35
35 struct GPUCreateCommandBufferConfig; 36 struct GPUCreateCommandBufferConfig;
36 37
37 namespace base { 38 namespace base {
38 class WaitableEvent; 39 class WaitableEvent;
39 } 40 }
40 41
41 namespace gpu { 42 namespace gpu {
42 43
43 class PreemptionFlag; 44 class PreemptionFlag;
44 class SyncPointOrderData;
45 class SyncPointManager; 45 class SyncPointManager;
46 class GpuChannelManager; 46 class GpuChannelManager;
47 class GpuChannelMessageFilter; 47 class GpuChannelMessageFilter;
48 class GpuChannelMessageQueue; 48 class GpuChannelMessageQueue;
49 class GpuWatchdogThread; 49 class GpuWatchdogThread;
50 50
51 class GPU_EXPORT FilteredSender : public IPC::Sender { 51 class GPU_EXPORT FilteredSender : public IPC::Sender {
52 public: 52 public:
53 FilteredSender(); 53 FilteredSender();
54 ~FilteredSender() override; 54 ~FilteredSender() override;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // IPC::Listener implementation: 119 // IPC::Listener implementation:
120 bool OnMessageReceived(const IPC::Message& msg) override; 120 bool OnMessageReceived(const IPC::Message& msg) override;
121 void OnChannelConnected(int32_t peer_pid) override; 121 void OnChannelConnected(int32_t peer_pid) override;
122 void OnChannelError() override; 122 void OnChannelError() override;
123 123
124 // FilteredSender implementation: 124 // FilteredSender implementation:
125 bool Send(IPC::Message* msg) override; 125 bool Send(IPC::Message* msg) override;
126 void AddFilter(IPC::MessageFilter* filter) override; 126 void AddFilter(IPC::MessageFilter* filter) override;
127 void RemoveFilter(IPC::MessageFilter* filter) override; 127 void RemoveFilter(IPC::MessageFilter* filter) override;
128 128
129 void OnStreamRescheduled(int32_t stream_id, bool scheduled); 129 void OnCommandBufferScheduled(GpuCommandBufferStub* stub);
130 void OnCommandBufferDescheduled(GpuCommandBufferStub* stub);
130 131
131 gl::GLShareGroup* share_group() const { return share_group_.get(); } 132 gl::GLShareGroup* share_group() const { return share_group_.get(); }
132 133
133 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id); 134 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id);
134 135
135 void LoseAllContexts(); 136 void LoseAllContexts();
136 void MarkAllContextsLost(); 137 void MarkAllContextsLost();
137 138
138 // Called to add a listener for a particular message routing ID. 139 // Called to add a listener for a particular message routing ID.
139 // Returns true if succeeded. 140 // Returns true if succeeded.
140 bool AddRoute(int32_t route_id, int32_t stream_id, IPC::Listener* listener); 141 bool AddRoute(int32_t route_id,
142 SequenceId sequence_id,
143 IPC::Listener* listener);
141 144
142 // Called to remove a listener for a particular message routing ID. 145 // Called to remove a listener for a particular message routing ID.
143 void RemoveRoute(int32_t route_id); 146 void RemoveRoute(int32_t route_id);
144 147
145 void CacheShader(const std::string& key, const std::string& shader); 148 void CacheShader(const std::string& key, const std::string& shader);
146 149
147 uint64_t GetMemoryUsage(); 150 uint64_t GetMemoryUsage();
148 151
149 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( 152 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer(
150 const gfx::GpuMemoryBufferHandle& handle, 153 const gfx::GpuMemoryBufferHandle& handle,
151 const gfx::Size& size, 154 const gfx::Size& size,
152 gfx::BufferFormat format, 155 gfx::BufferFormat format,
153 uint32_t internalformat, 156 uint32_t internalformat,
154 SurfaceHandle surface_handle); 157 SurfaceHandle surface_handle);
155 158
156 GpuChannelMessageFilter* filter() const { return filter_.get(); } 159 GpuChannelMessageFilter* filter() const { return filter_.get(); }
157 160
158 // Returns the global order number for the last processed IPC message.
159 uint32_t GetProcessedOrderNum() const;
160
161 // Returns the global order number for the last unprocessed IPC message.
162 uint32_t GetUnprocessedOrderNum() const;
163
164 // Returns the shared sync point global order data for the stream.
165 scoped_refptr<SyncPointOrderData> GetSyncPointOrderData(
166 int32_t stream_id);
167
168 void PostHandleOutOfOrderMessage(const IPC::Message& message); 161 void PostHandleOutOfOrderMessage(const IPC::Message& message);
169 void PostHandleMessage(const scoped_refptr<GpuChannelMessageQueue>& queue); 162 void PostHandleMessage();
170 163
171 // Synchronously handle the message to make testing convenient. 164 // Synchronously handle the message to make testing convenient.
172 void HandleMessageForTesting(const IPC::Message& msg); 165 void HandleMessageForTesting(const IPC::Message& msg);
173 166
174 #if defined(OS_ANDROID) 167 #if defined(OS_ANDROID)
175 const GpuCommandBufferStub* GetOneStub() const; 168 const GpuCommandBufferStub* GetOneStub() const;
176 #endif 169 #endif
177 170
178 protected: 171 protected:
172 scoped_refptr<GpuChannelMessageQueue> message_queue_;
173
179 // The message filter on the io thread. 174 // The message filter on the io thread.
180 scoped_refptr<GpuChannelMessageFilter> filter_; 175 scoped_refptr<GpuChannelMessageFilter> filter_;
181 176
182 // Map of routing id to command buffer stub. 177 // Map of routing id to command buffer stub.
183 std::unordered_map<int32_t, std::unique_ptr<GpuCommandBufferStub>> stubs_; 178 std::unordered_map<int32_t, std::unique_ptr<GpuCommandBufferStub>> stubs_;
184 179
185 private: 180 private:
186 friend class TestGpuChannel; 181 friend class TestGpuChannel;
187 182
188 bool OnControlMessageReceived(const IPC::Message& msg); 183 bool OnControlMessageReceived(const IPC::Message& msg);
189 184
190 void HandleMessage(const scoped_refptr<GpuChannelMessageQueue>& queue); 185 void HandleMessage();
191 186
192 // Some messages such as WaitForGetOffsetInRange and WaitForTokenInRange are 187 // Some messages such as WaitForGetOffsetInRange and WaitForTokenInRange are
193 // processed as soon as possible because the client is blocked until they 188 // processed as soon as possible because the client is blocked until they
194 // are completed. 189 // are completed.
195 void HandleOutOfOrderMessage(const IPC::Message& msg); 190 void HandleOutOfOrderMessage(const IPC::Message& msg);
196 191
197 void HandleMessageHelper(const IPC::Message& msg); 192 void HandleMessageHelper(const IPC::Message& msg);
198 193
199 scoped_refptr<GpuChannelMessageQueue> CreateStream(
200 int32_t stream_id,
201 GpuStreamPriority stream_priority);
202
203 scoped_refptr<GpuChannelMessageQueue> LookupStream(int32_t stream_id);
204
205 void DestroyStreamIfNecessary(
206 const scoped_refptr<GpuChannelMessageQueue>& queue);
207
208 void AddRouteToStream(int32_t route_id, int32_t stream_id);
209 void RemoveRouteFromStream(int32_t route_id);
210
211 // Message handlers for control messages. 194 // Message handlers for control messages.
212 void OnCreateCommandBuffer(const GPUCreateCommandBufferConfig& init_params, 195 void OnCreateCommandBuffer(const GPUCreateCommandBufferConfig& init_params,
213 int32_t route_id, 196 int32_t route_id,
214 base::SharedMemoryHandle shared_state_shm, 197 base::SharedMemoryHandle shared_state_shm,
215 bool* result, 198 bool* result,
216 gpu::Capabilities* capabilities); 199 gpu::Capabilities* capabilities);
217 void OnDestroyCommandBuffer(int32_t route_id); 200 void OnDestroyCommandBuffer(int32_t route_id);
218 void OnGetDriverBugWorkArounds( 201 void OnGetDriverBugWorkArounds(
219 std::vector<std::string>* gpu_driver_bug_workarounds); 202 std::vector<std::string>* gpu_driver_bug_workarounds);
220 203
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 241 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
259 242
260 // The share group that all contexts associated with a particular renderer 243 // The share group that all contexts associated with a particular renderer
261 // process use. 244 // process use.
262 scoped_refptr<gl::GLShareGroup> share_group_; 245 scoped_refptr<gl::GLShareGroup> share_group_;
263 246
264 scoped_refptr<gles2::MailboxManager> mailbox_manager_; 247 scoped_refptr<gles2::MailboxManager> mailbox_manager_;
265 248
266 GpuWatchdogThread* const watchdog_; 249 GpuWatchdogThread* const watchdog_;
267 250
268 // Map of stream id to appropriate message queue.
269 base::hash_map<int32_t, scoped_refptr<GpuChannelMessageQueue>> streams_;
270
271 // Multimap of stream id to route ids.
272 base::hash_map<int32_t, int> streams_to_num_routes_;
273
274 // Map of route id to stream id;
275 base::hash_map<int32_t, int32_t> routes_to_streams_;
276
277 // Can view command buffers be created on this channel. 251 // Can view command buffers be created on this channel.
278 const bool allow_view_command_buffers_; 252 const bool allow_view_command_buffers_;
279 253
280 // Can real time streams be created on this channel. 254 // Can real time streams be created on this channel.
281 const bool allow_real_time_streams_; 255 const bool allow_real_time_streams_;
282 256
283 base::ProcessId peer_pid_; 257 base::ProcessId peer_pid_;
284 258
285 // Member variables should appear before the WeakPtrFactory, to ensure 259 // Member variables should appear before the WeakPtrFactory, to ensure
286 // that any WeakPtrs to Controller are invalidated before its members 260 // that any WeakPtrs to Controller are invalidated before its members
287 // variable's destructors are executed, rendering them invalid. 261 // variable's destructors are executed, rendering them invalid.
288 base::WeakPtrFactory<GpuChannel> weak_factory_; 262 base::WeakPtrFactory<GpuChannel> weak_factory_;
289 263
290 DISALLOW_COPY_AND_ASSIGN(GpuChannel); 264 DISALLOW_COPY_AND_ASSIGN(GpuChannel);
291 }; 265 };
292 266
293 // This filter does three things: 267 // This filter does three things:
294 // - it counts and timestamps each message forwarded to the channel 268 // - it counts and timestamps each message forwarded to the channel
295 // so that we can preempt other channels if a message takes too long to 269 // so that we can preempt other channels if a message takes too long to
296 // process. To guarantee fairness, we must wait a minimum amount of time 270 // process. To guarantee fairness, we must wait a minimum amount of time
297 // before preempting and we limit the amount of time that we can preempt in 271 // before preempting and we limit the amount of time that we can preempt in
298 // one shot (see constants above). 272 // one shot (see constants above).
299 // - it handles the GpuCommandBufferMsg_InsertSyncPoint message on the IO 273 // - it handles the GpuCommandBufferMsg_InsertSyncPoint message on the IO
300 // thread, generating the sync point ID and responding immediately, and then 274 // thread, generating the sync point ID and responding immediately, and then
301 // posting a task to insert the GpuCommandBufferMsg_RetireSyncPoint message 275 // posting a task to insert the GpuCommandBufferMsg_RetireSyncPoint message
302 // into the channel's queue. 276 // into the channel's queue.
303 // - it generates mailbox names for clients of the GPU process on the IO thread. 277 // - it generates mailbox names for clients of the GPU process on the IO thread.
304 class GPU_EXPORT GpuChannelMessageFilter : public IPC::MessageFilter { 278 class GPU_EXPORT GpuChannelMessageFilter : public IPC::MessageFilter {
305 public: 279 public:
306 GpuChannelMessageFilter(); 280 explicit GpuChannelMessageFilter(
281 scoped_refptr<GpuChannelMessageQueue> message_queue);
307 282
308 // IPC::MessageFilter implementation. 283 // IPC::MessageFilter implementation.
309 void OnFilterAdded(IPC::Channel* channel) override; 284 void OnFilterAdded(IPC::Channel* channel) override;
310 void OnFilterRemoved() override; 285 void OnFilterRemoved() override;
311 void OnChannelConnected(int32_t peer_pid) override; 286 void OnChannelConnected(int32_t peer_pid) override;
312 void OnChannelError() override; 287 void OnChannelError() override;
313 void OnChannelClosing() override; 288 void OnChannelClosing() override;
314 bool OnMessageReceived(const IPC::Message& message) override; 289 bool OnMessageReceived(const IPC::Message& message) override;
315 290
316 void AddChannelFilter(scoped_refptr<IPC::MessageFilter> filter); 291 void AddChannelFilter(scoped_refptr<IPC::MessageFilter> filter);
317 void RemoveChannelFilter(scoped_refptr<IPC::MessageFilter> filter); 292 void RemoveChannelFilter(scoped_refptr<IPC::MessageFilter> filter);
318 293
319 void AddRoute(int32_t route_id,
320 const scoped_refptr<GpuChannelMessageQueue>& queue);
321 void RemoveRoute(int32_t route_id);
322
323 bool Send(IPC::Message* message); 294 bool Send(IPC::Message* message);
324 295
325 protected: 296 protected:
326 ~GpuChannelMessageFilter() override; 297 ~GpuChannelMessageFilter() override;
327 298
328 private: 299 private:
329 scoped_refptr<GpuChannelMessageQueue> LookupStreamByRoute(int32_t route_id);
330
331 bool MessageErrorHandler(const IPC::Message& message, const char* error_msg); 300 bool MessageErrorHandler(const IPC::Message& message, const char* error_msg);
332 301
333 // Map of route id to message queue. 302 scoped_refptr<GpuChannelMessageQueue> message_queue_;
334 base::hash_map<int32_t, scoped_refptr<GpuChannelMessageQueue>> routes_;
335 base::Lock routes_lock_; // Protects |routes_|.
336 303
337 IPC::Channel* channel_; 304 IPC::Channel* channel_;
338 base::ProcessId peer_pid_; 305 base::ProcessId peer_pid_;
339 std::vector<scoped_refptr<IPC::MessageFilter>> channel_filters_; 306 std::vector<scoped_refptr<IPC::MessageFilter>> channel_filters_;
340 307
341 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageFilter); 308 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageFilter);
342 }; 309 };
343 310
344 struct GpuChannelMessage { 311 struct GpuChannelMessage {
345 IPC::Message message; 312 IPC::Message message;
346 uint32_t order_number; 313 uint32_t order_number;
347 base::TimeTicks time_received; 314 base::TimeTicks time_received;
348 315
349 GpuChannelMessage(const IPC::Message& msg, 316 GpuChannelMessage(const IPC::Message& msg,
350 uint32_t order_num, 317 uint32_t order_num,
351 base::TimeTicks ts) 318 base::TimeTicks ts)
352 : message(msg), order_number(order_num), time_received(ts) {} 319 : message(msg), order_number(order_num), time_received(ts) {}
353 320
354 private: 321 private:
355 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessage); 322 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessage);
356 }; 323 };
357 324
358 class GpuChannelMessageQueue 325 class GpuChannelMessageQueue
359 : public base::RefCountedThreadSafe<GpuChannelMessageQueue> { 326 : public base::RefCountedThreadSafe<GpuChannelMessageQueue> {
360 public: 327 public:
361 static scoped_refptr<GpuChannelMessageQueue> Create( 328 static scoped_refptr<GpuChannelMessageQueue> Create(
362 int32_t stream_id,
363 GpuStreamPriority stream_priority,
364 GpuChannel* channel, 329 GpuChannel* channel,
365 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 330 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
366 const scoped_refptr<PreemptionFlag>& preempting_flag, 331 scoped_refptr<PreemptionFlag> preempting_flag,
367 const scoped_refptr<PreemptionFlag>& preempted_flag, 332 scoped_refptr<PreemptionFlag> preempted_flag,
368 SyncPointManager* sync_point_manager); 333 SyncPointManager* sync_point_manager);
369 334
370 void Disable(); 335 void Disable();
371 void DisableIO(); 336 void DisableIO();
372 337
373 int32_t stream_id() const { return stream_id_; } 338 SequenceId sequence_id() const {
374 GpuStreamPriority stream_priority() const { return stream_priority_; } 339 return sync_point_order_data_->sequence_id();
340 }
375 341
376 bool IsScheduled() const; 342 bool IsScheduled() const;
377 void OnRescheduled(bool scheduled); 343 void SetScheduled(bool scheduled);
378 344
379 bool HasQueuedMessages() const; 345 bool HasQueuedMessages() const;
380 346
381 base::TimeTicks GetNextMessageTimeTick() const; 347 base::TimeTicks GetNextMessageTimeTick() const;
382 348
383 scoped_refptr<SyncPointOrderData> GetSyncPointOrderData();
384
385 // Returns the global order number for the last unprocessed IPC message.
386 uint32_t GetUnprocessedOrderNum() const;
387
388 // Returns the global order number for the last unprocessed IPC message.
389 uint32_t GetProcessedOrderNum() const;
390
391 // Should be called before a message begins to be processed. Returns false if 349 // Should be called before a message begins to be processed. Returns false if
392 // there are no messages to process. 350 // there are no messages to process.
393 const GpuChannelMessage* BeginMessageProcessing(); 351 const GpuChannelMessage* BeginMessageProcessing();
394 // Should be called if a message began processing but did not finish. 352 // Should be called if a message began processing but did not finish.
395 void PauseMessageProcessing(); 353 void PauseMessageProcessing();
396 // Should be called if a message is completely processed. Returns true if 354 // Should be called if a message is completely processed. Returns true if
397 // there are more messages to process. 355 // there are more messages to process.
398 void FinishMessageProcessing(); 356 void FinishMessageProcessing();
399 357
400 bool PushBackMessage(const IPC::Message& message); 358 bool PushBackMessage(const IPC::Message& message);
(...skipping 11 matching lines...) Expand all
412 CHECKING, 370 CHECKING,
413 // We are currently preempting (i.e. no stub is descheduled). 371 // We are currently preempting (i.e. no stub is descheduled).
414 PREEMPTING, 372 PREEMPTING,
415 // We would like to preempt, but some stub is descheduled. 373 // We would like to preempt, but some stub is descheduled.
416 WOULD_PREEMPT_DESCHEDULED, 374 WOULD_PREEMPT_DESCHEDULED,
417 }; 375 };
418 376
419 friend class base::RefCountedThreadSafe<GpuChannelMessageQueue>; 377 friend class base::RefCountedThreadSafe<GpuChannelMessageQueue>;
420 378
421 GpuChannelMessageQueue( 379 GpuChannelMessageQueue(
422 int32_t stream_id,
423 GpuStreamPriority stream_priority,
424 GpuChannel* channel, 380 GpuChannel* channel,
425 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 381 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
426 const scoped_refptr<PreemptionFlag>& preempting_flag, 382 scoped_refptr<PreemptionFlag> preempting_flag,
427 const scoped_refptr<PreemptionFlag>& preempted_flag, 383 scoped_refptr<PreemptionFlag> preempted_flag,
428 SyncPointManager* sync_point_manager); 384 SyncPointManager* sync_point_manager);
429 ~GpuChannelMessageQueue(); 385 ~GpuChannelMessageQueue();
430 386
431 void UpdatePreemptionState(); 387 void UpdatePreemptionState();
432 void UpdatePreemptionStateHelper(); 388 void UpdatePreemptionStateHelper();
433 389
434 void UpdateStateIdle(); 390 void UpdateStateIdle();
435 void UpdateStateWaiting(); 391 void UpdateStateWaiting();
436 void UpdateStateChecking(); 392 void UpdateStateChecking();
437 void UpdateStatePreempting(); 393 void UpdateStatePreempting();
438 void UpdateStateWouldPreemptDescheduled(); 394 void UpdateStateWouldPreemptDescheduled();
439 395
440 void TransitionToIdle(); 396 void TransitionToIdle();
441 void TransitionToWaiting(); 397 void TransitionToWaiting();
442 void TransitionToChecking(); 398 void TransitionToChecking();
443 void TransitionToPreempting(); 399 void TransitionToPreempting();
444 void TransitionToWouldPreemptDescheduled(); 400 void TransitionToWouldPreemptDescheduled();
445 401
446 bool ShouldTransitionToIdle() const; 402 bool ShouldTransitionToIdle() const;
447 403
448 const int32_t stream_id_;
449 const GpuStreamPriority stream_priority_;
450
451 // These can be accessed from both IO and main threads and are protected by 404 // These can be accessed from both IO and main threads and are protected by
452 // |channel_lock_|. 405 // |channel_lock_|.
453 bool enabled_; 406 bool enabled_;
454 bool scheduled_; 407 bool scheduled_;
455 GpuChannel* const channel_; 408 GpuChannel* const channel_;
456 std::deque<std::unique_ptr<GpuChannelMessage>> channel_messages_; 409 std::deque<std::unique_ptr<GpuChannelMessage>> channel_messages_;
457 mutable base::Lock channel_lock_; 410 mutable base::Lock channel_lock_;
458 411
459 // The following are accessed on the IO thread only. 412 // The following are accessed on the IO thread only.
460 // No lock is necessary for preemption state because it's only accessed on the 413 // No lock is necessary for preemption state because it's only accessed on the
(...skipping 13 matching lines...) Expand all
474 scoped_refptr<PreemptionFlag> preempting_flag_; 427 scoped_refptr<PreemptionFlag> preempting_flag_;
475 scoped_refptr<PreemptionFlag> preempted_flag_; 428 scoped_refptr<PreemptionFlag> preempted_flag_;
476 SyncPointManager* const sync_point_manager_; 429 SyncPointManager* const sync_point_manager_;
477 430
478 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue); 431 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue);
479 }; 432 };
480 433
481 } // namespace gpu 434 } // namespace gpu
482 435
483 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_ 436 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_
OLDNEW
« no previous file with comments | « gpu/ipc/in_process_command_buffer.cc ('k') | gpu/ipc/service/gpu_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698