Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Alexandru Gheorghe | 0f5abd7 | 2018-05-01 14:37:10 +0100 | [diff] [blame] | 17 | #define LOG_TAG "hwc-drm-device" |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 18 | |
Roman Stratiienko | 13cc366 | 2020-08-29 21:35:39 +0300 | [diff] [blame] | 19 | #include "DrmDevice.h" |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 20 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 21 | #include <fcntl.h> |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 22 | #include <xf86drm.h> |
| 23 | #include <xf86drmMode.h> |
| 24 | |
Roman Kovalivskyi | d07c370 | 2019-11-04 17:54:31 +0200 | [diff] [blame] | 25 | #include <algorithm> |
| 26 | #include <array> |
Roman Stratiienko | e2f2c92 | 2021-02-13 10:57:47 +0200 | [diff] [blame] | 27 | #include <cerrno> |
Roman Stratiienko | 13cc366 | 2020-08-29 21:35:39 +0300 | [diff] [blame] | 28 | #include <cinttypes> |
Roman Stratiienko | e2f2c92 | 2021-02-13 10:57:47 +0200 | [diff] [blame] | 29 | #include <cstdint> |
Roman Stratiienko | b2e9fe2 | 2020-10-03 10:52:36 +0300 | [diff] [blame] | 30 | #include <sstream> |
Roman Kovalivskyi | d07c370 | 2019-11-04 17:54:31 +0200 | [diff] [blame] | 31 | #include <string> |
| 32 | |
Roman Stratiienko | 19c162f | 2022-02-01 09:35:08 +0200 | [diff] [blame^] | 33 | #include "compositor/DrmDisplayCompositor.h" |
Roman Stratiienko | 24a7fc4 | 2021-12-23 16:25:20 +0200 | [diff] [blame] | 34 | #include "drm/DrmPlane.h" |
Roman Stratiienko | d518a05 | 2021-02-25 19:15:14 +0200 | [diff] [blame] | 35 | #include "utils/log.h" |
| 36 | #include "utils/properties.h" |
| 37 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 38 | namespace android { |
| 39 | |
Roman Stratiienko | 1e053b4 | 2021-10-25 22:54:20 +0300 | [diff] [blame] | 40 | DrmDevice::DrmDevice() { |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 41 | drm_fb_importer_ = std::make_unique<DrmFbImporter>(*this); |
Sean Paul | 047b9b2 | 2015-07-28 14:15:42 -0400 | [diff] [blame] | 42 | } |
| 43 | |
Roman Stratiienko | 5f2f3ce | 2021-12-22 11:46:03 +0200 | [diff] [blame] | 44 | // NOLINTNEXTLINE (readability-function-cognitive-complexity): Fixme |
Alexandru Gheorghe | c546358 | 2018-03-27 15:52:02 +0100 | [diff] [blame] | 45 | std::tuple<int, int> DrmDevice::Init(const char *path, int num_displays) { |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 46 | /* TODO: Use drmOpenControl here instead */ |
Roman Stratiienko | 0fade37 | 2021-02-20 13:59:55 +0200 | [diff] [blame] | 47 | fd_ = UniqueFd(open(path, O_RDWR | O_CLOEXEC)); |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 48 | if (!fd_) { |
Roman Stratiienko | 5f2f3ce | 2021-12-22 11:46:03 +0200 | [diff] [blame] | 49 | // NOLINTNEXTLINE(concurrency-mt-unsafe): Fixme |
Peter Collingbourne | c77052e | 2020-02-19 11:25:08 -0800 | [diff] [blame] | 50 | ALOGE("Failed to open dri %s: %s", path, strerror(errno)); |
Alexandru Gheorghe | c546358 | 2018-03-27 15:52:02 +0100 | [diff] [blame] | 51 | return std::make_tuple(-ENODEV, 0); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 52 | } |
| 53 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 54 | int ret = drmSetClientCap(GetFd(), DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); |
| 55 | if (ret != 0) { |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 56 | ALOGE("Failed to set universal plane cap %d", ret); |
Alexandru Gheorghe | c546358 | 2018-03-27 15:52:02 +0100 | [diff] [blame] | 57 | return std::make_tuple(ret, 0); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 58 | } |
| 59 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 60 | ret = drmSetClientCap(GetFd(), DRM_CLIENT_CAP_ATOMIC, 1); |
| 61 | if (ret != 0) { |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 62 | ALOGE("Failed to set atomic cap %d", ret); |
Alexandru Gheorghe | c546358 | 2018-03-27 15:52:02 +0100 | [diff] [blame] | 63 | return std::make_tuple(ret, 0); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 64 | } |
| 65 | |
Alexandru Gheorghe | b46b930 | 2018-03-21 14:19:58 +0000 | [diff] [blame] | 66 | #ifdef DRM_CLIENT_CAP_WRITEBACK_CONNECTORS |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 67 | ret = drmSetClientCap(GetFd(), DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1); |
| 68 | if (ret != 0) { |
Alexandru Gheorghe | b46b930 | 2018-03-21 14:19:58 +0000 | [diff] [blame] | 69 | ALOGI("Failed to set writeback cap %d", ret); |
Alexandru Gheorghe | b46b930 | 2018-03-21 14:19:58 +0000 | [diff] [blame] | 70 | } |
| 71 | #endif |
| 72 | |
Roman Stratiienko | 8666dc9 | 2021-02-09 17:49:55 +0200 | [diff] [blame] | 73 | uint64_t cap_value = 0; |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 74 | if (drmGetCap(GetFd(), DRM_CAP_ADDFB2_MODIFIERS, &cap_value) != 0) { |
Roman Stratiienko | 8666dc9 | 2021-02-09 17:49:55 +0200 | [diff] [blame] | 75 | ALOGW("drmGetCap failed. Fallback to no modifier support."); |
| 76 | cap_value = 0; |
| 77 | } |
| 78 | HasAddFb2ModifiersSupport_ = cap_value != 0; |
| 79 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 80 | drmSetMaster(GetFd()); |
| 81 | if (drmIsMaster(GetFd()) == 0) { |
John Stultz | fa00233 | 2021-02-02 01:34:45 +0000 | [diff] [blame] | 82 | ALOGE("DRM/KMS master access required"); |
| 83 | return std::make_tuple(-EACCES, 0); |
Roman Stratiienko | 3b24cd9 | 2021-01-13 10:32:04 +0200 | [diff] [blame] | 84 | } |
| 85 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 86 | auto res = MakeDrmModeResUnique(GetFd()); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 87 | if (!res) { |
Alexandru Gheorghe | 0f5abd7 | 2018-05-01 14:37:10 +0100 | [diff] [blame] | 88 | ALOGE("Failed to get DrmDevice resources"); |
Alexandru Gheorghe | c546358 | 2018-03-27 15:52:02 +0100 | [diff] [blame] | 89 | return std::make_tuple(-ENODEV, 0); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 90 | } |
| 91 | |
Sean Paul | f72cccd | 2018-08-27 13:59:08 -0400 | [diff] [blame] | 92 | min_resolution_ = std::pair<uint32_t, uint32_t>(res->min_width, |
| 93 | res->min_height); |
| 94 | max_resolution_ = std::pair<uint32_t, uint32_t>(res->max_width, |
| 95 | res->max_height); |
Sean Paul | 406dbfc | 2016-02-10 15:35:17 -0800 | [diff] [blame] | 96 | |
Roman Stratiienko | 10be875 | 2022-01-30 20:28:46 +0200 | [diff] [blame] | 97 | for (int i = 0; i < res->count_crtcs; ++i) { |
| 98 | // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) |
| 99 | auto crtc = DrmCrtc::CreateInstance(*this, res->crtcs[i], i); |
| 100 | if (crtc) { |
| 101 | crtcs_.emplace_back(std::move(crtc)); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 102 | } |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 103 | } |
| 104 | |
Roman Stratiienko | 027987b | 2022-01-30 21:06:35 +0200 | [diff] [blame] | 105 | for (int i = 0; i < res->count_encoders; ++i) { |
| 106 | // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) |
| 107 | auto enc = DrmEncoder::CreateInstance(*this, res->encoders[i], i); |
| 108 | if (enc) { |
| 109 | encoders_.emplace_back(std::move(enc)); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 110 | } |
Alexandru Gheorghe | e8b668c | 2018-03-22 11:31:29 +0000 | [diff] [blame] | 111 | } |
| 112 | |
Roman Stratiienko | 650299a | 2022-01-30 23:46:10 +0200 | [diff] [blame] | 113 | for (int i = 0; i < res->count_connectors; ++i) { |
| 114 | // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) |
| 115 | auto conn = DrmConnector::CreateInstance(*this, res->connectors[i], i); |
| 116 | |
| 117 | if (!conn) { |
| 118 | continue; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 119 | } |
| 120 | |
Roman Stratiienko | 650299a | 2022-01-30 23:46:10 +0200 | [diff] [blame] | 121 | if (conn->IsWriteback()) { |
Alexandru Gheorghe | b46b930 | 2018-03-21 14:19:58 +0000 | [diff] [blame] | 122 | writeback_connectors_.emplace_back(std::move(conn)); |
Roman Stratiienko | 650299a | 2022-01-30 23:46:10 +0200 | [diff] [blame] | 123 | } else { |
Alexandru Gheorghe | b46b930 | 2018-03-21 14:19:58 +0000 | [diff] [blame] | 124 | connectors_.emplace_back(std::move(conn)); |
Roman Stratiienko | 650299a | 2022-01-30 23:46:10 +0200 | [diff] [blame] | 125 | } |
Robert Foss | 610d989 | 2017-11-01 12:50:04 -0500 | [diff] [blame] | 126 | } |
| 127 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 128 | auto plane_res = MakeDrmModePlaneResUnique(GetFd()); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 129 | if (!plane_res) { |
| 130 | ALOGE("Failed to get plane resources"); |
Alexandru Gheorghe | c546358 | 2018-03-27 15:52:02 +0100 | [diff] [blame] | 131 | return std::make_tuple(-ENOENT, 0); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | for (uint32_t i = 0; i < plane_res->count_planes; ++i) { |
Roman Stratiienko | b671fab | 2022-01-29 00:50:22 +0200 | [diff] [blame] | 135 | // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) |
| 136 | auto plane = DrmPlane::CreateInstance(*this, plane_res->planes[i]); |
| 137 | |
| 138 | if (plane) { |
| 139 | planes_.emplace_back(std::move(plane)); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 140 | } |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 141 | } |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 142 | |
Roman Stratiienko | cad8e0c | 2022-01-31 16:40:16 +0200 | [diff] [blame] | 143 | auto add_displays = [this, &num_displays](bool internal, bool connected) { |
| 144 | for (auto &conn : connectors_) { |
| 145 | bool is_connected = conn->IsConnected(); |
| 146 | if ((internal ? conn->IsInternal() : conn->IsExternal()) && |
| 147 | (connected ? is_connected : !is_connected)) { |
| 148 | auto pipe = DrmDisplayPipeline::CreatePipeline(*conn); |
| 149 | if (pipe) { |
| 150 | pipelines_[num_displays] = std::move(pipe); |
| 151 | ++num_displays; |
| 152 | } |
| 153 | } |
Sean Paul | 5735541 | 2015-09-19 09:14:34 -0400 | [diff] [blame] | 154 | } |
Roman Stratiienko | cad8e0c | 2022-01-31 16:40:16 +0200 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | /* Put internal first to ensure Primary display will be internal |
| 158 | * in case at least 1 internal is available |
| 159 | */ |
| 160 | add_displays(/*internal = */ true, /*connected = */ true); |
| 161 | add_displays(/*internal = */ false, /*connected = */ true); |
| 162 | add_displays(/*internal = */ true, /*connected = */ false); |
| 163 | add_displays(/*internal = */ false, /*connected = */ false); |
| 164 | |
| 165 | return std::make_tuple(0, pipelines_.size()); |
Alexandru Gheorghe | c546358 | 2018-03-27 15:52:02 +0100 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | bool DrmDevice::HandlesDisplay(int display) const { |
Roman Stratiienko | cad8e0c | 2022-01-31 16:40:16 +0200 | [diff] [blame] | 169 | return pipelines_.count(display) != 0; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 170 | } |
| 171 | |
Roman Stratiienko | cad8e0c | 2022-01-31 16:40:16 +0200 | [diff] [blame] | 172 | auto DrmDevice::GetDisplayId(DrmConnector *conn) -> int { |
| 173 | for (auto &dpipe : pipelines_) { |
| 174 | if (dpipe.second->connector->Get() == conn) { |
| 175 | return dpipe.first; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 176 | } |
| 177 | } |
Roman Stratiienko | cad8e0c | 2022-01-31 16:40:16 +0200 | [diff] [blame] | 178 | return -1; |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 179 | } |
| 180 | |
Roman Stratiienko | 6ede466 | 2021-09-30 10:18:28 +0300 | [diff] [blame] | 181 | auto DrmDevice::RegisterUserPropertyBlob(void *data, size_t length) const |
| 182 | -> DrmModeUserPropertyBlobUnique { |
Roman Stratiienko | b3b5c1e | 2021-02-15 13:44:19 +0200 | [diff] [blame] | 183 | struct drm_mode_create_blob create_blob {}; |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 184 | create_blob.length = length; |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 185 | // NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 186 | create_blob.data = (__u64)data; |
| 187 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 188 | int ret = drmIoctl(GetFd(), DRM_IOCTL_MODE_CREATEPROPBLOB, &create_blob); |
| 189 | if (ret != 0) { |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 190 | ALOGE("Failed to create mode property blob %d", ret); |
Roman Stratiienko | 780f7da | 2022-01-10 16:04:15 +0200 | [diff] [blame] | 191 | return {}; |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 192 | } |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 193 | |
Roman Stratiienko | 6ede466 | 2021-09-30 10:18:28 +0300 | [diff] [blame] | 194 | return DrmModeUserPropertyBlobUnique( |
| 195 | new uint32_t(create_blob.blob_id), [this](const uint32_t *it) { |
| 196 | struct drm_mode_destroy_blob destroy_blob {}; |
| 197 | destroy_blob.blob_id = (__u32)*it; |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 198 | int err = drmIoctl(GetFd(), DRM_IOCTL_MODE_DESTROYPROPBLOB, |
| 199 | &destroy_blob); |
Roman Stratiienko | 6ede466 | 2021-09-30 10:18:28 +0300 | [diff] [blame] | 200 | if (err != 0) { |
| 201 | ALOGE("Failed to destroy mode property blob %" PRIu32 "/%d", *it, |
| 202 | err); |
| 203 | } |
| 204 | // NOLINTNEXTLINE(cppcoreguidelines-owning-memory) |
| 205 | delete it; |
| 206 | }); |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 207 | } |
| 208 | |
Alexandru Gheorghe | 0f5abd7 | 2018-05-01 14:37:10 +0100 | [diff] [blame] | 209 | int DrmDevice::GetProperty(uint32_t obj_id, uint32_t obj_type, |
Roman Stratiienko | e2f2c92 | 2021-02-13 10:57:47 +0200 | [diff] [blame] | 210 | const char *prop_name, DrmProperty *property) const { |
Roman Stratiienko | b3b5c1e | 2021-02-15 13:44:19 +0200 | [diff] [blame] | 211 | drmModeObjectPropertiesPtr props = nullptr; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 212 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 213 | props = drmModeObjectGetProperties(GetFd(), obj_id, obj_type); |
| 214 | if (props == nullptr) { |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 215 | ALOGE("Failed to get properties for %d/%x", obj_id, obj_type); |
| 216 | return -ENODEV; |
| 217 | } |
| 218 | |
| 219 | bool found = false; |
| 220 | for (int i = 0; !found && (size_t)i < props->count_props; ++i) { |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 221 | // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) |
| 222 | drmModePropertyPtr p = drmModeGetProperty(GetFd(), props->props[i]); |
| 223 | if (strcmp(p->name, prop_name) == 0) { |
| 224 | // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) |
Roman Stratiienko | 7fd8f88 | 2021-09-29 12:46:54 +0300 | [diff] [blame] | 225 | property->Init(obj_id, p, props->prop_values[i]); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 226 | found = true; |
| 227 | } |
| 228 | drmModeFreeProperty(p); |
| 229 | } |
| 230 | |
| 231 | drmModeFreeObjectProperties(props); |
| 232 | return found ? 0 : -ENOENT; |
| 233 | } |
| 234 | |
Roman Stratiienko | e2f2c92 | 2021-02-13 10:57:47 +0200 | [diff] [blame] | 235 | std::string DrmDevice::GetName() const { |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 236 | auto *ver = drmGetVersion(GetFd()); |
| 237 | if (ver == nullptr) { |
| 238 | ALOGW("Failed to get drm version for fd=%d", GetFd()); |
Matvii Zorin | ef3c797 | 2020-08-11 15:15:44 +0300 | [diff] [blame] | 239 | return "generic"; |
| 240 | } |
| 241 | |
| 242 | std::string name(ver->name); |
| 243 | drmFreeVersion(ver); |
| 244 | return name; |
| 245 | } |
Roman Stratiienko | 56f4adc | 2021-09-29 12:47:12 +0300 | [diff] [blame] | 246 | |
| 247 | auto DrmDevice::IsKMSDev(const char *path) -> bool { |
| 248 | auto fd = UniqueFd(open(path, O_RDWR | O_CLOEXEC)); |
| 249 | if (!fd) { |
| 250 | return false; |
| 251 | } |
| 252 | |
| 253 | auto res = MakeDrmModeResUnique(fd.Get()); |
| 254 | if (!res) { |
| 255 | return false; |
| 256 | } |
| 257 | |
| 258 | bool is_kms = res->count_crtcs > 0 && res->count_connectors > 0 && |
| 259 | res->count_encoders > 0; |
| 260 | |
| 261 | return is_kms; |
| 262 | } |
| 263 | |
Roman Stratiienko | 7d89911 | 2022-01-31 11:30:27 +0200 | [diff] [blame] | 264 | auto DrmDevice::GetConnectors() |
| 265 | -> const std::vector<std::unique_ptr<DrmConnector>> & { |
| 266 | return connectors_; |
| 267 | } |
| 268 | |
| 269 | auto DrmDevice::GetPlanes() -> const std::vector<std::unique_ptr<DrmPlane>> & { |
| 270 | return planes_; |
| 271 | } |
| 272 | |
| 273 | auto DrmDevice::GetCrtcs() -> const std::vector<std::unique_ptr<DrmCrtc>> & { |
| 274 | return crtcs_; |
| 275 | } |
| 276 | |
| 277 | auto DrmDevice::GetEncoders() |
| 278 | -> const std::vector<std::unique_ptr<DrmEncoder>> & { |
| 279 | return encoders_; |
| 280 | } |
| 281 | |
Sean Paul | f72cccd | 2018-08-27 13:59:08 -0400 | [diff] [blame] | 282 | } // namespace android |