| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 private: | 183 private: |
| 188 class IOWatcher; | 184 class IOWatcher; |
| 189 class PageFlipManager; | 185 class PageFlipManager; |
| 190 | 186 |
| 191 // Path to DRM device. | 187 // Path to DRM device. |
| 192 const base::FilePath device_path_; | 188 const base::FilePath device_path_; |
| 193 | 189 |
| 194 // DRM device. | 190 // DRM device. |
| 195 base::File file_; | 191 base::File file_; |
| 196 | 192 |
| 197 // Helper thread to perform IO listener operations. | 193 scoped_ptr<PageFlipManager> page_flip_manager_; |
| 198 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 199 | 194 |
| 200 // Watcher for |fd_| listening for page flip events. | 195 // Watcher for |fd_| listening for page flip events. |
| 201 scoped_refptr<IOWatcher> watcher_; | 196 scoped_ptr<IOWatcher> watcher_; |
| 202 | |
| 203 scoped_refptr<PageFlipManager> page_flip_manager_; | |
| 204 | 197 |
| 205 DISALLOW_COPY_AND_ASSIGN(DrmDevice); | 198 DISALLOW_COPY_AND_ASSIGN(DrmDevice); |
| 206 }; | 199 }; |
| 207 | 200 |
| 208 } // namespace ui | 201 } // namespace ui |
| 209 | 202 |
| 210 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 203 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
| OLD | NEW |