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

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

Issue 2440093003: WIP GPU scheduler + delayed activation / tile draw
Patch Set: SignalSyncToken -> IsFenceSyncReleased Created 4 years 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
« no previous file with comments | « gpu/ipc/service/gpu_channel_manager.h ('k') | gpu/ipc/service/gpu_channel_test_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34f2be4a1cc5821e563a64701cd52f22328f9a4a..2dc47ab0b64ccdae59ffcc840a8b2c74311d6ffe 100644
--- a/gpu/ipc/service/gpu_channel_manager.cc
+++ b/gpu/ipc/service/gpu_channel_manager.cc
@@ -25,6 +25,7 @@
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
#include "gpu/ipc/service/gpu_memory_buffer_factory.h"
#include "gpu/ipc/service/gpu_memory_manager.h"
+#include "gpu/ipc/service/gpu_scheduler.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_share_group.h"
#include "ui/gl/init/gl_factory.h"
@@ -39,7 +40,6 @@ const int kMaxGpuIdleTimeMs = 40;
// draw.
const int kMaxKeepAliveTimeMs = 200;
#endif
-
}
GpuChannelManager::GpuChannelManager(
@@ -69,8 +69,11 @@ GpuChannelManager::GpuChannelManager(
weak_factory_(this) {
DCHECK(task_runner);
DCHECK(io_task_runner);
- if (gpu_preferences_.ui_prioritize_in_gpu_process)
+ if (gpu_preferences.enable_gpu_scheduler) {
+ scheduler_ = GpuScheduler::Create(task_runner);
+ } else if (gpu_preferences.ui_prioritize_in_gpu_process) {
preemption_flag_ = new PreemptionFlag;
+ }
}
GpuChannelManager::~GpuChannelManager() {
@@ -96,8 +99,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_);
@@ -108,8 +110,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,11 +131,11 @@ std::unique_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel(
bool allow_view_command_buffers,
bool allow_real_time_streams) {
return base::MakeUnique<GpuChannel>(
- this, sync_point_manager(), watchdog_, share_group(), mailbox_manager(),
- preempts ? preemption_flag() : nullptr,
- preempts ? nullptr : preemption_flag(), task_runner_.get(),
- io_task_runner_.get(), client_id, client_tracing_id,
- allow_view_command_buffers, allow_real_time_streams);
+ this, sync_point_manager_, watchdog_, scheduler_.get(), share_group_,
+ mailbox_manager_, preempts ? preemption_flag_ : nullptr,
+ preempts ? nullptr : preemption_flag_, task_runner_, io_task_runner_,
+ client_id, client_tracing_id, allow_view_command_buffers,
+ allow_real_time_streams);
}
IPC::ChannelHandle GpuChannelManager::EstablishChannel(
@@ -166,10 +167,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_token.HasData()) {
scoped_refptr<SyncPointClientState> release_state =
sync_point_manager()->GetSyncPointClientState(
@@ -254,8 +254,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))
« no previous file with comments | « gpu/ipc/service/gpu_channel_manager.h ('k') | gpu/ipc/service/gpu_channel_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698