| 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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 page_flip_manager_->RegisterCallback(id, crtc_count, callback); | 663 page_flip_manager_->RegisterCallback(id, crtc_count, callback); |
| 664 | 664 |
| 665 return true; | 665 return true; |
| 666 } | 666 } |
| 667 #endif // defined(USE_DRM_ATOMIC) | 667 #endif // defined(USE_DRM_ATOMIC) |
| 668 return false; | 668 return false; |
| 669 } | 669 } |
| 670 | 670 |
| 671 bool DrmDevice::SetCapability(uint64_t capability, uint64_t value) { | 671 bool DrmDevice::SetCapability(uint64_t capability, uint64_t value) { |
| 672 DCHECK(file_.IsValid()); | 672 DCHECK(file_.IsValid()); |
| 673 return !drmSetClientCap(file_.GetPlatformFile(), capability, value); | 673 |
| 674 #ifndef DRM_IOCTL_SET_CLIENT_CAP |
| 675 // drmSetClientCap was introduced in a later version of libdrm than the wheezy |
| 676 // sysroot supplies. |
| 677 // TODO(thomasanderson): Remove this when support for the wheezy sysroot is |
| 678 // dropped in favor of jessie. |
| 679 #define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW(0x0d, struct drm_set_client_cap) |
| 680 struct drm_set_client_cap { |
| 681 __u64 capability; |
| 682 __u64 value; |
| 683 }; |
| 684 #endif |
| 685 |
| 686 struct drm_set_client_cap cap = {capability, value}; |
| 687 return !drmIoctl(file_.GetPlatformFile(), DRM_IOCTL_SET_CLIENT_CAP, &cap); |
| 674 } | 688 } |
| 675 | 689 |
| 676 bool DrmDevice::SetMaster() { | 690 bool DrmDevice::SetMaster() { |
| 677 TRACE_EVENT1("drm", "DrmDevice::SetMaster", "path", device_path_.value()); | 691 TRACE_EVENT1("drm", "DrmDevice::SetMaster", "path", device_path_.value()); |
| 678 DCHECK(file_.IsValid()); | 692 DCHECK(file_.IsValid()); |
| 679 return (drmSetMaster(file_.GetPlatformFile()) == 0); | 693 return (drmSetMaster(file_.GetPlatformFile()) == 0); |
| 680 } | 694 } |
| 681 | 695 |
| 682 bool DrmDevice::DropMaster() { | 696 bool DrmDevice::DropMaster() { |
| 683 TRACE_EVENT1("drm", "DrmDevice::DropMaster", "path", device_path_.value()); | 697 TRACE_EVENT1("drm", "DrmDevice::DropMaster", "path", device_path_.value()); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), | 812 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), |
| 799 sizeof(DrmColorCtm))) | 813 sizeof(DrmColorCtm))) |
| 800 return false; | 814 return false; |
| 801 } | 815 } |
| 802 } | 816 } |
| 803 | 817 |
| 804 return true; | 818 return true; |
| 805 } | 819 } |
| 806 | 820 |
| 807 } // namespace ui | 821 } // namespace ui |
| OLD | NEW |