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

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

Issue 1780013002: Fix black screen when switching primary display without bounds change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build failure in MockScanoutBuffer (again! sorry) Created 4 years, 7 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_buffer.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.h » ('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 3dfc9d6904ed7ad94962ed641fcc200979d9ce6d..ca77b02b10233cb75d21f17eeb0cdedadaeca4a5 100644
--- a/ui/ozone/platform/drm/gpu/drm_window.cc
+++ b/ui/ozone/platform/drm/gpu/drm_window.cc
@@ -123,6 +123,18 @@ void DrmWindow::MoveCursor(const gfx::Point& location) {
void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes,
const SwapCompletionCallback& callback) {
+ if (controller_) {
+ const DrmDevice* drm = controller_->GetAllocationDrmDevice().get();
+ for (const auto& plane : planes) {
+ if (plane.buffer && plane.buffer->GetDrmDevice() != drm) {
+ // Although |force_buffer_reallocation_| is set to true during window
+ // bounds update, this may still be needed because of in-flight buffers.
+ force_buffer_reallocation_ = true;
+ break;
+ }
+ }
+ }
+
if (force_buffer_reallocation_) {
force_buffer_reallocation_ = false;
callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS);
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_buffer.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698