|
Support dynamic switching between integrated and discrete GPUs on Mac OS X.
Change Chrome to allocate most OpenGL contexts with the
kCGLPFAAllowOfflineRenderers flag, and specify
NSSupportsAutomaticGraphicsSwitching in the Info.plist for the main
executable and helper apps. This keeps Chrome on the integrated GPU
except when using WebGL, accelerated 2D Canvas, Pepper 3D, and Core
Animation-based plugins (except Flash).
Chrome shares resources between OpenGL contexts in order to display WebGL
and other content in the compositor, and resource sharing doesn't work
between contexts allocated on different GPUs. Therefore, when the first
context for a given renderer requests the discrete GPU, the channel is
dropped and all contexts are reallocated on the discrete GPU. Similarly,
when the last context requesting the discrete GPU for a given renderer is
shut down, all contexts are dropped and reallocated on the integrated GPU.
Currently dynamic GPU switching is only supported on the latest Mac OS X
10.7 update and MacBook Pros with dual AMD / Intel GPUs, though this will
improve in future OS updates.
Tested with WebGL, CSS 3D, Flash and Unity3D content and observed desired
GPU switching behavior. Also added a layout test to WebKit under
https://bugs.webkit.org/show_bug.cgi?id=69776 which when run in Chrome
catches an assertion failure related to the destruction of contexts. The
intent is to add it as a UI layout test on the GPU bots.
BUG= 88788
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105399
Total comments: 15
Total comments: 12
Total comments: 12
Total comments: 5
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+718 lines, -120 lines) |
Patch |
|
A |
base/memory/scoped_generic_obj.h
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+130 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/app/app-Info.plist
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/app/helper-Info.plist
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
content/browser/renderer_host/accelerated_plugin_view_mac.mm
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+10 lines, -3 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/gpu_channel.h
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+14 lines, -0 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/gpu_channel.cc
|
View
|
1
2
3
4
5
6
7
|
10 chunks |
+55 lines, -0 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/gpu_command_buffer_stub.h
|
View
|
1
2
3
4
5
6
7
|
5 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/gpu_command_buffer_stub.cc
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+10 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/gpu_messages.h
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+17 lines, -0 lines |
0 comments
|
Download
|
|
M |
content/common/sandbox_mac.mm
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+0 lines, -11 lines |
0 comments
|
Download
|
|
M |
content/gpu/gpu_info_collector.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
content/plugin/webplugin_accelerated_surface_proxy_mac.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
content/plugin/webplugin_accelerated_surface_proxy_mac.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/plugin/webplugin_proxy.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
content/plugin/webplugin_proxy.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/gpu/gpu_channel_host.h
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+19 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/gpu/gpu_channel_host.cc
|
View
|
1
2
3
4
5
6
7
|
5 chunks |
+22 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/gpu/renderer_gl_context.h
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+7 lines, -3 lines |
0 comments
|
Download
|
|
M |
content/renderer/gpu/renderer_gl_context.cc
|
View
|
1
2
3
4
5
6
7
|
6 chunks |
+14 lines, -7 lines |
0 comments
|
Download
|
|
M |
content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
|
View
|
1
2
3
4
5
6
7
|
5 chunks |
+40 lines, -8 lines |
0 comments
|
Download
|
|
M |
content/renderer/pepper_platform_context_3d_impl.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
content/renderer/render_widget_fullscreen_pepper.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
gpu/demos/framework/window.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
gpu/gles2_conform_support/egl/display.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
media/tools/shader_bench/shader_bench.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/compositor/compositor_gl.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context.h
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+7 lines, -2 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_cgl.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_cgl.cc
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+45 lines, -5 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_egl.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_egl.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_glx.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_glx.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_linux.cc
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+9 lines, -4 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_mac.cc
|
View
|
1
2
3
4
5
6
7
8
9
|
3 chunks |
+99 lines, -3 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_osmesa.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_osmesa.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_stub.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_stub.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_wgl.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_wgl.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_context_win.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+9 lines, -4 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_share_group.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_share_group.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+10 lines, -2 lines |
0 comments
|
Download
|
|
M |
ui/gfx/gl/gl_surface_cgl.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+20 lines, -13 lines |
0 comments
|
Download
|
|
A |
ui/gfx/gl/gpu_preference.h
|
View
|
1
2
3
4
|
1 chunk |
+25 lines, -0 lines |
0 comments
|
Download
|
|
M |
ui/gfx/surface/accelerated_surface_mac.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+10 lines, -4 lines |
0 comments
|
Download
|
|
M |
ui/gfx/surface/accelerated_surface_mac.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+8 lines, -4 lines |
0 comments
|
Download
|
|
M |
views/widget/native_widget_wayland.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
|
View
|
1
2
3
4
5
6
7
|
11 chunks |
+28 lines, -10 lines |
0 comments
|
Download
|
|
M |
webkit/gpu/webgraphicscontext3d_in_process_impl.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
|
M |
webkit/plugins/npapi/webplugin.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
webkit/plugins/npapi/webplugin.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+13 lines, -1 line |
0 comments
|
Download
|
Total messages: 19 (0 generated)
|