| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 469   return ScopedDrmConnectorPtr( | 469   return ScopedDrmConnectorPtr( | 
| 470       drmModeGetConnector(file_.GetPlatformFile(), connector_id)); | 470       drmModeGetConnector(file_.GetPlatformFile(), connector_id)); | 
| 471 } | 471 } | 
| 472 | 472 | 
| 473 bool DrmDevice::AddFramebuffer2(uint32_t width, | 473 bool DrmDevice::AddFramebuffer2(uint32_t width, | 
| 474                                 uint32_t height, | 474                                 uint32_t height, | 
| 475                                 uint32_t format, | 475                                 uint32_t format, | 
| 476                                 uint32_t handles[4], | 476                                 uint32_t handles[4], | 
| 477                                 uint32_t strides[4], | 477                                 uint32_t strides[4], | 
| 478                                 uint32_t offsets[4], | 478                                 uint32_t offsets[4], | 
|  | 479                                 uint64_t modifiers[4], | 
| 479                                 uint32_t* framebuffer, | 480                                 uint32_t* framebuffer, | 
| 480                                 uint32_t flags) { | 481                                 uint32_t flags) { | 
| 481   DCHECK(file_.IsValid()); | 482   DCHECK(file_.IsValid()); | 
| 482   TRACE_EVENT1("drm", "DrmDevice::AddFramebuffer", "handle", handles[0]); | 483   TRACE_EVENT1("drm", "DrmDevice::AddFramebuffer", "handle", handles[0]); | 
| 483   return !drmModeAddFB2(file_.GetPlatformFile(), width, height, format, handles, | 484   return !drmModeAddFB2WithModifiers(file_.GetPlatformFile(), width, height, | 
| 484                         strides, offsets, framebuffer, flags); | 485                                      format, handles, strides, offsets, | 
|  | 486                                      modifiers, framebuffer, flags); | 
| 485 } | 487 } | 
| 486 | 488 | 
| 487 bool DrmDevice::RemoveFramebuffer(uint32_t framebuffer) { | 489 bool DrmDevice::RemoveFramebuffer(uint32_t framebuffer) { | 
| 488   DCHECK(file_.IsValid()); | 490   DCHECK(file_.IsValid()); | 
| 489   TRACE_EVENT1("drm", "DrmDevice::RemoveFramebuffer", "framebuffer", | 491   TRACE_EVENT1("drm", "DrmDevice::RemoveFramebuffer", "framebuffer", | 
| 490                framebuffer); | 492                framebuffer); | 
| 491   return !drmModeRmFB(file_.GetPlatformFile(), framebuffer); | 493   return !drmModeRmFB(file_.GetPlatformFile(), framebuffer); | 
| 492 } | 494 } | 
| 493 | 495 | 
| 494 bool DrmDevice::PageFlip(uint32_t crtc_id, | 496 bool DrmDevice::PageFlip(uint32_t crtc_id, | 
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 812               reinterpret_cast<unsigned char*>(ctm_blob_data.get()), | 814               reinterpret_cast<unsigned char*>(ctm_blob_data.get()), | 
| 813               sizeof(DrmColorCtm))) | 815               sizeof(DrmColorCtm))) | 
| 814         return false; | 816         return false; | 
| 815     } | 817     } | 
| 816   } | 818   } | 
| 817 | 819 | 
| 818   return true; | 820   return true; | 
| 819 } | 821 } | 
| 820 | 822 | 
| 821 }  // namespace ui | 823 }  // namespace ui | 
| OLD | NEW | 
|---|