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

Side by Side Diff: ui/ozone/platform/dri/dri_util.cc

Issue 908993003: [Ozone-Dri] Rename DriWrapper to DrmDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@udl3-pass-drm-fd
Patch Set: rebased Created 5 years, 9 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 | « ui/ozone/platform/dri/dri_util.h ('k') | ui/ozone/platform/dri/dri_window_delegate_impl.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 #include "base/strings/stringprintf.h"
6 #include "ui/ozone/platform/dri/dri_util.h" 5 #include "ui/ozone/platform/dri/dri_util.h"
7 6
8 #include <errno.h> 7 #include <errno.h>
9 #include <fcntl.h> 8 #include <fcntl.h>
10 #include <stdint.h> 9 #include <stdint.h>
11 #include <stdlib.h> 10 #include <stdlib.h>
12 #include <sys/mman.h> 11 #include <sys/mman.h>
13 #include <xf86drm.h> 12 #include <xf86drm.h>
14 #include <xf86drmMode.h> 13 #include <xf86drmMode.h>
15 14
16 #include "ui/ozone/platform/dri/dri_wrapper.h" 15 #include "base/strings/stringprintf.h"
16 #include "ui/ozone/platform/dri/drm_device.h"
17 #include "ui/ozone/platform/dri/screen_manager.h" 17 #include "ui/ozone/platform/dri/screen_manager.h"
18 18
19 namespace ui { 19 namespace ui {
20 20
21 namespace { 21 namespace {
22 22
23 const char kDefaultGraphicsCardPattern[] = "/dev/dri/card%d"; 23 const char kDefaultGraphicsCardPattern[] = "/dev/dri/card%d";
24 24
25 bool IsCrtcInUse(uint32_t crtc, 25 bool IsCrtcInUse(uint32_t crtc,
26 const ScopedVector<HardwareDisplayControllerInfo>& displays) { 26 const ScopedVector<HardwareDisplayControllerInfo>& displays) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 fd, 135 fd,
136 map_request.offset); 136 map_request.offset);
137 if (*pixels == MAP_FAILED) { 137 if (*pixels == MAP_FAILED) {
138 VLOG(2) << "Cannot mmap dumb buffer (" << errno << ") " << strerror(errno); 138 VLOG(2) << "Cannot mmap dumb buffer (" << errno << ") " << strerror(errno);
139 return false; 139 return false;
140 } 140 }
141 141
142 return true; 142 return true;
143 } 143 }
144 144
145 void ForceInitializationOfPrimaryDisplay(const scoped_refptr<DriWrapper>& drm, 145 void ForceInitializationOfPrimaryDisplay(const scoped_refptr<DrmDevice>& drm,
146 ScreenManager* screen_manager) { 146 ScreenManager* screen_manager) {
147 LOG(WARNING) << "Forcing initialization of primary display."; 147 LOG(WARNING) << "Forcing initialization of primary display.";
148 ScopedVector<HardwareDisplayControllerInfo> displays = 148 ScopedVector<HardwareDisplayControllerInfo> displays =
149 GetAvailableDisplayControllerInfos(drm->get_fd()); 149 GetAvailableDisplayControllerInfos(drm->get_fd());
150 150
151 if (displays.empty()) 151 if (displays.empty())
152 return; 152 return;
153 153
154 ScopedDrmPropertyPtr dpms(drm->GetProperty(displays[0]->connector(), "DPMS")); 154 ScopedDrmPropertyPtr dpms(drm->GetProperty(displays[0]->connector(), "DPMS"));
155 155
(...skipping 26 matching lines...) Expand all
182 close(fd); 182 close(fd);
183 if (ret == 0 && res.count_crtcs > 0) { 183 if (ret == 0 && res.count_crtcs > 0) {
184 return base::FilePath(card_path); 184 return base::FilePath(card_path);
185 } 185 }
186 } 186 }
187 187
188 return base::FilePath(); 188 return base::FilePath();
189 } 189 }
190 190
191 } // namespace ui 191 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_util.h ('k') | ui/ozone/platform/dri/dri_window_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698