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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 &crtc->mode); | 114 &crtc->mode); |
115 } | 115 } |
116 | 116 |
117 bool DriWrapper::DisableCrtc(uint32_t crtc_id) { | 117 bool DriWrapper::DisableCrtc(uint32_t crtc_id) { |
118 DCHECK(fd_ >= 0); | 118 DCHECK(fd_ >= 0); |
119 TRACE_EVENT1("dri", "DriWrapper::DisableCrtc", | 119 TRACE_EVENT1("dri", "DriWrapper::DisableCrtc", |
120 "crtc", crtc_id); | 120 "crtc", crtc_id); |
121 return !drmModeSetCrtc(fd_, crtc_id, 0, 0, 0, NULL, 0, NULL); | 121 return !drmModeSetCrtc(fd_, crtc_id, 0, 0, 0, NULL, 0, NULL); |
122 } | 122 } |
123 | 123 |
| 124 ScopedDrmConnectorPtr DriWrapper::GetConnector(uint32_t connector_id) { |
| 125 DCHECK(fd_ >= 0); |
| 126 TRACE_EVENT1("dri", "DriWrapper::GetConnector", "connector", connector_id); |
| 127 return ScopedDrmConnectorPtr(drmModeGetConnector(fd_, connector_id)); |
| 128 } |
| 129 |
124 bool DriWrapper::AddFramebuffer(uint32_t width, | 130 bool DriWrapper::AddFramebuffer(uint32_t width, |
125 uint32_t height, | 131 uint32_t height, |
126 uint8_t depth, | 132 uint8_t depth, |
127 uint8_t bpp, | 133 uint8_t bpp, |
128 uint32_t stride, | 134 uint32_t stride, |
129 uint32_t handle, | 135 uint32_t handle, |
130 uint32_t* framebuffer) { | 136 uint32_t* framebuffer) { |
131 DCHECK(fd_ >= 0); | 137 DCHECK(fd_ >= 0); |
132 TRACE_EVENT1("dri", "DriWrapper::AddFramebuffer", | 138 TRACE_EVENT1("dri", "DriWrapper::AddFramebuffer", |
133 "handle", handle); | 139 "handle", handle); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 uint32_t stride, | 285 uint32_t stride, |
280 void* pixels) { | 286 void* pixels) { |
281 DCHECK(fd_ >= 0); | 287 DCHECK(fd_ >= 0); |
282 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); | 288 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); |
283 munmap(pixels, info.getSafeSize(stride)); | 289 munmap(pixels, info.getSafeSize(stride)); |
284 DrmDestroyDumbBuffer(fd_, handle); | 290 DrmDestroyDumbBuffer(fd_, handle); |
285 } | 291 } |
286 | 292 |
287 | 293 |
288 } // namespace ui | 294 } // namespace ui |
OLD | NEW |