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

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

Issue 1279703004: Ozone: HDC should only keep track of planes owned by it’s crtc controllers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments to clarify what test is doing Created 5 years, 4 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
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 5ee481931ff3c6f6626260e922775ba847cb378a..8e98222c22bde0f08c33f6c72358a2894b06d64e 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -139,9 +139,21 @@ bool HardwareDisplayController::MoveCursor(const gfx::Point& location) {
}
void HardwareDisplayController::AddCrtc(scoped_ptr<CrtcController> controller) {
- owned_hardware_planes_.add(
- controller->drm().get(),
- scoped_ptr<HardwareDisplayPlaneList>(new HardwareDisplayPlaneList()));
+ scoped_refptr<DrmDevice> drm = controller->drm();
+ owned_hardware_planes_.add(drm.get(), scoped_ptr<HardwareDisplayPlaneList>(
+ new HardwareDisplayPlaneList()));
+
+ // Check if this controller owns any planes and ensure we keep track of them.
+ const ScopedVector<HardwareDisplayPlane>& all_planes =
+ drm->plane_manager()->planes();
+ HardwareDisplayPlaneList* crtc_plane_list =
+ owned_hardware_planes_.get(drm.get());
+ uint32_t crtc = controller->crtc();
+ for (auto* plane : all_planes) {
+ if (plane->in_use() && (plane->owning_crtc() == crtc))
+ crtc_plane_list->old_plane_list.push_back(plane);
+ }
+
crtc_controllers_.push_back(controller.Pass());
}
@@ -163,8 +175,18 @@ scoped_ptr<CrtcController> HardwareDisplayController::RemoveCrtc(
break;
}
}
- if (!found)
+ if (found) {
+ std::vector<HardwareDisplayPlane*> all_planes;
+ HardwareDisplayPlaneList* plane_list =
+ owned_hardware_planes_.get(drm.get());
+ all_planes.swap(plane_list->old_plane_list);
+ for (auto* plane : all_planes) {
+ if (plane->owning_crtc() != crtc)
+ plane_list->old_plane_list.push_back(plane);
+ }
+ } else {
owned_hardware_planes_.erase(controller->drm().get());
+ }
return controller.Pass();
}
« no previous file with comments | « ui/ozone/platform/drm/gpu/crtc_controller.cc ('k') | ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698