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_HOST_DRM_DISPLAY_HOST_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_MANAGER_H_ |
6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_MANAGER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/scoped_file.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "ui/display/types/native_display_delegate.h" | 14 #include "ui/display/types/native_display_delegate.h" |
15 #include "ui/events/ozone/device/device_event.h" | 15 #include "ui/events/ozone/device/device_event.h" |
16 #include "ui/events/ozone/device/device_event_observer.h" | 16 #include "ui/events/ozone/device/device_event_observer.h" |
17 #include "ui/ozone/public/gpu_platform_support_host.h" | 17 #include "ui/ozone/public/gpu_platform_support_host.h" |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 | 20 |
21 class DeviceManager; | 21 class DeviceManager; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 DrmGpuPlatformSupportHost* proxy_; // Not owned. | 88 DrmGpuPlatformSupportHost* proxy_; // Not owned. |
89 DeviceManager* device_manager_; // Not owned. | 89 DeviceManager* device_manager_; // Not owned. |
90 | 90 |
91 DrmNativeDisplayDelegate* delegate_; // Not owned. | 91 DrmNativeDisplayDelegate* delegate_; // Not owned. |
92 | 92 |
93 // File path for the primary graphics card which is opened by default in the | 93 // File path for the primary graphics card which is opened by default in the |
94 // GPU process. We'll avoid opening this in hotplug events since it will race | 94 // GPU process. We'll avoid opening this in hotplug events since it will race |
95 // with the GPU process trying to open it and aquire DRM master. | 95 // with the GPU process trying to open it and aquire DRM master. |
96 base::FilePath primary_graphics_card_path_; | 96 base::FilePath primary_graphics_card_path_; |
97 | 97 |
| 98 // File path for virtual gem (VGEM) device. |
| 99 base::FilePath vgem_card_path_; |
| 100 |
98 // Keeps track if there is a dummy display. This happens on initialization | 101 // Keeps track if there is a dummy display. This happens on initialization |
99 // when there is no connection to the GPU to update the displays. | 102 // when there is no connection to the GPU to update the displays. |
100 bool has_dummy_display_; | 103 bool has_dummy_display_; |
101 | 104 |
102 ScopedVector<DrmDisplayHost> displays_; | 105 ScopedVector<DrmDisplayHost> displays_; |
103 | 106 |
104 GetDisplaysCallback get_displays_callback_; | 107 GetDisplaysCallback get_displays_callback_; |
105 | 108 |
106 // Used to serialize display event processing. This is done since | 109 // Used to serialize display event processing. This is done since |
107 // opening/closing DRM devices cannot be done on the UI thread and are handled | 110 // opening/closing DRM devices cannot be done on the UI thread and are handled |
108 // on a worker thread. Thus, we need to queue events in order to process them | 111 // on a worker thread. Thus, we need to queue events in order to process them |
109 // in the correct order. | 112 // in the correct order. |
110 std::queue<DisplayEvent> event_queue_; | 113 std::queue<DisplayEvent> event_queue_; |
111 | 114 |
112 // True if a display event is currently being processed on a worker thread. | 115 // True if a display event is currently being processed on a worker thread. |
113 bool task_pending_; | 116 bool task_pending_; |
114 | 117 |
115 // Keeps track of all the active DRM devices. | 118 // Keeps track of all the active DRM devices. |
116 std::set<base::FilePath> drm_devices_; | 119 std::set<base::FilePath> drm_devices_; |
117 | 120 |
118 // This is used to cache the primary DRM device until the channel is | 121 // This is used to cache the primary DRM device until the channel is |
119 // established. | 122 // established. |
120 scoped_ptr<DrmDeviceHandle> primary_drm_device_handle_; | 123 scoped_ptr<DrmDeviceHandle> primary_drm_device_handle_; |
121 | 124 |
| 125 // Manages the VGEM device by itself and doesn't send it to GPU process. |
| 126 base::ScopedFD vgem_card_device_file_; |
| 127 |
122 base::WeakPtrFactory<DrmDisplayHostManager> weak_ptr_factory_; | 128 base::WeakPtrFactory<DrmDisplayHostManager> weak_ptr_factory_; |
123 | 129 |
124 DISALLOW_COPY_AND_ASSIGN(DrmDisplayHostManager); | 130 DISALLOW_COPY_AND_ASSIGN(DrmDisplayHostManager); |
125 }; | 131 }; |
126 | 132 |
127 } // namespace ui | 133 } // namespace ui |
128 | 134 |
129 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_MANAGER_H_ | 135 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_MANAGER_H_ |
OLD | NEW |