summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-18 00:25:04 +0000
committerepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-18 00:25:04 +0000
commitcafa295eb0c24cd3d8b5518bfe3d83544552888a (patch)
treea38ce1c2f6e6ea04335d37211571b200723bae9d /gpu
parent1270ea67ad7abc29d7ac452b41e14cb1656b7f5d (diff)
downloadchromium_src-cafa295eb0c24cd3d8b5518bfe3d83544552888a.zip
chromium_src-cafa295eb0c24cd3d8b5518bfe3d83544552888a.tar.gz
chromium_src-cafa295eb0c24cd3d8b5518bfe3d83544552888a.tar.bz2
gpu: Fix Vivante's "hisilicon" GPUs
This fixes "Hisilicon" GPUs, which is an instance of a Vivante's GPU design. This involves enabling virtual contexts, since they don't support share-groups, and further adds a work-around for switching surfaces. Without the work- around the view surface "inherits" the size of the last bound surface (which for Chrome tends to be a 1x1 pbuffer) resulting in a black screen. The following steps "repair" the view surface every time it is made current: - Make it current. - Bind the default frame-buffer. - Make it not current. - Destroy/recreate it from the native handle. - Make it current again. NOTE: The "Recreate" function is added to surface because the Destroy/Initialize may be intercepted or modified by wrapper surface classes. Recreate is similar to resize, which after being forwarded by a wrapper can call Destroy/Initialize on the 'real' surface. BUG=179250, 229643 NOTRY=true No try, since it's Android only and already tested. Review URL: https://chromiumcodereview.appspot.com/13140006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/feature_info.cc5
-rw-r--r--gpu/command_buffer/service/gpu_driver_bug_workaround_type.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index d9df6f6..aad133e 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -191,6 +191,7 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
bool is_qualcomm = false;
bool is_imagination = false;
bool is_arm = false;
+ bool is_hisilicon = false;
const char* gl_strings[2];
gl_strings[0] = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
gl_strings[1] = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
@@ -208,6 +209,7 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
is_qualcomm |= string_set.Contains("qualcomm");
is_imagination |= string_set.Contains("imagination");
is_arm |= string_set.Contains("arm");
+ is_hisilicon |= string_set.Contains("hisilicon");
}
}
@@ -221,6 +223,9 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
workarounds_.flush_on_context_switch = true;
workarounds_.delete_instead_of_resize_fbo = true;
}
+ if (is_hisilicon) {
+ workarounds_.makecurrent_recreates_surfaces = true;
+ }
#if defined(OS_MACOSX)
workarounds_.needs_offscreen_buffer_workaround = is_nvidia;
workarounds_.needs_glsl_built_in_function_emulation = is_amd;
diff --git a/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h b/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h
index 0478b28..fa71504 100644
--- a/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h
+++ b/gpu/command_buffer/service/gpu_driver_bug_workaround_type.h
@@ -28,6 +28,8 @@
exit_on_context_lost) \
GPU_OP(FLUSH_ON_CONTEXT_SWITCH, \
flush_on_context_switch) \
+ GPU_OP(MAKECURRENT_RECREATES_SURFACES, \
+ makecurrent_recreates_surfaces) \
GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024, \
max_cube_map_texture_size_limit_1024) \
GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096, \