OLD | NEW |
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/screen_manager.h" | 5 #include "ui/ozone/platform/drm/gpu/screen_manager.h" |
6 | 6 |
7 #include <xf86drmMode.h> | 7 #include <xf86drmMode.h> |
8 | 8 |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "ui/gfx/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 uint32_t crtc) { | 175 uint32_t crtc) { |
176 HardwareDisplayControllers::iterator it = FindDisplayController(drm, crtc); | 176 HardwareDisplayControllers::iterator it = FindDisplayController(drm, crtc); |
177 if (it != controllers_.end()) { | 177 if (it != controllers_.end()) { |
178 HardwareDisplayController* controller = *it; | 178 HardwareDisplayController* controller = *it; |
179 if (controller->IsMirrored()) { | 179 if (controller->IsMirrored()) { |
180 controller = new HardwareDisplayController( | 180 controller = new HardwareDisplayController( |
181 controller->RemoveCrtc(drm, crtc), controller->origin()); | 181 controller->RemoveCrtc(drm, crtc), controller->origin()); |
182 controllers_.push_back(controller); | 182 controllers_.push_back(controller); |
183 } | 183 } |
184 | 184 |
185 if (!controller->IsDisabled()) { | |
186 // Workaround for driver bug that does not release the buffer on null | |
187 // modeset. | |
188 ModesetDisplayController(controller, controller->origin(), | |
189 controller->get_mode(), false); | |
190 } | |
191 | |
192 controller->Disable(); | 185 controller->Disable(); |
193 UpdateControllerToWindowMapping(); | 186 UpdateControllerToWindowMapping(); |
194 return true; | 187 return true; |
195 } | 188 } |
196 | 189 |
197 LOG(ERROR) << "Failed to find display controller crtc=" << crtc; | 190 LOG(ERROR) << "Failed to find display controller crtc=" << crtc; |
198 return false; | 191 return false; |
199 } | 192 } |
200 | 193 |
201 HardwareDisplayController* ScreenManager::GetDisplayController( | 194 HardwareDisplayController* ScreenManager::GetDisplayController( |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { | 348 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { |
356 for (auto pair : window_map_) { | 349 for (auto pair : window_map_) { |
357 if (pair.second->bounds() == bounds) | 350 if (pair.second->bounds() == bounds) |
358 return pair.second; | 351 return pair.second; |
359 } | 352 } |
360 | 353 |
361 return nullptr; | 354 return nullptr; |
362 } | 355 } |
363 | 356 |
364 } // namespace ui | 357 } // namespace ui |
OLD | NEW |