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 #ifndef UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <xf86drmMode.h> | 10 #include <xf86drmMode.h> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // be presented to the callback. We use that argument to pass in the HDCO | 111 // be presented to the callback. We use that argument to pass in the HDCO |
112 // object the event belongs to. | 112 // object the event belongs to. |
113 // | 113 // |
114 // Between this call and the callback, the framebuffers used in this call | 114 // Between this call and the callback, the framebuffers used in this call |
115 // should not be modified in any way as it would cause screen tearing if the | 115 // should not be modified in any way as it would cause screen tearing if the |
116 // hardware performed the flip. Note that the frontbuffer should also not | 116 // hardware performed the flip. Note that the frontbuffer should also not |
117 // be modified as it could still be displayed. | 117 // be modified as it could still be displayed. |
118 // | 118 // |
119 // Note that this function does not block. Also, this function should not be | 119 // Note that this function does not block. Also, this function should not be |
120 // called again before the page flip occurrs. | 120 // called again before the page flip occurrs. |
121 // | 121 void SchedulePageFlip(const OverlayPlaneList& plane_list, |
122 // Returns true if the page flip was successfully registered, false otherwise. | |
123 // | |
124 // When called with |test_only| true, this performs the page flip without | |
125 // changing any state, reporting if this page flip would be allowed to occur. | |
126 bool SchedulePageFlip(const OverlayPlaneList& plane_list, | |
127 bool test_only, | |
128 const PageFlipCallback& callback); | 122 const PageFlipCallback& callback); |
129 | 123 |
| 124 // Returns true if the page flip with the |plane_list| would succeed. This |
| 125 // doesn't change any state. |
| 126 bool TestPageFlip(const OverlayPlaneList& plane_list); |
| 127 |
130 std::vector<uint32_t> GetCompatibleHardwarePlaneIds( | 128 std::vector<uint32_t> GetCompatibleHardwarePlaneIds( |
131 const OverlayPlane& plane) const; | 129 const OverlayPlane& plane) const; |
132 | 130 |
133 // Set the hardware cursor to show the contents of |surface|. | 131 // Set the hardware cursor to show the contents of |surface|. |
134 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer); | 132 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer); |
135 | 133 |
136 bool UnsetCursor(); | 134 bool UnsetCursor(); |
137 | 135 |
138 // Moves the hardware cursor to |location|. | 136 // Moves the hardware cursor to |location|. |
139 bool MoveCursor(const gfx::Point& location); | 137 bool MoveCursor(const gfx::Point& location); |
(...skipping 11 matching lines...) Expand all Loading... |
151 | 149 |
152 uint64_t GetTimeOfLastFlip() const; | 150 uint64_t GetTimeOfLastFlip() const; |
153 | 151 |
154 const std::vector<CrtcController*>& crtc_controllers() const { | 152 const std::vector<CrtcController*>& crtc_controllers() const { |
155 return crtc_controllers_.get(); | 153 return crtc_controllers_.get(); |
156 } | 154 } |
157 | 155 |
158 scoped_refptr<DrmDevice> GetAllocationDrmDevice() const; | 156 scoped_refptr<DrmDevice> GetAllocationDrmDevice() const; |
159 | 157 |
160 private: | 158 private: |
| 159 bool ActualSchedulePageFlip(const OverlayPlaneList& plane_list, |
| 160 bool test_only, |
| 161 const PageFlipCallback& callback); |
| 162 |
161 base::ScopedPtrHashMap<DrmDevice*, scoped_ptr<HardwareDisplayPlaneList>> | 163 base::ScopedPtrHashMap<DrmDevice*, scoped_ptr<HardwareDisplayPlaneList>> |
162 owned_hardware_planes_; | 164 owned_hardware_planes_; |
163 | 165 |
164 // Stores the CRTC configuration. This is used to identify monitors and | 166 // Stores the CRTC configuration. This is used to identify monitors and |
165 // configure them. | 167 // configure them. |
166 ScopedVector<CrtcController> crtc_controllers_; | 168 ScopedVector<CrtcController> crtc_controllers_; |
167 | 169 |
168 // Location of the controller on the screen. | 170 // Location of the controller on the screen. |
169 gfx::Point origin_; | 171 gfx::Point origin_; |
170 | 172 |
171 bool is_disabled_; | 173 bool is_disabled_; |
172 | 174 |
173 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); | 175 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); |
174 }; | 176 }; |
175 | 177 |
176 } // namespace ui | 178 } // namespace ui |
177 | 179 |
178 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ | 180 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ |
OLD | NEW |