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

Side by Side 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: Add DrmDevice check in ScreenManager::GetModesetBuffer 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/gpu/drm_window.h" 5 #include "ui/ozone/platform/drm/gpu/drm_window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 void DrmWindow::MoveCursor(const gfx::Point& location) { 117 void DrmWindow::MoveCursor(const gfx::Point& location) {
118 cursor_location_ = location; 118 cursor_location_ = location;
119 119
120 if (controller_) 120 if (controller_)
121 controller_->MoveCursor(location); 121 controller_->MoveCursor(location);
122 } 122 }
123 123
124 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes, 124 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes,
125 const SwapCompletionCallback& callback) { 125 const SwapCompletionCallback& callback) {
126 if (controller_) {
127 const DrmDevice* drm = controller_->GetAllocationDrmDevice().get();
128 for (const auto& plane : planes) {
129 if (plane.buffer && plane.buffer->GetDrmDevice() != drm) {
dnicoara 2016/05/06 19:17:21 If I understood this correctly this is only requir
hshi 2016/05/06 19:22:31 Done.
130 force_buffer_reallocation_ = true;
131 break;
132 }
133 }
134 }
135
126 if (force_buffer_reallocation_) { 136 if (force_buffer_reallocation_) {
127 force_buffer_reallocation_ = false; 137 force_buffer_reallocation_ = false;
128 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS); 138 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS);
129 return; 139 return;
130 } 140 }
131 141
132 last_submitted_planes_ = 142 last_submitted_planes_ =
133 overlay_validator_->PrepareBuffersForPageFlip(planes); 143 overlay_validator_->PrepareBuffersForPageFlip(planes);
134 144
135 if (!controller_) { 145 if (!controller_) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (!cursor_buffers_[i]->Initialize( 249 if (!cursor_buffers_[i]->Initialize(
240 info, false /* should_register_framebuffer */)) { 250 info, false /* should_register_framebuffer */)) {
241 LOG(FATAL) << "Failed to initialize cursor buffer"; 251 LOG(FATAL) << "Failed to initialize cursor buffer";
242 return; 252 return;
243 } 253 }
244 } 254 }
245 } 255 }
246 } 256 }
247 257
248 } // namespace ui 258 } // namespace ui
OLDNEW
« 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