| 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 // If successful the payload will be removed by the event | 568 // If successful the payload will be removed by the event |
| 569 ignore_result(payload.release()); | 569 ignore_result(payload.release()); |
| 570 return true; | 570 return true; |
| 571 } | 571 } |
| 572 return false; | 572 return false; |
| 573 #else | 573 #else |
| 574 return false; | 574 return false; |
| 575 #endif // defined(USE_DRM_ATOMIC) | 575 #endif // defined(USE_DRM_ATOMIC) |
| 576 } | 576 } |
| 577 | 577 |
| 578 bool DrmDevice::SetCapability(uint64_t capability, uint64_t value) { |
| 579 DCHECK(file_.IsValid()); |
| 580 #if defined(IS_DEVICE_BUILD) |
| 581 return !drmSetClientCap(file_.GetPlatformFile(), capability, value); |
| 582 #else |
| 583 return false; |
| 584 #endif // defined(IS_DEVICE_BUILD) |
| 585 } |
| 586 |
| 578 bool DrmDevice::SetMaster() { | 587 bool DrmDevice::SetMaster() { |
| 579 DCHECK(file_.IsValid()); | 588 DCHECK(file_.IsValid()); |
| 580 return (drmSetMaster(file_.GetPlatformFile()) == 0); | 589 return (drmSetMaster(file_.GetPlatformFile()) == 0); |
| 581 } | 590 } |
| 582 | 591 |
| 583 bool DrmDevice::DropMaster() { | 592 bool DrmDevice::DropMaster() { |
| 584 DCHECK(file_.IsValid()); | 593 DCHECK(file_.IsValid()); |
| 585 return (drmDropMaster(file_.GetPlatformFile()) == 0); | 594 return (drmDropMaster(file_.GetPlatformFile()) == 0); |
| 586 } | 595 } |
| 587 | 596 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 607 b.push_back(lut[i].b); | 616 b.push_back(lut[i].b); |
| 608 } | 617 } |
| 609 | 618 |
| 610 DCHECK(file_.IsValid()); | 619 DCHECK(file_.IsValid()); |
| 611 TRACE_EVENT0("drm", "DrmDevice::SetGamma"); | 620 TRACE_EVENT0("drm", "DrmDevice::SetGamma"); |
| 612 return (drmModeCrtcSetGamma(file_.GetPlatformFile(), crtc_id, r.size(), &r[0], | 621 return (drmModeCrtcSetGamma(file_.GetPlatformFile(), crtc_id, r.size(), &r[0], |
| 613 &g[0], &b[0]) == 0); | 622 &g[0], &b[0]) == 0); |
| 614 } | 623 } |
| 615 | 624 |
| 616 } // namespace ui | 625 } // namespace ui |
| OLD | NEW |