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_DEVICE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 DrmDevice(const base::FilePath& device_path, | 47 DrmDevice(const base::FilePath& device_path, |
48 base::File file, | 48 base::File file, |
49 bool is_primary_device); | 49 bool is_primary_device); |
50 | 50 |
51 bool is_primary_device() const { return is_primary_device_; } | 51 bool is_primary_device() const { return is_primary_device_; } |
52 | 52 |
53 // Open device. | 53 // Open device. |
54 virtual bool Initialize(bool use_atomic); | 54 virtual bool Initialize(bool use_atomic); |
55 | 55 |
56 // |task_runner| will be used to asynchronously page flip. | |
57 virtual void InitializeTaskRunner( | |
58 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | |
59 | |
60 // Get the CRTC state. This is generally used to save state before using the | 56 // Get the CRTC state. This is generally used to save state before using the |
61 // CRTC. When the user finishes using the CRTC, the user should restore the | 57 // CRTC. When the user finishes using the CRTC, the user should restore the |
62 // CRTC to it's initial state. Use |SetCrtc| to restore the state. | 58 // CRTC to it's initial state. Use |SetCrtc| to restore the state. |
63 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id); | 59 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id); |
64 | 60 |
65 // Used to configure CRTC with ID |crtc_id| to use the connector in | 61 // Used to configure CRTC with ID |crtc_id| to use the connector in |
66 // |connectors|. The CRTC will be configured with mode |mode| and will display | 62 // |connectors|. The CRTC will be configured with mode |mode| and will display |
67 // the framebuffer with ID |framebuffer|. Before being able to display the | 63 // the framebuffer with ID |framebuffer|. Before being able to display the |
68 // framebuffer, it should be registered with the CRTC using |AddFramebuffer|. | 64 // framebuffer, it should be registered with the CRTC using |AddFramebuffer|. |
69 virtual bool SetCrtc(uint32_t crtc_id, | 65 virtual bool SetCrtc(uint32_t crtc_id, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 private: | 185 private: |
190 class IOWatcher; | 186 class IOWatcher; |
191 class PageFlipManager; | 187 class PageFlipManager; |
192 | 188 |
193 // Path to DRM device. | 189 // Path to DRM device. |
194 const base::FilePath device_path_; | 190 const base::FilePath device_path_; |
195 | 191 |
196 // DRM device. | 192 // DRM device. |
197 base::File file_; | 193 base::File file_; |
198 | 194 |
199 // Helper thread to perform IO listener operations. | 195 scoped_ptr<PageFlipManager> page_flip_manager_; |
200 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
201 | 196 |
202 // Watcher for |fd_| listening for page flip events. | 197 // Watcher for |fd_| listening for page flip events. |
203 scoped_refptr<IOWatcher> watcher_; | 198 scoped_ptr<IOWatcher> watcher_; |
204 | |
205 scoped_refptr<PageFlipManager> page_flip_manager_; | |
206 | 199 |
207 bool is_primary_device_; | 200 bool is_primary_device_; |
208 | 201 |
209 DISALLOW_COPY_AND_ASSIGN(DrmDevice); | 202 DISALLOW_COPY_AND_ASSIGN(DrmDevice); |
210 }; | 203 }; |
211 | 204 |
212 } // namespace ui | 205 } // namespace ui |
213 | 206 |
214 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 207 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
OLD | NEW |