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> |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/containers/scoped_ptr_hash_map.h" | 17 #include "base/containers/scoped_ptr_hash_map.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/memory/scoped_vector.h" | 19 #include "base/memory/scoped_vector.h" |
| 20 #include "ui/gfx/swap_result.h" |
20 #include "ui/ozone/ozone_export.h" | 21 #include "ui/ozone/ozone_export.h" |
21 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h" | 22 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h" |
22 #include "ui/ozone/platform/drm/gpu/overlay_plane.h" | 23 #include "ui/ozone/platform/drm/gpu/overlay_plane.h" |
23 | 24 |
24 namespace gfx { | 25 namespace gfx { |
25 class Point; | 26 class Point; |
26 } | 27 } |
27 | 28 |
28 namespace ui { | 29 namespace ui { |
29 | 30 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // | | | 80 // | | |
80 // ---------------------- | 81 // ---------------------- |
81 // | CRTC1 | | 82 // | CRTC1 | |
82 // ---------------------- | 83 // ---------------------- |
83 // | 84 // |
84 // Note that it is possible to have more connectors than CRTCs which means that | 85 // Note that it is possible to have more connectors than CRTCs which means that |
85 // only a subset of connectors can be active independently, showing different | 86 // only a subset of connectors can be active independently, showing different |
86 // framebuffers. Though, in this case, it would be possible to have all | 87 // framebuffers. Though, in this case, it would be possible to have all |
87 // connectors active if some use the same CRTC to mirror the display. | 88 // connectors active if some use the same CRTC to mirror the display. |
88 class OZONE_EXPORT HardwareDisplayController { | 89 class OZONE_EXPORT HardwareDisplayController { |
| 90 typedef base::Callback<void(gfx::SwapResult)> PageFlipCallback; |
| 91 |
89 public: | 92 public: |
90 HardwareDisplayController(scoped_ptr<CrtcController> controller, | 93 HardwareDisplayController(scoped_ptr<CrtcController> controller, |
91 const gfx::Point& origin); | 94 const gfx::Point& origin); |
92 ~HardwareDisplayController(); | 95 ~HardwareDisplayController(); |
93 | 96 |
94 // Performs the initial CRTC configuration. If successful, it will display the | 97 // Performs the initial CRTC configuration. If successful, it will display the |
95 // framebuffer for |primary| with |mode|. | 98 // framebuffer for |primary| with |mode|. |
96 bool Modeset(const OverlayPlane& primary, drmModeModeInfo mode); | 99 bool Modeset(const OverlayPlane& primary, drmModeModeInfo mode); |
97 | 100 |
98 // Disables the CRTC. | 101 // Disables the CRTC. |
(...skipping 17 matching lines...) Expand all Loading... |
116 // Returns true if the page flip was successfully registered, false otherwise. | 119 // Returns true if the page flip was successfully registered, false otherwise. |
117 // | 120 // |
118 // When called with |test_only| true, this performs the page flip without | 121 // When called with |test_only| true, this performs the page flip without |
119 // changing any state, reporting if this page flip would be allowed to occur. | 122 // changing any state, reporting if this page flip would be allowed to occur. |
120 // This is always a synchronous operation, so |is_sync| is ignored and the | 123 // This is always a synchronous operation, so |is_sync| is ignored and the |
121 // callback is called immediately but should also be ignored; only the return | 124 // callback is called immediately but should also be ignored; only the return |
122 // value matters. | 125 // value matters. |
123 bool SchedulePageFlip(const OverlayPlaneList& plane_list, | 126 bool SchedulePageFlip(const OverlayPlaneList& plane_list, |
124 bool is_sync, | 127 bool is_sync, |
125 bool test_only, | 128 bool test_only, |
126 const base::Closure& callback); | 129 const PageFlipCallback& callback); |
127 | 130 |
128 // Set the hardware cursor to show the contents of |surface|. | 131 // Set the hardware cursor to show the contents of |surface|. |
129 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer); | 132 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer); |
130 | 133 |
131 bool UnsetCursor(); | 134 bool UnsetCursor(); |
132 | 135 |
133 // Moves the hardware cursor to |location|. | 136 // Moves the hardware cursor to |location|. |
134 bool MoveCursor(const gfx::Point& location); | 137 bool MoveCursor(const gfx::Point& location); |
135 | 138 |
136 void AddCrtc(scoped_ptr<CrtcController> controller); | 139 void AddCrtc(scoped_ptr<CrtcController> controller); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 drmModeModeInfo mode_; | 172 drmModeModeInfo mode_; |
170 | 173 |
171 bool is_disabled_; | 174 bool is_disabled_; |
172 | 175 |
173 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); | 176 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); |
174 }; | 177 }; |
175 | 178 |
176 } // namespace ui | 179 } // namespace ui |
177 | 180 |
178 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ | 181 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_CONTROLLER_H_ |
OLD | NEW |