| 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_atomic.h" | 5 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.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/hardware_display_plane_atomic.h" | 10 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 crtcs.push_back(atomic_plane->crtc()->AsWeakPtr()); | 58 crtcs.push_back(atomic_plane->crtc()->AsWeakPtr()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 if (test_only) { | 61 if (test_only) { |
| 62 for (HardwareDisplayPlane* plane : plane_list->plane_list) { | 62 for (HardwareDisplayPlane* plane : plane_list->plane_list) { |
| 63 plane->set_in_use(false); | 63 plane->set_in_use(false); |
| 64 } | 64 } |
| 65 } else { | 65 } else { |
| 66 plane_list->plane_list.swap(plane_list->old_plane_list); | 66 plane_list->plane_list.swap(plane_list->old_plane_list); |
| 67 } | 67 } |
| 68 plane_list->plane_list.clear(); | |
| 69 | 68 |
| 70 uint32_t flags = 0; | 69 uint32_t flags = 0; |
| 71 if (test_only) { | 70 if (test_only) { |
| 72 flags = DRM_MODE_ATOMIC_TEST_ONLY; | 71 flags = DRM_MODE_ATOMIC_TEST_ONLY; |
| 73 } else { | 72 } else { |
| 74 flags = DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK; | 73 flags = DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK; |
| 75 } | 74 } |
| 76 | 75 |
| 77 if (!drm_->CommitProperties(plane_list->atomic_property_set.get(), flags, | 76 if (!drm_->CommitProperties(plane_list->atomic_property_set.get(), flags, |
| 78 crtcs.size(), | 77 crtcs.size(), |
| 79 base::Bind(&AtomicPageFlipCallback, crtcs))) { | 78 base::Bind(&AtomicPageFlipCallback, crtcs))) { |
| 80 PLOG(ERROR) << "Failed to commit properties"; | 79 PLOG(ERROR) << "Failed to commit properties"; |
| 80 ResetCurrentPlaneList(plane_list); |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 |
| 84 plane_list->plane_list.clear(); |
| 83 plane_list->atomic_property_set.reset(drmModeAtomicAlloc()); | 85 plane_list->atomic_property_set.reset(drmModeAtomicAlloc()); |
| 84 return true; | 86 return true; |
| 85 } | 87 } |
| 86 | 88 |
| 87 bool HardwareDisplayPlaneManagerAtomic::SetPlaneData( | 89 bool HardwareDisplayPlaneManagerAtomic::SetPlaneData( |
| 88 HardwareDisplayPlaneList* plane_list, | 90 HardwareDisplayPlaneList* plane_list, |
| 89 HardwareDisplayPlane* hw_plane, | 91 HardwareDisplayPlane* hw_plane, |
| 90 const OverlayPlane& overlay, | 92 const OverlayPlane& overlay, |
| 91 uint32_t crtc_id, | 93 uint32_t crtc_id, |
| 92 const gfx::Rect& src_rect, | 94 const gfx::Rect& src_rect, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 104 } | 106 } |
| 105 | 107 |
| 106 scoped_ptr<HardwareDisplayPlane> HardwareDisplayPlaneManagerAtomic::CreatePlane( | 108 scoped_ptr<HardwareDisplayPlane> HardwareDisplayPlaneManagerAtomic::CreatePlane( |
| 107 uint32_t plane_id, | 109 uint32_t plane_id, |
| 108 uint32_t possible_crtcs) { | 110 uint32_t possible_crtcs) { |
| 109 return scoped_ptr<HardwareDisplayPlane>( | 111 return scoped_ptr<HardwareDisplayPlane>( |
| 110 new HardwareDisplayPlaneAtomic(plane_id, possible_crtcs)); | 112 new HardwareDisplayPlaneAtomic(plane_id, possible_crtcs)); |
| 111 } | 113 } |
| 112 | 114 |
| 113 } // namespace ui | 115 } // namespace ui |
| OLD | NEW |