| 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_EVENT2("dri", | 92 TRACE_EVENT1("dri", "DriWrapper::SetCrtc", |
| 93 "DriWrapper::SetCrtc", | 93 "crtc", crtc_id); |
| 94 "crtc", | |
| 95 crtc_id, | |
| 96 "size", | |
| 97 gfx::Size(mode->hdisplay, mode->vdisplay).ToString()); | |
| 98 return !drmModeSetCrtc(fd_, | 94 return !drmModeSetCrtc(fd_, |
| 99 crtc_id, | 95 crtc_id, |
| 100 framebuffer, | 96 framebuffer, |
| 101 0, | 97 0, |
| 102 0, | 98 0, |
| 103 vector_as_array(&connectors), | 99 vector_as_array(&connectors), |
| 104 connectors.size(), mode); | 100 connectors.size(), mode); |
| 105 } | 101 } |
| 106 | 102 |
| 107 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) { | 103 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 uint32_t stride, | 291 uint32_t stride, |
| 296 void* pixels) { | 292 void* pixels) { |
| 297 DCHECK(fd_ >= 0); | 293 DCHECK(fd_ >= 0); |
| 298 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); | 294 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); |
| 299 munmap(pixels, info.getSafeSize(stride)); | 295 munmap(pixels, info.getSafeSize(stride)); |
| 300 DrmDestroyDumbBuffer(fd_, handle); | 296 DrmDestroyDumbBuffer(fd_, handle); |
| 301 } | 297 } |
| 302 | 298 |
| 303 | 299 |
| 304 } // namespace ui | 300 } // namespace ui |
| OLD | NEW |