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

Unified Diff: ui/ozone/platform/dri/hardware_display_plane_manager_legacy.cc

Issue 812913003: ozone: fix HDPMLegacy - do the PF after overlays, also clear old overlays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/dri/hardware_display_plane_manager.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/dri/hardware_display_plane_manager_legacy.cc
diff --git a/ui/ozone/platform/dri/hardware_display_plane_manager_legacy.cc b/ui/ozone/platform/dri/hardware_display_plane_manager_legacy.cc
index efa47b684432b812ff6a38fea85942c041fbd3db..9b385bb5613998d27df00e7bb4f60cf6dff11927 100644
--- a/ui/ozone/platform/dri/hardware_display_plane_manager_legacy.cc
+++ b/ui/ozone/platform/dri/hardware_display_plane_manager_legacy.cc
@@ -22,10 +22,19 @@ bool HardwareDisplayPlaneManagerLegacy::Commit(
if (plane_list->plane_list.empty()) // No assigned planes, nothing to do.
return true;
bool ret = true;
- plane_list->plane_list.swap(plane_list->old_plane_list);
- plane_list->plane_list.clear();
for (const auto& flip : plane_list->legacy_page_flips) {
dnicoara 2015/01/16 21:40:08 Add a comment before the for-loop mentioning why t
achaulk 2015/01/21 21:50:53 Done.
// Permission Denied is a legitimate error
+ for (const auto& plane : flip.planes) {
+ if (!drm_->PageFlipOverlay(flip.crtc_id, plane.framebuffer, plane.bounds,
+ plane.src_rect, plane.plane)) {
+ LOG(ERROR) << "Cannot display plane on overlay: error="
+ << strerror(errno) << "crtc=" << flip.crtc
+ << " plane=" << plane.plane;
+ ret = false;
+ flip.crtc->PageFlipFailed();
+ break;
+ }
+ }
if (!drm_->PageFlip(flip.crtc_id, flip.framebuffer,
base::Bind(&CrtcController::OnPageFlipEvent,
flip.crtc->AsWeakPtr()))) {
@@ -37,20 +46,28 @@ bool HardwareDisplayPlaneManagerLegacy::Commit(
ret = false;
}
flip.crtc->PageFlipFailed();
- } else {
- for (const auto& plane : flip.planes) {
- if (!drm_->PageFlipOverlay(flip.crtc_id, plane.framebuffer,
- plane.bounds, plane.src_rect, plane.plane)) {
- LOG(ERROR) << "Cannot display plane on overlay: error="
- << strerror(errno);
- ret = false;
- flip.crtc->PageFlipFailed();
- break;
- }
+ }
+ }
+ for (HardwareDisplayPlane* plane : plane_list->old_plane_list) {
dnicoara 2015/01/16 21:40:08 Should this be done before the PageFlip()? I think
achaulk 2015/01/21 21:50:53 No, it only changes planes that haven't been re-us
+ bool found =
+ std::find(plane_list->plane_list.begin(), plane_list->plane_list.end(),
+ plane) != plane_list->plane_list.end();
+ if (!found && !plane->in_use()) {
+ // This plane is being released, so we need to zero it.
+ if (!drm_->PageFlipOverlay(plane->owning_crtc(), 0, gfx::Rect(),
+ gfx::Rect(), plane->plane_id())) {
+ LOG(ERROR) << "Cannot free overlay: error=" << strerror(errno)
+ << "crtc=" << plane->owning_crtc()
+ << " plane=" << plane->plane_id();
+ ret = false;
+ break;
}
}
}
+ plane_list->plane_list.swap(plane_list->old_plane_list);
+ plane_list->plane_list.clear();
plane_list->legacy_page_flips.clear();
+ plane_list->committed = true;
return ret;
}
« no previous file with comments | « ui/ozone/platform/dri/hardware_display_plane_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698