| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 21 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| 22 #include "ui/ozone/platform/drm/host/gpu_thread_observer.h" | 22 #include "ui/ozone/platform/drm/host/gpu_thread_observer.h" |
| 23 | 23 |
| 24 namespace ui { | 24 namespace ui { |
| 25 | 25 |
| 26 class DeviceManager; | 26 class DeviceManager; |
| 27 class DrmDeviceHandle; | 27 class DrmDeviceHandle; |
| 28 class DrmDisplayHost; | 28 class DrmDisplayHost; |
| 29 class DrmDisplayHostManager; | 29 class DrmDisplayHostManager; |
| 30 class DrmNativeDisplayDelegate; | 30 class DrmNativeDisplayDelegate; |
| 31 class DrmOverlayManager; |
| 31 class GpuThreadAdapter; | 32 class GpuThreadAdapter; |
| 32 | 33 |
| 33 struct DisplaySnapshot_Params; | 34 struct DisplaySnapshot_Params; |
| 34 | 35 |
| 35 // The portion of the DrmDisplayHostManager implementation that is agnostic | 36 // The portion of the DrmDisplayHostManager implementation that is agnostic |
| 36 // in how its communication with GPU-specific functionality is implemented. | 37 // in how its communication with GPU-specific functionality is implemented. |
| 37 // This is used from both the IPC and the in-process versions in MUS. | 38 // This is used from both the IPC and the in-process versions in MUS. |
| 38 class DrmDisplayHostManager : public DeviceEventObserver, GpuThreadObserver { | 39 class DrmDisplayHostManager : public DeviceEventObserver, GpuThreadObserver { |
| 39 public: | 40 public: |
| 40 DrmDisplayHostManager(GpuThreadAdapter* proxy, | 41 DrmDisplayHostManager(GpuThreadAdapter* proxy, |
| 41 DeviceManager* device_manager, | 42 DeviceManager* device_manager, |
| 43 DrmOverlayManager* overlay_manager, |
| 42 InputControllerEvdev* input_controller); | 44 InputControllerEvdev* input_controller); |
| 43 ~DrmDisplayHostManager() override; | 45 ~DrmDisplayHostManager() override; |
| 44 | 46 |
| 45 DrmDisplayHost* GetDisplay(int64_t display_id); | 47 DrmDisplayHost* GetDisplay(int64_t display_id); |
| 46 | 48 |
| 47 // External API. | 49 // External API. |
| 48 void AddDelegate(DrmNativeDisplayDelegate* delegate); | 50 void AddDelegate(DrmNativeDisplayDelegate* delegate); |
| 49 void RemoveDelegate(DrmNativeDisplayDelegate* delegate); | 51 void RemoveDelegate(DrmNativeDisplayDelegate* delegate); |
| 50 void TakeDisplayControl(const display::DisplayControlCallback& callback); | 52 void TakeDisplayControl(const display::DisplayControlCallback& callback); |
| 51 void RelinquishDisplayControl( | 53 void RelinquishDisplayControl( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 void OnUpdateGraphicsDevice(); | 95 void OnUpdateGraphicsDevice(); |
| 94 void OnRemoveGraphicsDevice(const base::FilePath& path); | 96 void OnRemoveGraphicsDevice(const base::FilePath& path); |
| 95 | 97 |
| 96 void RunUpdateDisplaysCallback( | 98 void RunUpdateDisplaysCallback( |
| 97 const display::GetDisplaysCallback& callback) const; | 99 const display::GetDisplaysCallback& callback) const; |
| 98 | 100 |
| 99 void NotifyDisplayDelegate() const; | 101 void NotifyDisplayDelegate() const; |
| 100 | 102 |
| 101 GpuThreadAdapter* proxy_; // Not owned. | 103 GpuThreadAdapter* proxy_; // Not owned. |
| 102 DeviceManager* device_manager_; // Not owned. | 104 DeviceManager* device_manager_; // Not owned. |
| 105 DrmOverlayManager* overlay_manager_; // Not owned. |
| 103 InputControllerEvdev* input_controller_; // Not owned. | 106 InputControllerEvdev* input_controller_; // Not owned. |
| 104 | 107 |
| 105 DrmNativeDisplayDelegate* delegate_ = nullptr; // Not owned. | 108 DrmNativeDisplayDelegate* delegate_ = nullptr; // Not owned. |
| 106 | 109 |
| 107 // File path for the primary graphics card which is opened by default in the | 110 // File path for the primary graphics card which is opened by default in the |
| 108 // GPU process. We'll avoid opening this in hotplug events since it will race | 111 // GPU process. We'll avoid opening this in hotplug events since it will race |
| 109 // with the GPU process trying to open it and aquire DRM master. | 112 // with the GPU process trying to open it and aquire DRM master. |
| 110 base::FilePath primary_graphics_card_path_; | 113 base::FilePath primary_graphics_card_path_; |
| 111 | 114 |
| 112 // Keeps track if there is a dummy display. This happens on initialization | 115 // Keeps track if there is a dummy display. This happens on initialization |
| (...skipping 27 matching lines...) Expand all Loading... |
| 140 std::unique_ptr<DrmDeviceHandle> primary_drm_device_handle_; | 143 std::unique_ptr<DrmDeviceHandle> primary_drm_device_handle_; |
| 141 | 144 |
| 142 base::WeakPtrFactory<DrmDisplayHostManager> weak_ptr_factory_; | 145 base::WeakPtrFactory<DrmDisplayHostManager> weak_ptr_factory_; |
| 143 | 146 |
| 144 DISALLOW_COPY_AND_ASSIGN(DrmDisplayHostManager); | 147 DISALLOW_COPY_AND_ASSIGN(DrmDisplayHostManager); |
| 145 }; | 148 }; |
| 146 | 149 |
| 147 } // namespace ui | 150 } // namespace ui |
| 148 | 151 |
| 149 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_MANAGER_H_ | 152 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_MANAGER_H_ |
| OLD | NEW |