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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 bool DrmDevice::SetMaster() { | 497 bool DrmDevice::SetMaster() { |
498 DCHECK(file_.IsValid()); | 498 DCHECK(file_.IsValid()); |
499 return (drmSetMaster(file_.GetPlatformFile()) == 0); | 499 return (drmSetMaster(file_.GetPlatformFile()) == 0); |
500 } | 500 } |
501 | 501 |
502 bool DrmDevice::DropMaster() { | 502 bool DrmDevice::DropMaster() { |
503 DCHECK(file_.IsValid()); | 503 DCHECK(file_.IsValid()); |
504 return (drmDropMaster(file_.GetPlatformFile()) == 0); | 504 return (drmDropMaster(file_.GetPlatformFile()) == 0); |
505 } | 505 } |
506 | 506 |
| 507 bool DrmDevice::SetGammaRamp(uint32_t crtc_id, |
| 508 const std::vector<uint16_t>& r, |
| 509 const std::vector<uint16_t>& g, |
| 510 const std::vector<uint16_t>& b) { |
| 511 DCHECK(file_.IsValid()); |
| 512 TRACE_EVENT0("drm", "DrmDevice::SetGamma"); |
| 513 return (drmModeCrtcSetGamma(file_.GetPlatformFile(), crtc_id, r.size(), |
| 514 const_cast<uint16_t*>(&r[0]), |
| 515 const_cast<uint16_t*>(&g[0]), |
| 516 const_cast<uint16_t*>(&b[0])) == 0); |
| 517 } |
| 518 |
507 } // namespace ui | 519 } // namespace ui |
OLD | NEW |