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

Unified Diff: gpu/ipc/service/gpu_channel_manager.cc

Issue 2814843002: gpu: GPU service scheduler. (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: gpu/ipc/service/gpu_channel_manager.cc
diff --git a/gpu/ipc/service/gpu_channel_manager.cc b/gpu/ipc/service/gpu_channel_manager.cc
index 14779657bae903d01b2e16b710eb82bc10e8dc53..75638692f116ec6398b74768bb36c9ff8fdaae99 100644
--- a/gpu/ipc/service/gpu_channel_manager.cc
+++ b/gpu/ipc/service/gpu_channel_manager.cc
@@ -20,6 +20,7 @@
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/memory_program_cache.h"
#include "gpu/command_buffer/service/preemption_flag.h"
+#include "gpu/command_buffer/service/scheduler.h"
#include "gpu/command_buffer/service/shader_translator_cache.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
#include "gpu/ipc/common/gpu_messages.h"
@@ -41,7 +42,6 @@ const int kMaxGpuIdleTimeMs = 40;
// draw.
const int kMaxKeepAliveTimeMs = 200;
#endif
-
}
GpuChannelManager::GpuChannelManager(
@@ -50,6 +50,7 @@ GpuChannelManager::GpuChannelManager(
GpuWatchdogThread* watchdog,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+ Scheduler* scheduler,
SyncPointManager* sync_point_manager,
GpuMemoryBufferFactory* gpu_memory_buffer_factory,
const GpuFeatureInfo& gpu_feature_info,
@@ -63,6 +64,7 @@ GpuChannelManager::GpuChannelManager(
share_group_(new gl::GLShareGroup()),
mailbox_manager_(gles2::MailboxManager::Create(gpu_preferences)),
gpu_memory_manager_(this),
+ scheduler_(scheduler),
sync_point_manager_(sync_point_manager),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory),
gpu_feature_info_(gpu_feature_info),
@@ -71,7 +73,7 @@ GpuChannelManager::GpuChannelManager(
weak_factory_(this) {
DCHECK(task_runner);
DCHECK(io_task_runner);
- if (gpu_preferences_.ui_prioritize_in_gpu_process)
+ if (gpu_preferences.ui_prioritize_in_gpu_process)
preemption_flag_ = new PreemptionFlag;
}
@@ -99,8 +101,7 @@ gles2::ProgramCache* GpuChannelManager::program_cache() {
return program_cache_.get();
}
-gles2::ShaderTranslatorCache*
-GpuChannelManager::shader_translator_cache() {
+gles2::ShaderTranslatorCache* GpuChannelManager::shader_translator_cache() {
if (!shader_translator_cache_.get()) {
shader_translator_cache_ =
new gles2::ShaderTranslatorCache(gpu_preferences_);
@@ -111,8 +112,7 @@ GpuChannelManager::shader_translator_cache() {
gles2::FramebufferCompletenessCache*
GpuChannelManager::framebuffer_completeness_cache() {
if (!framebuffer_completeness_cache_.get())
- framebuffer_completeness_cache_ =
- new gles2::FramebufferCompletenessCache;
+ framebuffer_completeness_cache_ = new gles2::FramebufferCompletenessCache;
return framebuffer_completeness_cache_.get();
}
@@ -130,8 +130,8 @@ GpuChannel* GpuChannelManager::EstablishChannel(int client_id,
uint64_t client_tracing_id,
bool is_gpu_host) {
std::unique_ptr<GpuChannel> gpu_channel = base::MakeUnique<GpuChannel>(
- this, sync_point_manager_, watchdog_, share_group_, mailbox_manager_,
- is_gpu_host ? preemption_flag_ : nullptr,
+ this, scheduler_, sync_point_manager_, watchdog_, share_group_,
+ mailbox_manager_, is_gpu_host ? preemption_flag_ : nullptr,
is_gpu_host ? nullptr : preemption_flag_, task_runner_, io_task_runner_,
client_id, client_tracing_id, is_gpu_host);
@@ -155,10 +155,9 @@ void GpuChannelManager::InternalDestroyGpuMemoryBufferOnIO(
gpu_memory_buffer_factory_->DestroyGpuMemoryBuffer(id, client_id);
}
-void GpuChannelManager::DestroyGpuMemoryBuffer(
- gfx::GpuMemoryBufferId id,
- int client_id,
- const SyncToken& sync_token) {
+void GpuChannelManager::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
+ int client_id,
+ const SyncToken& sync_token) {
if (!sync_point_manager_->WaitOutOfOrder(
sync_token,
base::Bind(&GpuChannelManager::InternalDestroyGpuMemoryBuffer,
@@ -217,8 +216,8 @@ void GpuChannelManager::WakeUpGpu() {
void GpuChannelManager::ScheduleWakeUpGpu() {
base::TimeTicks now = base::TimeTicks::Now();
- TRACE_EVENT2("gpu", "GpuChannelManager::ScheduleWakeUp",
- "idle_time", (now - last_gpu_access_time_).InMilliseconds(),
+ TRACE_EVENT2("gpu", "GpuChannelManager::ScheduleWakeUp", "idle_time",
+ (now - last_gpu_access_time_).InMilliseconds(),
"keep_awake_time", (now - begin_wake_up_time_).InMilliseconds());
if (now - last_gpu_access_time_ <
base::TimeDelta::FromMilliseconds(kMaxGpuIdleTimeMs))

Powered by Google App Engine
This is Rietveld 408576698