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