| 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 DrmDeviceManager; | 24 class DrmDeviceManager; |
| 25 class DrmDisplaySnapshot; | 25 class DrmDisplaySnapshot; |
| 26 class DrmDisplayMode; | 26 class DrmDisplayMode; |
| 27 class ScreenManager; | 27 class ScreenManager; |
| 28 | 28 |
| 29 struct GammaRampRGBEntry; |
| 30 |
| 29 class DrmGpuDisplayManager { | 31 class DrmGpuDisplayManager { |
| 30 public: | 32 public: |
| 31 DrmGpuDisplayManager(ScreenManager* screen_manager, | 33 DrmGpuDisplayManager(ScreenManager* screen_manager, |
| 32 DrmDeviceManager* drm_device_manager); | 34 DrmDeviceManager* drm_device_manager); |
| 33 ~DrmGpuDisplayManager(); | 35 ~DrmGpuDisplayManager(); |
| 34 | 36 |
| 35 void InitializeIOTaskRunner( | 37 void InitializeIOTaskRunner( |
| 36 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| 37 | 39 |
| 38 // Returns a list of the connected displays. When this is called the list of | 40 // Returns a list of the connected displays. When this is called the list of |
| (...skipping 10 matching lines...) Expand all Loading... |
| 49 bool RelinquishDisplayControl(); | 51 bool RelinquishDisplayControl(); |
| 50 | 52 |
| 51 // Called on DRM hotplug events to add/remove a DRM device. | 53 // Called on DRM hotplug events to add/remove a DRM device. |
| 52 void AddGraphicsDevice(const base::FilePath& path, | 54 void AddGraphicsDevice(const base::FilePath& path, |
| 53 const base::FileDescriptor& fd); | 55 const base::FileDescriptor& fd); |
| 54 void RemoveGraphicsDevice(const base::FilePath& path); | 56 void RemoveGraphicsDevice(const base::FilePath& path); |
| 55 | 57 |
| 56 bool GetHDCPState(int64_t display_id, HDCPState* state); | 58 bool GetHDCPState(int64_t display_id, HDCPState* state); |
| 57 bool SetHDCPState(int64_t display_id, HDCPState state); | 59 bool SetHDCPState(int64_t display_id, HDCPState state); |
| 58 | 60 |
| 61 // Set the gamma ramp for a particular display id. |
| 62 void SetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut); |
| 63 |
| 59 private: | 64 private: |
| 60 DrmDisplaySnapshot* FindDisplaySnapshot(int64_t id); | 65 DrmDisplaySnapshot* FindDisplaySnapshot(int64_t id); |
| 61 const DrmDisplayMode* FindDisplayMode(const gfx::Size& size, | 66 const DrmDisplayMode* FindDisplayMode(const gfx::Size& size, |
| 62 bool is_interlaced, | 67 bool is_interlaced, |
| 63 float refresh_rate); | 68 float refresh_rate); |
| 64 | 69 |
| 65 void RefreshDisplayList(); | 70 void RefreshDisplayList(); |
| 66 bool Configure(const DrmDisplaySnapshot& output, | 71 bool Configure(const DrmDisplaySnapshot& output, |
| 67 const DrmDisplayMode* mode, | 72 const DrmDisplayMode* mode, |
| 68 const gfx::Point& origin); | 73 const gfx::Point& origin); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 81 // of them independently for cleanup. | 86 // of them independently for cleanup. |
| 82 ScopedVector<const DisplayMode> cached_modes_; | 87 ScopedVector<const DisplayMode> cached_modes_; |
| 83 ScopedVector<DrmDisplaySnapshot> cached_displays_; | 88 ScopedVector<DrmDisplaySnapshot> cached_displays_; |
| 84 | 89 |
| 85 DISALLOW_COPY_AND_ASSIGN(DrmGpuDisplayManager); | 90 DISALLOW_COPY_AND_ASSIGN(DrmGpuDisplayManager); |
| 86 }; | 91 }; |
| 87 | 92 |
| 88 } // namespace ui | 93 } // namespace ui |
| 89 | 94 |
| 90 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ | 95 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_ |
| OLD | NEW |