Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_device.h

Issue 1311043016: Switch DRM platform to using a separate thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-drm-calls-on-thread2
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698