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