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

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: Track owned planes 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/crtc_controller.cc ('k') | 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 5ee481931ff3c6f6626260e922775ba847cb378a..aba01cd963b18f420b05a397d9e5c622bb6b60bc 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -42,8 +42,22 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary,
TRACE_EVENT0("drm", "HDC::Modeset");
DCHECK(primary.buffer.get());
bool status = true;
- for (size_t i = 0; i < crtc_controllers_.size(); ++i)
- status &= crtc_controllers_[i]->Modeset(primary, mode);
+
+ scoped_refptr<DrmDevice> drm = GetAllocationDrmDevice();
+ HardwareDisplayPlaneList* plane_list = owned_hardware_planes_.get(drm.get());
+ // CRTC controllers owned by this HDC might have changed, refresh the list.
dnicoara 2015/08/18 17:07:52 Since the RemoveCrtc() all updates the list for th
kalyank 2015/08/18 23:15:40 Done.
+ plane_list->old_plane_list.clear();
+
+ HardwareDisplayPlaneManager* manager = drm->plane_manager();
+ const ScopedVector<HardwareDisplayPlane>& all_planes = manager->planes();
+ for (auto* controller : crtc_controllers_) {
+ status &= controller->Modeset(primary, mode);
+ uint32_t crtc = controller->crtc();
+ for (auto* plane : all_planes) {
+ if (plane->in_use() && (plane->owning_crtc() == crtc))
+ plane_list->old_plane_list.push_back(plane);
+ }
+ }
is_disabled_ = false;
mode_ = mode;
@@ -163,8 +177,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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698