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 #include "ui/ozone/platform/dri/dri_wrapper.h" | 5 #include "ui/ozone/platform/dri/dri_wrapper.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 bool DriWrapper::SetCrtc(uint32_t crtc_id, | 84 bool DriWrapper::SetCrtc(uint32_t crtc_id, |
85 uint32_t framebuffer, | 85 uint32_t framebuffer, |
86 std::vector<uint32_t> connectors, | 86 std::vector<uint32_t> connectors, |
87 drmModeModeInfo* mode) { | 87 drmModeModeInfo* mode) { |
88 DCHECK(fd_ >= 0); | 88 DCHECK(fd_ >= 0); |
89 DCHECK(!connectors.empty()); | 89 DCHECK(!connectors.empty()); |
90 DCHECK(mode); | 90 DCHECK(mode); |
91 | 91 |
92 TRACE_EVENT1("dri", "DriWrapper::SetCrtc", | 92 TRACE_EVENT2("dri", |
93 "crtc", crtc_id); | 93 "DriWrapper::SetCrtc", |
| 94 "crtc", |
| 95 crtc_id, |
| 96 "size", |
| 97 gfx::Size(mode->hdisplay, mode->vdisplay).ToString()); |
94 return !drmModeSetCrtc(fd_, | 98 return !drmModeSetCrtc(fd_, |
95 crtc_id, | 99 crtc_id, |
96 framebuffer, | 100 framebuffer, |
97 0, | 101 0, |
98 0, | 102 0, |
99 vector_as_array(&connectors), | 103 vector_as_array(&connectors), |
100 connectors.size(), mode); | 104 connectors.size(), mode); |
101 } | 105 } |
102 | 106 |
103 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) { | 107 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) { |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 uint32_t stride, | 295 uint32_t stride, |
292 void* pixels) { | 296 void* pixels) { |
293 DCHECK(fd_ >= 0); | 297 DCHECK(fd_ >= 0); |
294 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); | 298 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); |
295 munmap(pixels, info.getSafeSize(stride)); | 299 munmap(pixels, info.getSafeSize(stride)); |
296 DrmDestroyDumbBuffer(fd_, handle); | 300 DrmDestroyDumbBuffer(fd_, handle); |
297 } | 301 } |
298 | 302 |
299 | 303 |
300 } // namespace ui | 304 } // namespace ui |
OLD | NEW |