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

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

Issue 2693043006: ozone: Fix HardwareDisplayController::AddCrtc. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | 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/hardware_display_controller.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
index ec411f4fcad5aafdf1cd1423556d0a26b377caf9..82c927d97eae0dc3d9b875d06a233ed2865545a7 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -202,14 +202,16 @@ bool HardwareDisplayController::MoveCursor(const gfx::Point& location) {
void HardwareDisplayController::AddCrtc(
std::unique_ptr<CrtcController> controller) {
scoped_refptr<DrmDevice> drm = controller->drm();
- owned_hardware_planes_[drm.get()] =
- base::MakeUnique<HardwareDisplayPlaneList>();
+
+ std::unique_ptr<HardwareDisplayPlaneList>& owned_planes =
+ owned_hardware_planes_[drm.get()];
+ if (!owned_planes)
+ owned_planes.reset(new HardwareDisplayPlaneList());
// Check if this controller owns any planes and ensure we keep track of them.
const std::vector<std::unique_ptr<HardwareDisplayPlane>>& all_planes =
drm->plane_manager()->planes();
- HardwareDisplayPlaneList* crtc_plane_list =
- owned_hardware_planes_[drm.get()].get();
+ HardwareDisplayPlaneList* crtc_plane_list = owned_planes.get();
uint32_t crtc = controller->crtc();
for (const auto& plane : all_planes) {
if (plane->in_use() && (plane->owning_crtc() == crtc))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698