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_SCREEN_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ |
6 #define UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class DriWrapper; | 23 class DriWrapper; |
24 class ScanoutBufferGenerator; | 24 class ScanoutBufferGenerator; |
25 | 25 |
26 // Responsible for keeping track of active displays and configuring them. | 26 // Responsible for keeping track of active displays and configuring them. |
27 class ScreenManager { | 27 class ScreenManager { |
28 public: | 28 public: |
29 ScreenManager(DriWrapper* dri, ScanoutBufferGenerator* surface_generator); | 29 ScreenManager(DriWrapper* dri, ScanoutBufferGenerator* surface_generator); |
30 virtual ~ScreenManager(); | 30 virtual ~ScreenManager(); |
31 | 31 |
| 32 // Register a display controller. This must be called before trying to |
| 33 // configure it. |
| 34 void AddDisplayController(uint32_t crtc, uint32_t connector); |
| 35 |
32 // Remove a display controller from the list of active controllers. The | 36 // Remove a display controller from the list of active controllers. The |
33 // controller is removed since it was disconnected. | 37 // controller is removed since it was disconnected. |
34 void RemoveDisplayController(uint32_t crtc); | 38 void RemoveDisplayController(uint32_t crtc); |
35 | 39 |
36 // Configure (and add if not present) a display controller. The display | 40 // Configure a display controller. The display controller is identified by |
37 // controller is identified by (|crtc|, |connector|) and the controller is | 41 // (|crtc|, |connector|) and the controller is modeset using |mode|. |
38 // modeset using |mode|. | |
39 bool ConfigureDisplayController(uint32_t crtc, | 42 bool ConfigureDisplayController(uint32_t crtc, |
40 uint32_t connector, | 43 uint32_t connector, |
41 const gfx::Point& origin, | 44 const gfx::Point& origin, |
42 const drmModeModeInfo& mode); | 45 const drmModeModeInfo& mode); |
43 | 46 |
44 // Disable the display controller identified by |crtc|. Note, the controller | 47 // Disable the display controller identified by |crtc|. Note, the controller |
45 // may still be connected, so this does not remove the controller. | 48 // may still be connected, so this does not remove the controller. |
46 bool DisableDisplayController(uint32_t crtc); | 49 bool DisableDisplayController(uint32_t crtc); |
47 | 50 |
48 // Returns a reference to the display controller configured to display within | 51 // Returns a reference to the display controller configured to display within |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ScanoutBufferGenerator* buffer_generator_; // Not owned. | 91 ScanoutBufferGenerator* buffer_generator_; // Not owned. |
89 // List of display controllers (active and disabled). | 92 // List of display controllers (active and disabled). |
90 HardwareDisplayControllers controllers_; | 93 HardwareDisplayControllers controllers_; |
91 | 94 |
92 DISALLOW_COPY_AND_ASSIGN(ScreenManager); | 95 DISALLOW_COPY_AND_ASSIGN(ScreenManager); |
93 }; | 96 }; |
94 | 97 |
95 } // namespace ui | 98 } // namespace ui |
96 | 99 |
97 #endif // UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ | 100 #endif // UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ |
OLD | NEW |