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

Unified Diff: ui/gl/async_pixel_transfer_delegate_android.cc

Issue 12208007: gpu: Work around Mali-400 driver bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch. Created 7 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/async_pixel_transfer_delegate_android.cc
diff --git a/ui/gl/async_pixel_transfer_delegate_android.cc b/ui/gl/async_pixel_transfer_delegate_android.cc
index 2f478c35a0e458b0100dac8f5fe5d5449d5d3c6a..af1d44bfefe7801bbf1adaa523a595f06bbd4470 100644
--- a/ui/gl/async_pixel_transfer_delegate_android.cc
+++ b/ui/gl/async_pixel_transfer_delegate_android.cc
@@ -221,20 +221,14 @@ class TransferStateInternal
}
void WaitForLastUpload() {
- if (!wait_for_uploads_)
- return;
-
- // This fence is basically like calling glFinish, which is fine on
- // the upload thread if uploads occur on the CPU. We may want to delay
- // blocking on this fence if this causes any stalls.
-
- TRACE_EVENT0("gpu", "eglWaitSync");
- EGLDisplay display = eglGetCurrentDisplay();
- EGLSyncKHR fence = eglCreateSyncKHR(display, EGL_SYNC_FENCE_KHR, NULL);
- EGLint flags = EGL_SYNC_FLUSH_COMMANDS_BIT_KHR;
- EGLTimeKHR time = EGL_FOREVER_KHR;
- eglClientWaitSyncKHR(display, fence, flags, time);
- eglDestroySyncKHR(display, fence);
+ // This glFinish is just a safe-guard for if uploads have some
+ // GPU action that needs to occur. We could use fences and try
+ // to do this less often. However, on older drivers fences are
+ // not always reliable (eg. Mali-400 just blocks forever).
+ if (wait_for_uploads_) {
+ TRACE_EVENT0("gpu", "glFinish");
+ glFinish();
+ }
}
protected:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698