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

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

Issue 1370233003: Disable region copy on ARM since it isn't supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2454
Patch Set: Created 5 years, 3 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/drm_window.h ('k') | ui/ozone/platform/drm/gpu/drm_window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/drm_window.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_window.cc b/ui/ozone/platform/drm/gpu/drm_window.cc
index 3dda06cd307395763a54f9b96b38705affbeab7a..f1dcbfae9133bc8a19886867259c7b6eaa91559f 100644
--- a/ui/ozone/platform/drm/gpu/drm_window.cc
+++ b/ui/ozone/platform/drm/gpu/drm_window.cc
@@ -126,6 +126,15 @@ void DrmWindow::QueueOverlayPlane(const OverlayPlane& plane) {
bool DrmWindow::SchedulePageFlip(bool is_sync,
const SwapCompletionCallback& callback) {
+ if (force_buffer_reallocation_) {
+ // Clear pending planes otherwise the next call to queue planes will just
+ // add on top.
+ pending_planes_.clear();
+ force_buffer_reallocation_ = false;
+ callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS);
+ return true;
+ }
+
last_submitted_planes_.clear();
last_submitted_planes_.swap(pending_planes_);
last_swap_sync_ = is_sync;
@@ -204,6 +213,12 @@ void DrmWindow::SetController(HardwareDisplayController* controller) {
if (controller_ == controller)
return;
+ // Force buffer reallocation since the window moved to a different controller.
+ // This is required otherwise the GPU will eventually try to render into the
+ // buffer currently showing on the old controller (there is no guarantee that
+ // the old controller has been updated in the meantime).
+ force_buffer_reallocation_ = true;
+
controller_ = controller;
device_manager_->UpdateDrmDevice(
widget_, controller ? controller->GetAllocationDrmDevice() : nullptr);
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window.h ('k') | ui/ozone/platform/drm/gpu/drm_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698