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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 public: | 42 public: |
43 typedef base::Callback<void(unsigned int /* frame */, | 43 typedef base::Callback<void(unsigned int /* frame */, |
44 unsigned int /* seconds */, | 44 unsigned int /* seconds */, |
45 unsigned int /* useconds */)> PageFlipCallback; | 45 unsigned int /* useconds */)> PageFlipCallback; |
46 | 46 |
47 DrmDevice(const base::FilePath& device_path, base::File file); | 47 DrmDevice(const base::FilePath& device_path, base::File file); |
48 | 48 |
49 // Open device. | 49 // Open device. |
50 virtual bool Initialize(bool use_atomic); | 50 virtual bool Initialize(bool use_atomic); |
51 | 51 |
52 // |task_runner| will be used to asynchronously page flip. | |
53 virtual void InitializeTaskRunner( | |
54 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | |
55 | |
56 // Get the CRTC state. This is generally used to save state before using the | 52 // Get the CRTC state. This is generally used to save state before using the |
57 // CRTC. When the user finishes using the CRTC, the user should restore the | 53 // CRTC. When the user finishes using the CRTC, the user should restore the |
58 // CRTC to it's initial state. Use |SetCrtc| to restore the state. | 54 // CRTC to it's initial state. Use |SetCrtc| to restore the state. |
59 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id); | 55 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id); |
60 | 56 |
61 // Used to configure CRTC with ID |crtc_id| to use the connector in | 57 // Used to configure CRTC with ID |crtc_id| to use the connector in |
62 // |connectors|. The CRTC will be configured with mode |mode| and will display | 58 // |connectors|. The CRTC will be configured with mode |mode| and will display |
63 // the framebuffer with ID |framebuffer|. Before being able to display the | 59 // the framebuffer with ID |framebuffer|. Before being able to display the |
64 // framebuffer, it should be registered with the CRTC using |AddFramebuffer|. | 60 // framebuffer, it should be registered with the CRTC using |AddFramebuffer|. |
65 virtual bool SetCrtc(uint32_t crtc_id, | 61 virtual bool SetCrtc(uint32_t crtc_id, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 private: | 181 private: |
186 class IOWatcher; | 182 class IOWatcher; |
187 class PageFlipManager; | 183 class PageFlipManager; |
188 | 184 |
189 // Path to DRM device. | 185 // Path to DRM device. |
190 const base::FilePath device_path_; | 186 const base::FilePath device_path_; |
191 | 187 |
192 // DRM device. | 188 // DRM device. |
193 base::File file_; | 189 base::File file_; |
194 | 190 |
195 // Helper thread to perform IO listener operations. | 191 scoped_ptr<PageFlipManager> page_flip_manager_; |
196 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
197 | 192 |
198 // Watcher for |fd_| listening for page flip events. | 193 // Watcher for |fd_| listening for page flip events. |
199 scoped_refptr<IOWatcher> watcher_; | 194 scoped_ptr<IOWatcher> watcher_; |
200 | |
201 scoped_refptr<PageFlipManager> page_flip_manager_; | |
202 | 195 |
203 DISALLOW_COPY_AND_ASSIGN(DrmDevice); | 196 DISALLOW_COPY_AND_ASSIGN(DrmDevice); |
204 }; | 197 }; |
205 | 198 |
206 } // namespace ui | 199 } // namespace ui |
207 | 200 |
208 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 201 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
OLD | NEW |