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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_surfaceless.cc

Issue 2858693002: ozone: Wait on EGLFence before committing buffers. Avoid using GL. (Closed)
Patch Set: Rebase on master. 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surfaceless.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc b/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
index b436a7b2871433ad8d3bce905e3b7fc7252c5811..722de976b72684a39248b0e149258c3f0d5b33b2 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
@@ -37,8 +37,6 @@ GbmSurfaceless::GbmSurfaceless(GbmSurfaceFactory* surface_factory,
widget_(widget),
has_implicit_external_sync_(
HasEGLExtension("EGL_ARM_implicit_external_sync")),
- has_image_flush_external_(
- HasEGLExtension("EGL_EXT_image_flush_external")),
marcheu 2017/05/02 21:10:14 hmm, note that we need this to happen somehow... B
Daniele Castagna 2017/05/02 21:23:31 This happens per image. Look at GLImageNativePixma
weak_factory_(this) {
surface_factory_->RegisterSurface(window_->widget(), this);
unsubmitted_frames_.push_back(base::MakeUnique<PendingFrame>());
@@ -105,7 +103,6 @@ void GbmSurfaceless::SwapBuffersAsync(const SwapCompletionCallback& callback) {
return;
}
- glFlush();
unsubmitted_frames_.back()->Flush();
SwapCompletionCallback surface_swap_callback = base::Bind(
@@ -117,31 +114,25 @@ void GbmSurfaceless::SwapBuffersAsync(const SwapCompletionCallback& callback) {
// TODO: the following should be replaced by a per surface flush as it gets
// implemented in GL drivers.
- if (has_implicit_external_sync_ || has_image_flush_external_) {
- EGLSyncKHR fence = InsertFence(has_implicit_external_sync_);
- if (!fence) {
- callback.Run(gfx::SwapResult::SWAP_FAILED);
- return;
- }
-
- base::Closure fence_wait_task =
- base::Bind(&WaitForFence, GetDisplay(), fence);
+ EGLSyncKHR fence = InsertFence(has_implicit_external_sync_);
+ if (!fence) {
+ callback.Run(gfx::SwapResult::SWAP_FAILED);
+ return;
+ }
- base::Closure fence_retired_callback =
- base::Bind(&GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(),
- fence, frame);
+ base::Closure fence_wait_task =
+ base::Bind(&WaitForFence, GetDisplay(), fence);
- base::PostTaskWithTraitsAndReply(
- FROM_HERE, base::TaskTraits()
- .WithShutdownBehavior(
- base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
- .MayBlock(),
- fence_wait_task, fence_retired_callback);
- return; // Defer frame submission until fence signals.
- }
+ base::Closure fence_retired_callback = base::Bind(
+ &GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(), fence, frame);
- frame->ready = true;
- SubmitFrame();
+ base::PostTaskWithTraitsAndReply(
+ FROM_HERE,
+ base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .MayBlock(),
+ fence_wait_task, fence_retired_callback);
}
void GbmSurfaceless::PostSubBufferAsync(
@@ -213,9 +204,6 @@ void GbmSurfaceless::SubmitFrame() {
return;
}
- if (IsUniversalDisplayLinkDevice())
- glFinish();
-
window_->SchedulePageFlip(planes_, frame->callback);
planes_.clear();
}
@@ -247,8 +235,4 @@ void GbmSurfaceless::SwapCompleted(const SwapCompletionCallback& callback,
SubmitFrame();
}
-bool GbmSurfaceless::IsUniversalDisplayLinkDevice() {
- return planes_.empty() ? false : planes_[0].buffer->RequiresGlFinish();
-}
-
} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surfaceless.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698