| 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 707f4b4973464334bdf573669cdf44d04580594f..a74dac4c0a52f18bcdcd41d412b2d6e7cdec5b70 100644
|
| --- a/ui/ozone/platform/dri/hardware_display_plane_manager_legacy.cc
|
| +++ b/ui/ozone/platform/dri/hardware_display_plane_manager_legacy.cc
|
| @@ -19,6 +19,39 @@ HardwareDisplayPlaneManagerLegacy::~HardwareDisplayPlaneManagerLegacy() {
|
|
|
| bool HardwareDisplayPlaneManagerLegacy::Commit(
|
| HardwareDisplayPlaneList* plane_list) {
|
| + return CommitInternal(plane_list, false);
|
| +}
|
| +
|
| +bool HardwareDisplayPlaneManagerLegacy::CommitSync(
|
| + HardwareDisplayPlaneList* plane_list) {
|
| + return CommitInternal(plane_list, true);
|
| +}
|
| +
|
| +bool HardwareDisplayPlaneManagerLegacy::SetPlaneData(
|
| + HardwareDisplayPlaneList* plane_list,
|
| + HardwareDisplayPlane* hw_plane,
|
| + const OverlayPlane& overlay,
|
| + uint32_t crtc_id,
|
| + const gfx::Rect& src_rect,
|
| + CrtcController* crtc) {
|
| + if (plane_list->legacy_page_flips.empty() ||
|
| + plane_list->legacy_page_flips.back().crtc_id != crtc_id) {
|
| + plane_list->legacy_page_flips.push_back(
|
| + HardwareDisplayPlaneList::PageFlipInfo(
|
| + crtc_id, overlay.buffer->GetFramebufferId(), hw_plane->plane_id(),
|
| + crtc));
|
| + } else {
|
| + plane_list->legacy_page_flips.back().planes.push_back(
|
| + HardwareDisplayPlaneList::PageFlipInfo::Plane(
|
| + hw_plane->plane_id(), overlay.buffer->GetFramebufferId(),
|
| + overlay.display_bounds, src_rect));
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +bool HardwareDisplayPlaneManagerLegacy::CommitInternal(
|
| + HardwareDisplayPlaneList* plane_list,
|
| + bool sync) {
|
| if (plane_list->plane_list.empty()) // No assigned planes, nothing to do.
|
| return true;
|
| bool ret = true;
|
| @@ -43,9 +76,16 @@ bool HardwareDisplayPlaneManagerLegacy::Commit(
|
| break;
|
| }
|
| }
|
| - if (!drm_->PageFlip(flip.crtc_id, flip.framebuffer,
|
| - base::Bind(&CrtcController::OnPageFlipEvent,
|
| - flip.crtc->AsWeakPtr()))) {
|
| + bool page_flip_success;
|
| + if (sync)
|
| + page_flip_success = drm_->PageFlipSync(
|
| + flip.crtc_id, flip.framebuffer,
|
| + base::Bind(&CrtcController::OnPageFlipEvent, flip.crtc->AsWeakPtr()));
|
| + else
|
| + page_flip_success = drm_->PageFlip(
|
| + flip.crtc_id, flip.framebuffer,
|
| + base::Bind(&CrtcController::OnPageFlipEvent, flip.crtc->AsWeakPtr()));
|
| + if (!page_flip_success) {
|
| if (errno != EACCES) {
|
| LOG(ERROR) << "Cannot page flip: error='" << strerror(errno) << "'"
|
| << " crtc=" << flip.crtc_id
|
| @@ -78,26 +118,4 @@ bool HardwareDisplayPlaneManagerLegacy::Commit(
|
| return ret;
|
| }
|
|
|
| -bool HardwareDisplayPlaneManagerLegacy::SetPlaneData(
|
| - HardwareDisplayPlaneList* plane_list,
|
| - HardwareDisplayPlane* hw_plane,
|
| - const OverlayPlane& overlay,
|
| - uint32_t crtc_id,
|
| - const gfx::Rect& src_rect,
|
| - CrtcController* crtc) {
|
| - if (plane_list->legacy_page_flips.empty() ||
|
| - plane_list->legacy_page_flips.back().crtc_id != crtc_id) {
|
| - plane_list->legacy_page_flips.push_back(
|
| - HardwareDisplayPlaneList::PageFlipInfo(
|
| - crtc_id, overlay.buffer->GetFramebufferId(), hw_plane->plane_id(),
|
| - crtc));
|
| - } else {
|
| - plane_list->legacy_page_flips.back().planes.push_back(
|
| - HardwareDisplayPlaneList::PageFlipInfo::Plane(
|
| - hw_plane->plane_id(), overlay.buffer->GetFramebufferId(),
|
| - overlay.display_bounds, src_rect));
|
| - }
|
| - return true;
|
| -}
|
| -
|
| } // namespace ui
|
|
|