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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 page_flip_manager_->RegisterCallback(id, crtc_count, callback); | 672 page_flip_manager_->RegisterCallback(id, crtc_count, callback); |
673 | 673 |
674 return true; | 674 return true; |
675 } | 675 } |
676 return false; | 676 return false; |
677 } | 677 } |
678 | 678 |
679 bool DrmDevice::SetCapability(uint64_t capability, uint64_t value) { | 679 bool DrmDevice::SetCapability(uint64_t capability, uint64_t value) { |
680 DCHECK(file_.IsValid()); | 680 DCHECK(file_.IsValid()); |
681 | 681 |
682 #ifndef DRM_IOCTL_SET_CLIENT_CAP | |
683 // drmSetClientCap was introduced in a later version of libdrm than the wheezy | |
684 // sysroot supplies. | |
685 // TODO(thomasanderson): Remove this when support for the wheezy sysroot is | |
686 // dropped in favor of jessie. | |
687 #define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW(0x0d, struct drm_set_client_cap) | |
688 struct drm_set_client_cap { | |
689 __u64 capability; | |
690 __u64 value; | |
691 }; | |
692 #endif | |
693 | |
694 struct drm_set_client_cap cap = {capability, value}; | 682 struct drm_set_client_cap cap = {capability, value}; |
695 return !drmIoctl(file_.GetPlatformFile(), DRM_IOCTL_SET_CLIENT_CAP, &cap); | 683 return !drmIoctl(file_.GetPlatformFile(), DRM_IOCTL_SET_CLIENT_CAP, &cap); |
696 } | 684 } |
697 | 685 |
698 bool DrmDevice::SetMaster() { | 686 bool DrmDevice::SetMaster() { |
699 TRACE_EVENT1("drm", "DrmDevice::SetMaster", "path", device_path_.value()); | 687 TRACE_EVENT1("drm", "DrmDevice::SetMaster", "path", device_path_.value()); |
700 DCHECK(file_.IsValid()); | 688 DCHECK(file_.IsValid()); |
701 return (drmSetMaster(file_.GetPlatformFile()) == 0); | 689 return (drmSetMaster(file_.GetPlatformFile()) == 0); |
702 } | 690 } |
703 | 691 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), | 809 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), |
822 sizeof(DrmColorCtm))) | 810 sizeof(DrmColorCtm))) |
823 return false; | 811 return false; |
824 } | 812 } |
825 } | 813 } |
826 | 814 |
827 return true; | 815 return true; |
828 } | 816 } |
829 | 817 |
830 } // namespace ui | 818 } // namespace ui |
OLD | NEW |