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/drm/gpu/drm_device.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_device.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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 NULL); | 292 NULL); |
293 } | 293 } |
294 | 294 |
295 ScopedDrmConnectorPtr DrmDevice::GetConnector(uint32_t connector_id) { | 295 ScopedDrmConnectorPtr DrmDevice::GetConnector(uint32_t connector_id) { |
296 DCHECK(file_.IsValid()); | 296 DCHECK(file_.IsValid()); |
297 TRACE_EVENT1("drm", "DrmDevice::GetConnector", "connector", connector_id); | 297 TRACE_EVENT1("drm", "DrmDevice::GetConnector", "connector", connector_id); |
298 return ScopedDrmConnectorPtr( | 298 return ScopedDrmConnectorPtr( |
299 drmModeGetConnector(file_.GetPlatformFile(), connector_id)); | 299 drmModeGetConnector(file_.GetPlatformFile(), connector_id)); |
300 } | 300 } |
301 | 301 |
302 bool DrmDevice::AddFramebuffer(uint32_t width, | 302 bool DrmDevice::AddFramebuffer2(uint32_t width, |
303 uint32_t height, | 303 uint32_t height, |
304 uint8_t depth, | 304 uint32_t format, |
305 uint8_t bpp, | 305 uint32_t handles[4], |
306 uint32_t stride, | 306 uint32_t strides[4], |
307 uint32_t handle, | 307 uint32_t offsets[4], |
308 uint32_t* framebuffer) { | 308 uint32_t* framebuffer, |
309 uint32_t flags) { | |
309 DCHECK(file_.IsValid()); | 310 DCHECK(file_.IsValid()); |
310 TRACE_EVENT1("drm", "DrmDevice::AddFramebuffer", "handle", handle); | 311 TRACE_EVENT1("drm", "DrmDevice::AddFramebuffer", "handle", handles[0]); |
311 return !drmModeAddFB(file_.GetPlatformFile(), width, height, depth, bpp, | 312 return !drmModeAddFB2(file_.GetPlatformFile(), width, height, format, handles, |
312 stride, handle, framebuffer); | 313 strides, offsets, framebuffer, 0); |
kalyank
2015/11/06 17:30:26
we should set whatever is passed in |flags| here a
william.xie1
2015/11/06 18:24:02
Done.
| |
313 } | 314 } |
314 | 315 |
315 bool DrmDevice::RemoveFramebuffer(uint32_t framebuffer) { | 316 bool DrmDevice::RemoveFramebuffer(uint32_t framebuffer) { |
316 DCHECK(file_.IsValid()); | 317 DCHECK(file_.IsValid()); |
317 TRACE_EVENT1("drm", "DrmDevice::RemoveFramebuffer", "framebuffer", | 318 TRACE_EVENT1("drm", "DrmDevice::RemoveFramebuffer", "framebuffer", |
318 framebuffer); | 319 framebuffer); |
319 return !drmModeRmFB(file_.GetPlatformFile(), framebuffer); | 320 return !drmModeRmFB(file_.GetPlatformFile(), framebuffer); |
320 } | 321 } |
321 | 322 |
322 bool DrmDevice::PageFlip(uint32_t crtc_id, | 323 bool DrmDevice::PageFlip(uint32_t crtc_id, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 b.push_back(lut[i].b); | 536 b.push_back(lut[i].b); |
536 } | 537 } |
537 | 538 |
538 DCHECK(file_.IsValid()); | 539 DCHECK(file_.IsValid()); |
539 TRACE_EVENT0("drm", "DrmDevice::SetGamma"); | 540 TRACE_EVENT0("drm", "DrmDevice::SetGamma"); |
540 return (drmModeCrtcSetGamma(file_.GetPlatformFile(), crtc_id, r.size(), &r[0], | 541 return (drmModeCrtcSetGamma(file_.GetPlatformFile(), crtc_id, r.size(), &r[0], |
541 &g[0], &b[0]) == 0); | 542 &g[0], &b[0]) == 0); |
542 } | 543 } |
543 | 544 |
544 } // namespace ui | 545 } // namespace ui |
OLD | NEW |