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 "base/stl_util.h" |
8 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" | 9 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" |
9 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 10 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
10 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.h" | 11 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.h" |
11 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 12 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
12 | 13 |
13 namespace ui { | 14 namespace ui { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 void AtomicPageFlipCallback(std::vector<base::WeakPtr<CrtcController>> crtcs, | 18 void AtomicPageFlipCallback(std::vector<base::WeakPtr<CrtcController>> crtcs, |
(...skipping 12 matching lines...) Expand all Loading... |
30 HardwareDisplayPlaneManagerAtomic::HardwareDisplayPlaneManagerAtomic() { | 31 HardwareDisplayPlaneManagerAtomic::HardwareDisplayPlaneManagerAtomic() { |
31 } | 32 } |
32 | 33 |
33 HardwareDisplayPlaneManagerAtomic::~HardwareDisplayPlaneManagerAtomic() { | 34 HardwareDisplayPlaneManagerAtomic::~HardwareDisplayPlaneManagerAtomic() { |
34 } | 35 } |
35 | 36 |
36 bool HardwareDisplayPlaneManagerAtomic::Commit( | 37 bool HardwareDisplayPlaneManagerAtomic::Commit( |
37 HardwareDisplayPlaneList* plane_list, | 38 HardwareDisplayPlaneList* plane_list, |
38 bool test_only) { | 39 bool test_only) { |
39 for (HardwareDisplayPlane* plane : plane_list->old_plane_list) { | 40 for (HardwareDisplayPlane* plane : plane_list->old_plane_list) { |
40 bool found = | 41 if (!base::ContainsValue(plane_list->plane_list, plane)) { |
41 std::find(plane_list->plane_list.begin(), plane_list->plane_list.end(), | |
42 plane) != plane_list->plane_list.end(); | |
43 if (!found) { | |
44 // This plane is being released, so we need to zero it. | 42 // This plane is being released, so we need to zero it. |
45 plane->set_in_use(false); | 43 plane->set_in_use(false); |
46 HardwareDisplayPlaneAtomic* atomic_plane = | 44 HardwareDisplayPlaneAtomic* atomic_plane = |
47 static_cast<HardwareDisplayPlaneAtomic*>(plane); | 45 static_cast<HardwareDisplayPlaneAtomic*>(plane); |
48 atomic_plane->SetPlaneData(plane_list->atomic_property_set.get(), 0, 0, | 46 atomic_plane->SetPlaneData(plane_list->atomic_property_set.get(), 0, 0, |
49 gfx::Rect(), gfx::Rect(), | 47 gfx::Rect(), gfx::Rect(), |
50 gfx::OVERLAY_TRANSFORM_NONE); | 48 gfx::OVERLAY_TRANSFORM_NONE); |
51 } | 49 } |
52 } | 50 } |
53 | 51 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 108 } |
111 | 109 |
112 std::unique_ptr<HardwareDisplayPlane> | 110 std::unique_ptr<HardwareDisplayPlane> |
113 HardwareDisplayPlaneManagerAtomic::CreatePlane(uint32_t plane_id, | 111 HardwareDisplayPlaneManagerAtomic::CreatePlane(uint32_t plane_id, |
114 uint32_t possible_crtcs) { | 112 uint32_t possible_crtcs) { |
115 return std::unique_ptr<HardwareDisplayPlane>( | 113 return std::unique_ptr<HardwareDisplayPlane>( |
116 new HardwareDisplayPlaneAtomic(plane_id, possible_crtcs)); | 114 new HardwareDisplayPlaneAtomic(plane_id, possible_crtcs)); |
117 } | 115 } |
118 | 116 |
119 } // namespace ui | 117 } // namespace ui |
OLD | NEW |