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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 | 77 |
78 bool DriWrapper::SetCrtc(uint32_t crtc_id, | 78 bool DriWrapper::SetCrtc(uint32_t crtc_id, |
79 uint32_t framebuffer, | 79 uint32_t framebuffer, |
80 std::vector<uint32_t> connectors, | 80 std::vector<uint32_t> connectors, |
81 drmModeModeInfo* mode) { | 81 drmModeModeInfo* mode) { |
82 DCHECK(fd_ >= 0); | 82 DCHECK(fd_ >= 0); |
83 DCHECK(!connectors.empty()); | 83 DCHECK(!connectors.empty()); |
84 DCHECK(mode); | 84 DCHECK(mode); |
85 | 85 |
86 TRACE_EVENT1("dri", "DriWrapper::SetCrtc", | 86 TRACE_EVENT2("dri", |
87 "crtc", crtc_id); | 87 "DriWrapper::SetCrtc", |
| 88 "crtc", |
| 89 crtc_id, |
| 90 "size", |
| 91 gfx::Size(mode->hdisplay, mode->vdisplay).ToString()); |
88 return !drmModeSetCrtc(fd_, | 92 return !drmModeSetCrtc(fd_, |
89 crtc_id, | 93 crtc_id, |
90 framebuffer, | 94 framebuffer, |
91 0, | 95 0, |
92 0, | 96 0, |
93 vector_as_array(&connectors), | 97 vector_as_array(&connectors), |
94 connectors.size(), mode); | 98 connectors.size(), mode); |
95 } | 99 } |
96 | 100 |
97 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) { | 101 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) { |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 uint32_t stride, | 289 uint32_t stride, |
286 void* pixels) { | 290 void* pixels) { |
287 DCHECK(fd_ >= 0); | 291 DCHECK(fd_ >= 0); |
288 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); | 292 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); |
289 munmap(pixels, info.getSafeSize(stride)); | 293 munmap(pixels, info.getSafeSize(stride)); |
290 DrmDestroyDumbBuffer(fd_, handle); | 294 DrmDestroyDumbBuffer(fd_, handle); |
291 } | 295 } |
292 | 296 |
293 | 297 |
294 } // namespace ui | 298 } // namespace ui |
OLD | NEW |