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_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ |
6 #define UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ | 6 #define UI_OZONE_PLATFORM_DRI_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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // | 116 // |
117 // Between this call and the callback, the framebuffers used in this call | 117 // Between this call and the callback, the framebuffers used in this call |
118 // should not be modified in any way as it would cause screen tearing if the | 118 // should not be modified in any way as it would cause screen tearing if the |
119 // hardware performed the flip. Note that the frontbuffer should also not | 119 // hardware performed the flip. Note that the frontbuffer should also not |
120 // be modified as it could still be displayed. | 120 // be modified as it could still be displayed. |
121 // | 121 // |
122 // Note that this function does not block. Also, this function should not be | 122 // Note that this function does not block. Also, this function should not be |
123 // called again before the page flip occurrs. | 123 // called again before the page flip occurrs. |
124 // | 124 // |
125 // Returns true if the page flip was successfully registered, false otherwise. | 125 // Returns true if the page flip was successfully registered, false otherwise. |
126 bool SchedulePageFlip(const base::Closure& callback); | 126 bool SchedulePageFlip(bool is_sync, const base::Closure& callback); |
127 | 127 |
128 // Set the hardware cursor to show the contents of |surface|. | 128 // Set the hardware cursor to show the contents of |surface|. |
129 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer); | 129 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer); |
130 | 130 |
131 bool UnsetCursor(); | 131 bool UnsetCursor(); |
132 | 132 |
133 // Moves the hardware cursor to |location|. | 133 // Moves the hardware cursor to |location|. |
134 bool MoveCursor(const gfx::Point& location); | 134 bool MoveCursor(const gfx::Point& location); |
135 | 135 |
136 void AddCrtc(scoped_ptr<CrtcController> controller); | 136 void AddCrtc(scoped_ptr<CrtcController> controller); |
(...skipping 25 matching lines...) Expand all Loading... |
162 | 162 |
163 void ProcessPageFlipRequest(); | 163 void ProcessPageFlipRequest(); |
164 | 164 |
165 void ClearPendingRequests(); | 165 void ClearPendingRequests(); |
166 | 166 |
167 // PageFlipObserver: | 167 // PageFlipObserver: |
168 void OnPageFlipEvent() override; | 168 void OnPageFlipEvent() override; |
169 | 169 |
170 struct PageFlipRequest { | 170 struct PageFlipRequest { |
171 PageFlipRequest(const OverlayPlaneList& planes, | 171 PageFlipRequest(const OverlayPlaneList& planes, |
| 172 bool is_sync, |
172 const base::Closure& callback); | 173 const base::Closure& callback); |
173 ~PageFlipRequest(); | 174 ~PageFlipRequest(); |
174 | 175 |
175 OverlayPlaneList planes; | 176 OverlayPlaneList planes; |
| 177 bool is_sync; |
176 base::Closure callback; | 178 base::Closure callback; |
177 }; | 179 }; |
178 | 180 |
179 // Buffers need to be declared first so that they are destroyed last. Needed | 181 // Buffers need to be declared first so that they are destroyed last. Needed |
180 // since the controllers may reference the buffers. | 182 // since the controllers may reference the buffers. |
181 OverlayPlaneList current_planes_; | 183 OverlayPlaneList current_planes_; |
182 OverlayPlaneList pending_planes_; | 184 OverlayPlaneList pending_planes_; |
183 std::deque<PageFlipRequest> requests_; | 185 std::deque<PageFlipRequest> requests_; |
184 scoped_refptr<ScanoutBuffer> cursor_buffer_; | 186 scoped_refptr<ScanoutBuffer> cursor_buffer_; |
185 | 187 |
(...skipping 11 matching lines...) Expand all Loading... |
197 drmModeModeInfo mode_; | 199 drmModeModeInfo mode_; |
198 | 200 |
199 bool is_disabled_; | 201 bool is_disabled_; |
200 | 202 |
201 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); | 203 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); |
202 }; | 204 }; |
203 | 205 |
204 } // namespace ui | 206 } // namespace ui |
205 | 207 |
206 #endif // UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ | 208 #endif // UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ |
OLD | NEW |