| 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_DRM_GPU_DISPLAY_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" | 11 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 class SingleThreadTaskRunner; | 15 class SingleThreadTaskRunner; |
| 16 struct FileDescriptor; | 16 struct FileDescriptor; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 | 20 |
| 21 class DeviceManager; | 21 class DeviceManager; |
| 22 class DisplayMode; | 22 class DisplayMode; |
| 23 class DrmDevice; | 23 class DrmDevice; |
| 24 class DrmDeviceGenerator; | 24 class DrmDeviceManager; |
| 25 class DrmDisplaySnapshot; | 25 class DrmDisplaySnapshot; |
| 26 class DrmDisplayMode; | 26 class DrmDisplayMode; |
| 27 class ScreenManager; | 27 class ScreenManager; |
| 28 | 28 |
| 29 class DrmGpuDisplayManager { | 29 class DrmGpuDisplayManager { |
| 30 public: | 30 public: |
| 31 DrmGpuDisplayManager(ScreenManager* screen_manager, | 31 DrmGpuDisplayManager(ScreenManager* screen_manager, |
| 32 const scoped_refptr<DrmDevice>& primary_device, | 32 DrmDeviceManager* drm_device_manager); |
| 33 scoped_ptr<DrmDeviceGenerator> device_generator); | |
| 34 ~DrmGpuDisplayManager(); | 33 ~DrmGpuDisplayManager(); |
| 35 | 34 |
| 36 void InitializeIOTaskRunner( | 35 void InitializeIOTaskRunner( |
| 37 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 36 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| 38 | 37 |
| 39 // Returns a list of the connected displays. When this is called the list of | 38 // Returns a list of the connected displays. When this is called the list of |
| 40 // displays is refreshed. | 39 // displays is refreshed. |
| 41 std::vector<DisplaySnapshot_Params> GetDisplays(); | 40 std::vector<DisplaySnapshot_Params> GetDisplays(); |
| 42 | 41 |
| 43 bool ConfigureDisplay(int64_t id, | 42 bool ConfigureDisplay(int64_t id, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 68 bool GetHDCPState(const DrmDisplaySnapshot& output, HDCPState* state); | 67 bool GetHDCPState(const DrmDisplaySnapshot& output, HDCPState* state); |
| 69 bool SetHDCPState(const DrmDisplaySnapshot& output, HDCPState state); | 68 bool SetHDCPState(const DrmDisplaySnapshot& output, HDCPState state); |
| 70 | 69 |
| 71 // Notify ScreenManager of all the displays that were present before the | 70 // Notify ScreenManager of all the displays that were present before the |
| 72 // update but are gone after the update. | 71 // update but are gone after the update. |
| 73 void NotifyScreenManager( | 72 void NotifyScreenManager( |
| 74 const std::vector<DrmDisplaySnapshot*>& new_displays, | 73 const std::vector<DrmDisplaySnapshot*>& new_displays, |
| 75 const std::vector<DrmDisplaySnapshot*>& old_displays) const; | 74 const std::vector<DrmDisplaySnapshot*>& old_displays) const; |
| 76 | 75 |
| 77 ScreenManager* screen_manager_; // Not owned. | 76 ScreenManager* screen_manager_; // Not owned. |
| 78 scoped_ptr<DrmDeviceGenerator> drm_device_generator_; | 77 DrmDeviceManager* drm_device_manager_; // Not owned. |
| 79 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 78 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 80 std::vector<scoped_refptr<DrmDevice>> devices_; | 79 std::vector<scoped_refptr<DrmDevice>> devices_; |
| 81 // Modes can be shared between different displays, so we need to keep track | 80 // Modes can be shared between different displays, so we need to keep track |
| 82 // of them independently for cleanup. | 81 // of them independently for cleanup. |
| 83 ScopedVector<const DisplayMode> cached_modes_; | 82 ScopedVector<const DisplayMode> cached_modes_; |
| 84 ScopedVector<DrmDisplaySnapshot> cached_displays_; | 83 ScopedVector<DrmDisplaySnapshot> cached_displays_; |
| 85 | 84 |
| 86 DISALLOW_COPY_AND_ASSIGN(DrmGpuDisplayManager); | 85 DISALLOW_COPY_AND_ASSIGN(DrmGpuDisplayManager); |
| 87 }; | 86 }; |
| 88 | 87 |
| 89 } // namespace ui | 88 } // namespace ui |
| 90 | 89 |
| 91 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ | 90 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ |
| OLD | NEW |