| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.h" | 5 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" | 8 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" |
| 9 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 9 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
| 10 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 10 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 << " framebuffer=" << flip.framebuffer | 60 << " framebuffer=" << flip.framebuffer |
| 61 << " is_sync=" << is_sync; | 61 << " is_sync=" << is_sync; |
| 62 ret = false; | 62 ret = false; |
| 63 } | 63 } |
| 64 flip.crtc->PageFlipFailed(); | 64 flip.crtc->PageFlipFailed(); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 // For each element in |old_plane_list|, if it hasn't been reclaimed (by | 67 // For each element in |old_plane_list|, if it hasn't been reclaimed (by |
| 68 // this or any other HDPL), clear the overlay contents. | 68 // this or any other HDPL), clear the overlay contents. |
| 69 for (HardwareDisplayPlane* plane : plane_list->old_plane_list) { | 69 for (HardwareDisplayPlane* plane : plane_list->old_plane_list) { |
| 70 if (!plane->in_use() && !plane->is_dummy()) { | 70 if (!plane->in_use() && (plane->type() != HardwareDisplayPlane::kDummy)) { |
| 71 // This plane is being released, so we need to zero it. | 71 // This plane is being released, so we need to zero it. |
| 72 if (!drm_->PageFlipOverlay(plane->owning_crtc(), 0, gfx::Rect(), | 72 if (!drm_->PageFlipOverlay(plane->owning_crtc(), 0, gfx::Rect(), |
| 73 gfx::Rect(), plane->plane_id())) { | 73 gfx::Rect(), plane->plane_id())) { |
| 74 PLOG(ERROR) << "Cannot free overlay: crtc=" << plane->owning_crtc() | 74 PLOG(ERROR) << "Cannot free overlay: crtc=" << plane->owning_crtc() |
| 75 << " plane=" << plane->plane_id(); | 75 << " plane=" << plane->plane_id(); |
| 76 ret = false; | 76 ret = false; |
| 77 break; | 77 break; |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 plane_list->plane_list.swap(plane_list->old_plane_list); | 81 plane_list->plane_list.swap(plane_list->old_plane_list); |
| 82 plane_list->plane_list.clear(); | 82 plane_list->plane_list.clear(); |
| 83 plane_list->legacy_page_flips.clear(); | 83 plane_list->legacy_page_flips.clear(); |
| 84 return ret; | 84 return ret; |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool HardwareDisplayPlaneManagerLegacy::SetPlaneData( | 87 bool HardwareDisplayPlaneManagerLegacy::SetPlaneData( |
| 88 HardwareDisplayPlaneList* plane_list, | 88 HardwareDisplayPlaneList* plane_list, |
| 89 HardwareDisplayPlane* hw_plane, | 89 HardwareDisplayPlane* hw_plane, |
| 90 const OverlayPlane& overlay, | 90 const OverlayPlane& overlay, |
| 91 uint32_t crtc_id, | 91 uint32_t crtc_id, |
| 92 const gfx::Rect& src_rect, | 92 const gfx::Rect& src_rect, |
| 93 CrtcController* crtc) { | 93 CrtcController* crtc) { |
| 94 if (hw_plane->is_dummy() || plane_list->legacy_page_flips.empty() || | 94 if ((hw_plane->type() == HardwareDisplayPlane::kDummy) || |
| 95 plane_list->legacy_page_flips.empty() || |
| 95 plane_list->legacy_page_flips.back().crtc_id != crtc_id) { | 96 plane_list->legacy_page_flips.back().crtc_id != crtc_id) { |
| 96 plane_list->legacy_page_flips.push_back( | 97 plane_list->legacy_page_flips.push_back( |
| 97 HardwareDisplayPlaneList::PageFlipInfo( | 98 HardwareDisplayPlaneList::PageFlipInfo( |
| 98 crtc_id, overlay.buffer->GetFramebufferId(), crtc)); | 99 crtc_id, overlay.buffer->GetFramebufferId(), crtc)); |
| 99 } else { | 100 } else { |
| 100 plane_list->legacy_page_flips.back().planes.push_back( | 101 plane_list->legacy_page_flips.back().planes.push_back( |
| 101 HardwareDisplayPlaneList::PageFlipInfo::Plane( | 102 HardwareDisplayPlaneList::PageFlipInfo::Plane( |
| 102 hw_plane->plane_id(), overlay.buffer->GetFramebufferId(), | 103 hw_plane->plane_id(), overlay.buffer->GetFramebufferId(), |
| 103 overlay.display_bounds, src_rect)); | 104 overlay.display_bounds, src_rect)); |
| 104 } | 105 } |
| 105 return true; | 106 return true; |
| 106 } | 107 } |
| 107 | 108 |
| 108 } // namespace ui | 109 } // namespace ui |
| OLD | NEW |