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

Side by Side Diff: ui/ozone/platform/dri/dri_wrapper.h

Issue 847213002: [Ozone-DRI] Re-enable GBM surface mode support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests Created 5 years, 11 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
« no previous file with comments | « no previous file | ui/ozone/platform/dri/dri_wrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DRI_DRI_WRAPPER_H_ 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_ 6 #define UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 19 matching lines...) Expand all
30 30
31 // Wraps DRM calls into a nice interface. Used to provide different 31 // Wraps DRM calls into a nice interface. Used to provide different
32 // implementations of the DRM calls. For the actual implementation the DRM API 32 // implementations of the DRM calls. For the actual implementation the DRM API
33 // would be called. In unit tests this interface would be stubbed. 33 // would be called. In unit tests this interface would be stubbed.
34 class DriWrapper { 34 class DriWrapper {
35 public: 35 public:
36 typedef base::Callback<void(unsigned int /* frame */, 36 typedef base::Callback<void(unsigned int /* frame */,
37 unsigned int /* seconds */, 37 unsigned int /* seconds */,
38 unsigned int /* useconds */)> PageFlipCallback; 38 unsigned int /* useconds */)> PageFlipCallback;
39 39
40 DriWrapper(const char* device_path, bool software_mode); 40 DriWrapper(const char* device_path, bool use_sync_flips);
41 virtual ~DriWrapper(); 41 virtual ~DriWrapper();
42 42
43 // Open device. 43 // Open device.
44 virtual void Initialize(); 44 virtual void Initialize();
45 45
46 // Get the CRTC state. This is generally used to save state before using the 46 // Get the CRTC state. This is generally used to save state before using the
47 // CRTC. When the user finishes using the CRTC, the user should restore the 47 // CRTC. When the user finishes using the CRTC, the user should restore the
48 // CRTC to it's initial state. Use |SetCrtc| to restore the state. 48 // CRTC to it's initial state. Use |SetCrtc| to restore the state.
49 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id); 49 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id);
50 50
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // after the sandbox is up, thus the late initialization. 156 // after the sandbox is up, thus the late initialization.
157 virtual void InitializeIOWatcher(); 157 virtual void InitializeIOWatcher();
158 158
159 // The file descriptor associated with this wrapper. All DRM operations will 159 // The file descriptor associated with this wrapper. All DRM operations will
160 // be performed using this FD. 160 // be performed using this FD.
161 // TODO(dnicoara) Make this a base::File 161 // TODO(dnicoara) Make this a base::File
162 int fd_; 162 int fd_;
163 163
164 scoped_ptr<HardwareDisplayPlaneManager> plane_manager_; 164 scoped_ptr<HardwareDisplayPlaneManager> plane_manager_;
165 165
166 // If we're running in software mode this is true. In software mode we can't 166 // If we need to block when performing page flips this is set to true.
167 // use the async page flip callbacks, so we need to block until the kernel 167 bool use_sync_flips_;
168 // responds to the page flip.
169 bool software_mode_;
170 168
171 private: 169 private:
172 class IOWatcher; 170 class IOWatcher;
173 171
174 // Path to DRM device. 172 // Path to DRM device.
175 const char* device_path_; 173 const char* device_path_;
176 174
177 // Helper thread to perform IO listener operations. 175 // Helper thread to perform IO listener operations.
178 // TODO(dnicoara) This should really be supported by the main thread. 176 // TODO(dnicoara) This should really be supported by the main thread.
179 // Alternatively we should have a way to access the IO thread's task runner. 177 // Alternatively we should have a way to access the IO thread's task runner.
180 base::Thread io_thread_; 178 base::Thread io_thread_;
181 179
182 // Watcher for |fd_| listening for page flip events. 180 // Watcher for |fd_| listening for page flip events.
183 scoped_refptr<IOWatcher> watcher_; 181 scoped_refptr<IOWatcher> watcher_;
184 182
185 DISALLOW_COPY_AND_ASSIGN(DriWrapper); 183 DISALLOW_COPY_AND_ASSIGN(DriWrapper);
186 }; 184 };
187 185
188 } // namespace ui 186 } // namespace ui
189 187
190 #endif // UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_ 188 #endif // UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/dri/dri_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698