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

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

Issue 532873002: ozone: gbm: Fail earlier if device can't be opened (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 6 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
« 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 12 matching lines...) Expand all
23 namespace ui { 23 namespace ui {
24 24
25 // Wraps DRM calls into a nice interface. Used to provide different 25 // Wraps DRM calls into a nice interface. Used to provide different
26 // implementations of the DRM calls. For the actual implementation the DRM API 26 // implementations of the DRM calls. For the actual implementation the DRM API
27 // would be called. In unit tests this interface would be stubbed. 27 // would be called. In unit tests this interface would be stubbed.
28 class DriWrapper { 28 class DriWrapper {
29 public: 29 public:
30 DriWrapper(const char* device_path); 30 DriWrapper(const char* device_path);
31 virtual ~DriWrapper(); 31 virtual ~DriWrapper();
32 32
33 // Open device.
34 virtual void Initialize();
35
33 // Get the CRTC state. This is generally used to save state before using the 36 // Get the CRTC state. This is generally used to save state before using the
34 // CRTC. When the user finishes using the CRTC, the user should restore the 37 // CRTC. When the user finishes using the CRTC, the user should restore the
35 // CRTC to it's initial state. Use |SetCrtc| to restore the state. 38 // CRTC to it's initial state. Use |SetCrtc| to restore the state.
36 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id); 39 virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id);
37 40
38 // Used to configure CRTC with ID |crtc_id| to use the connector in 41 // Used to configure CRTC with ID |crtc_id| to use the connector in
39 // |connectors|. The CRTC will be configured with mode |mode| and will display 42 // |connectors|. The CRTC will be configured with mode |mode| and will display
40 // the framebuffer with ID |framebuffer|. Before being able to display the 43 // the framebuffer with ID |framebuffer|. Before being able to display the
41 // framebuffer, it should be registered with the CRTC using |AddFramebuffer|. 44 // framebuffer, it should be registered with the CRTC using |AddFramebuffer|.
42 virtual bool SetCrtc(uint32_t crtc_id, 45 virtual bool SetCrtc(uint32_t crtc_id,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void* pixels); 131 void* pixels);
129 132
130 int get_fd() const { return fd_; } 133 int get_fd() const { return fd_; }
131 134
132 protected: 135 protected:
133 // The file descriptor associated with this wrapper. All DRM operations will 136 // The file descriptor associated with this wrapper. All DRM operations will
134 // be performed using this FD. 137 // be performed using this FD.
135 int fd_; 138 int fd_;
136 139
137 private: 140 private:
141 // Path to DRM device.
142 const char* device_path_;
143
138 DISALLOW_COPY_AND_ASSIGN(DriWrapper); 144 DISALLOW_COPY_AND_ASSIGN(DriWrapper);
139 }; 145 };
140 146
141 } // namespace ui 147 } // namespace ui
142 148
143 #endif // UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_ 149 #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