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

Side by Side Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2814843002: gpu: GPU service scheduler. (Closed)
Patch Set: rebase Created 3 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
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/ipc/service/gpu_command_buffer_stub.h" 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 13 matching lines...) Expand all
24 #include "gpu/command_buffer/common/sync_token.h" 24 #include "gpu/command_buffer/common/sync_token.h"
25 #include "gpu/command_buffer/service/command_executor.h" 25 #include "gpu/command_buffer/service/command_executor.h"
26 #include "gpu/command_buffer/service/gl_context_virtual.h" 26 #include "gpu/command_buffer/service/gl_context_virtual.h"
27 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" 27 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
28 #include "gpu/command_buffer/service/image_manager.h" 28 #include "gpu/command_buffer/service/image_manager.h"
29 #include "gpu/command_buffer/service/logger.h" 29 #include "gpu/command_buffer/service/logger.h"
30 #include "gpu/command_buffer/service/mailbox_manager.h" 30 #include "gpu/command_buffer/service/mailbox_manager.h"
31 #include "gpu/command_buffer/service/memory_tracking.h" 31 #include "gpu/command_buffer/service/memory_tracking.h"
32 #include "gpu/command_buffer/service/preemption_flag.h" 32 #include "gpu/command_buffer/service/preemption_flag.h"
33 #include "gpu/command_buffer/service/query_manager.h" 33 #include "gpu/command_buffer/service/query_manager.h"
34 #include "gpu/command_buffer/service/scheduler.h"
34 #include "gpu/command_buffer/service/service_utils.h" 35 #include "gpu/command_buffer/service/service_utils.h"
35 #include "gpu/command_buffer/service/sync_point_manager.h" 36 #include "gpu/command_buffer/service/sync_point_manager.h"
36 #include "gpu/command_buffer/service/transfer_buffer_manager.h" 37 #include "gpu/command_buffer/service/transfer_buffer_manager.h"
37 #include "gpu/ipc/common/gpu_messages.h" 38 #include "gpu/ipc/common/gpu_messages.h"
38 #include "gpu/ipc/service/gpu_channel.h" 39 #include "gpu/ipc/service/gpu_channel.h"
39 #include "gpu/ipc/service/gpu_channel_manager.h" 40 #include "gpu/ipc/service/gpu_channel_manager.h"
40 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" 41 #include "gpu/ipc/service/gpu_channel_manager_delegate.h"
41 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" 42 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
42 #include "gpu/ipc/service/gpu_memory_manager.h" 43 #include "gpu/ipc/service/gpu_memory_manager.h"
43 #include "gpu/ipc/service/gpu_memory_tracking.h" 44 #include "gpu/ipc/service/gpu_memory_tracking.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 new CommandBufferService(context_group_->transfer_buffer_manager())); 646 new CommandBufferService(context_group_->transfer_buffer_manager()));
646 647
647 decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get())); 648 decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get()));
648 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), 649 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(),
649 decoder_.get())); 650 decoder_.get()));
650 651
651 sync_point_client_state_ = 652 sync_point_client_state_ =
652 channel_->sync_point_manager()->CreateSyncPointClientState( 653 channel_->sync_point_manager()->CreateSyncPointClientState(
653 CommandBufferNamespace::GPU_IO, command_buffer_id_, sequence_id_); 654 CommandBufferNamespace::GPU_IO, command_buffer_id_, sequence_id_);
654 655
655 // TODO(sunnyps): Hook callback to gpu scheduler. 656 if (channel_->scheduler()) {
656 if (channel_->preempted_flag()) { 657 executor_->SetPauseExecutionCallback(
658 base::Bind(&Scheduler::ShouldYield,
659 base::Unretained(channel_->scheduler()), sequence_id_));
660 } else if (channel_->preempted_flag()) {
657 executor_->SetPauseExecutionCallback( 661 executor_->SetPauseExecutionCallback(
658 base::Bind(&PreemptionFlag::IsSet, channel_->preempted_flag())); 662 base::Bind(&PreemptionFlag::IsSet, channel_->preempted_flag()));
659 } 663 }
660 664
661 decoder_->set_engine(executor_.get()); 665 decoder_->set_engine(executor_.get());
662 666
663 if (offscreen) { 667 if (offscreen) {
664 // Do we want to create an offscreen rendering context suitable 668 // Do we want to create an offscreen rendering context suitable
665 // for directly drawing to a separately supplied surface? In that 669 // for directly drawing to a separately supplied surface? In that
666 // case, we must ensure that the surface used for context creation 670 // case, we must ensure that the surface used for context creation
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 command_buffer_->GetLastState().error == error::kLostContext) 1242 command_buffer_->GetLastState().error == error::kLostContext)
1239 return; 1243 return;
1240 1244
1241 command_buffer_->SetContextLostReason(error::kUnknown); 1245 command_buffer_->SetContextLostReason(error::kUnknown);
1242 if (decoder_) 1246 if (decoder_)
1243 decoder_->MarkContextLost(error::kUnknown); 1247 decoder_->MarkContextLost(error::kUnknown);
1244 command_buffer_->SetParseError(error::kLostContext); 1248 command_buffer_->SetParseError(error::kLostContext);
1245 } 1249 }
1246 1250
1247 } // namespace gpu 1251 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698