Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [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 | |
Stéphane Marchesin | be98c8c | 2015-06-23 16:18:10 -0700 | [diff] [blame] | 17 | #define ATRACE_TAG ATRACE_TAG_GRAPHICS |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 18 | #define LOG_TAG "hwcomposer-drm" |
| 19 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 20 | #include "drm_hwcomposer.h" |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 21 | #include "drmresources.h" |
Sean Paul | da6270d | 2015-06-01 14:11:52 -0400 | [diff] [blame] | 22 | #include "importer.h" |
Sean Paul | 4057be3 | 2015-05-13 06:23:09 -0700 | [diff] [blame] | 23 | #include "vsyncworker.h" |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 24 | |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 25 | #include <errno.h> |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 26 | #include <fcntl.h> |
Sean Paul | 5ad302c | 2015-05-11 10:43:31 -0700 | [diff] [blame] | 27 | #include <list> |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 28 | #include <map> |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 29 | #include <pthread.h> |
Dan Albert | c5255b3 | 2015-05-07 23:42:54 -0700 | [diff] [blame] | 30 | #include <stdlib.h> |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 31 | #include <sys/param.h> |
Sean Paul | 9aa5ad3 | 2015-01-22 15:47:54 -0500 | [diff] [blame] | 32 | #include <sys/resource.h> |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 33 | #include <xf86drm.h> |
| 34 | #include <xf86drmMode.h> |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 35 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 36 | #include <cutils/log.h> |
| 37 | #include <cutils/properties.h> |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 38 | #include <hardware/hardware.h> |
| 39 | #include <hardware/hwcomposer.h> |
Stéphane Marchesin | be98c8c | 2015-06-23 16:18:10 -0700 | [diff] [blame] | 40 | #include <utils/Trace.h> |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 41 | |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 42 | #define UM_PER_INCH 25400 |
Stéphane Marchesin | cb3f984 | 2015-06-19 14:50:45 -0700 | [diff] [blame] | 43 | #define HWC_FB_BUFFERS 3 |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 44 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 45 | namespace android { |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 46 | |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 47 | typedef struct hwc_drm_display { |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 48 | struct hwc_context_t *ctx; |
| 49 | int display; |
Sean Paul | 9aa5ad3 | 2015-01-22 15:47:54 -0500 | [diff] [blame] | 50 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 51 | std::vector<uint32_t> config_ids; |
Sean Paul | 9aa5ad3 | 2015-01-22 15:47:54 -0500 | [diff] [blame] | 52 | |
Sean Paul | 4057be3 | 2015-05-13 06:23:09 -0700 | [diff] [blame] | 53 | VSyncWorker vsync_worker; |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 54 | } hwc_drm_display_t; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 55 | |
| 56 | struct hwc_context_t { |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 57 | // map of display:hwc_drm_display_t |
| 58 | typedef std::map<int, hwc_drm_display_t> DisplayMap; |
| 59 | typedef DisplayMap::iterator DisplayMapIter; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 60 | |
Sean Paul | da6270d | 2015-06-01 14:11:52 -0400 | [diff] [blame] | 61 | hwc_context_t() : procs(NULL), importer(NULL) { |
| 62 | } |
| 63 | |
| 64 | ~hwc_context_t() { |
| 65 | delete importer; |
| 66 | } |
| 67 | |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 68 | hwc_composer_device_1_t device; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 69 | hwc_procs_t const *procs; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 70 | |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 71 | DisplayMap displays; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 72 | DrmResources drm; |
Sean Paul | da6270d | 2015-06-01 14:11:52 -0400 | [diff] [blame] | 73 | Importer *importer; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 74 | }; |
| 75 | |
Zach Reizner | c6520e4 | 2015-08-13 14:32:09 -0700 | [diff] [blame^] | 76 | static void hwc_dump(struct hwc_composer_device_1 *dev, char *buff, |
Sean Paul | 9046c64 | 2015-06-10 17:27:47 -0400 | [diff] [blame] | 77 | int buff_len) { |
| 78 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
| 79 | std::ostringstream out; |
| 80 | |
| 81 | ctx->drm.compositor()->Dump(&out); |
| 82 | std::string out_str = out.str(); |
| 83 | strncpy(buff, out_str.c_str(), std::min((size_t)buff_len, out_str.length())); |
| 84 | } |
| 85 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 86 | static int hwc_prepare(hwc_composer_device_1_t *dev, size_t num_displays, |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 87 | hwc_display_contents_1_t **display_contents) { |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 88 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 89 | for (int i = 0; i < (int)num_displays; ++i) { |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 90 | if (!display_contents[i]) |
| 91 | continue; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 92 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 93 | DrmCrtc *crtc = ctx->drm.GetCrtcForDisplay(i); |
| 94 | if (!crtc) { |
| 95 | ALOGE("No crtc for display %d", i); |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 96 | return -ENODEV; |
| 97 | } |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 98 | |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 99 | int num_layers = display_contents[i]->numHwLayers; |
| 100 | for (int j = 0; j < num_layers; j++) { |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 101 | hwc_layer_1_t *layer = &display_contents[i]->hwLayers[j]; |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 102 | |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 103 | if (layer->compositionType == HWC_FRAMEBUFFER) |
| 104 | layer->compositionType = HWC_OVERLAY; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 105 | } |
| 106 | } |
Sean Paul | dffca95 | 2015-02-04 10:19:55 -0800 | [diff] [blame] | 107 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 108 | return 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 109 | } |
| 110 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 111 | static void hwc_set_cleanup(size_t num_displays, |
| 112 | hwc_display_contents_1_t **display_contents, |
Zach Reizner | 459a5a9 | 2015-07-31 15:12:49 -0700 | [diff] [blame] | 113 | DrmComposition *composition) { |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 114 | for (int i = 0; i < (int)num_displays; ++i) { |
| 115 | if (!display_contents[i]) |
| 116 | continue; |
| 117 | |
| 118 | hwc_display_contents_1_t *dc = display_contents[i]; |
| 119 | for (size_t j = 0; j < dc->numHwLayers; ++j) { |
| 120 | hwc_layer_1_t *layer = &dc->hwLayers[j]; |
| 121 | if (layer->acquireFenceFd >= 0) { |
| 122 | close(layer->acquireFenceFd); |
| 123 | layer->acquireFenceFd = -1; |
| 124 | } |
| 125 | } |
| 126 | if (dc->outbufAcquireFenceFd >= 0) { |
| 127 | close(dc->outbufAcquireFenceFd); |
| 128 | dc->outbufAcquireFenceFd = -1; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | delete composition; |
| 133 | } |
| 134 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 135 | static int hwc_add_layer(int display, hwc_context_t *ctx, hwc_layer_1_t *layer, |
Zach Reizner | 459a5a9 | 2015-07-31 15:12:49 -0700 | [diff] [blame] | 136 | DrmComposition *composition) { |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 137 | hwc_drm_bo_t bo; |
| 138 | int ret = ctx->importer->ImportBuffer(layer->handle, &bo); |
| 139 | if (ret) { |
| 140 | ALOGE("Failed to import handle to bo %d", ret); |
| 141 | return ret; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 142 | } |
Sean Paul | efb20cb | 2015-02-04 09:29:15 -0800 | [diff] [blame] | 143 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 144 | ret = composition->AddLayer(display, layer, &bo); |
| 145 | if (!ret) |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 146 | return 0; |
Sean Paul | 9aa5ad3 | 2015-01-22 15:47:54 -0500 | [diff] [blame] | 147 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 148 | int destroy_ret = ctx->importer->ReleaseBuffer(&bo); |
| 149 | if (destroy_ret) |
| 150 | ALOGE("Failed to destroy buffer %d", destroy_ret); |
Sean Paul | 9aa5ad3 | 2015-01-22 15:47:54 -0500 | [diff] [blame] | 151 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 152 | return ret; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 153 | } |
| 154 | |
Sean Paul | 0420612 | 2015-07-16 15:59:24 -0400 | [diff] [blame] | 155 | static void hwc_add_layer_to_retire_fence(hwc_layer_1_t *layer, |
| 156 | hwc_display_contents_1_t *display_contents) { |
| 157 | if (layer->releaseFenceFd < 0) |
| 158 | return; |
| 159 | |
| 160 | if (display_contents->retireFenceFd >= 0) { |
| 161 | int old_retire_fence = display_contents->retireFenceFd; |
Zach Reizner | c6520e4 | 2015-08-13 14:32:09 -0700 | [diff] [blame^] | 162 | display_contents->retireFenceFd = |
| 163 | sync_merge("dc_retire", old_retire_fence, layer->releaseFenceFd); |
Sean Paul | 0420612 | 2015-07-16 15:59:24 -0400 | [diff] [blame] | 164 | close(old_retire_fence); |
| 165 | } else { |
| 166 | display_contents->retireFenceFd = dup(layer->releaseFenceFd); |
| 167 | } |
| 168 | } |
| 169 | |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 170 | static int hwc_set(hwc_composer_device_1_t *dev, size_t num_displays, |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 171 | hwc_display_contents_1_t **display_contents) { |
Stéphane Marchesin | be98c8c | 2015-06-23 16:18:10 -0700 | [diff] [blame] | 172 | ATRACE_CALL(); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 173 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Zach Reizner | 459a5a9 | 2015-07-31 15:12:49 -0700 | [diff] [blame] | 174 | DrmComposition *composition = |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 175 | ctx->drm.compositor()->CreateComposition(ctx->importer); |
| 176 | if (!composition) { |
| 177 | ALOGE("Drm composition init failed"); |
| 178 | hwc_set_cleanup(num_displays, display_contents, NULL); |
| 179 | return -EINVAL; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 180 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 181 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 182 | int ret; |
| 183 | for (int i = 0; i < (int)num_displays; ++i) { |
| 184 | if (!display_contents[i]) |
| 185 | continue; |
| 186 | |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 187 | hwc_display_contents_1_t *dc = display_contents[i]; |
| 188 | int j; |
| 189 | unsigned num_layers = 0; |
| 190 | unsigned num_dc_layers = dc->numHwLayers; |
| 191 | for (j = 0; j < (int)num_dc_layers; ++j) { |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 192 | hwc_layer_1_t *layer = &dc->hwLayers[j]; |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 193 | if (layer->flags & HWC_SKIP_LAYER) |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 194 | continue; |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 195 | if (layer->compositionType == HWC_OVERLAY) |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 196 | num_layers++; |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | unsigned num_planes = composition->GetRemainingLayers(i, num_layers); |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 200 | |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 201 | if (num_layers > num_planes) { |
Zach Reizner | 810ecc6 | 2015-07-31 15:12:47 -0700 | [diff] [blame] | 202 | ALOGE("Can not composite %u with only %u planes", num_layers, num_planes); |
Zach Reizner | 45624d3 | 2015-06-10 16:03:01 -0700 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | for (j = 0; num_planes && j < (int)num_dc_layers; ++j) { |
| 206 | hwc_layer_1_t *layer = &dc->hwLayers[j]; |
| 207 | if (layer->flags & HWC_SKIP_LAYER) |
| 208 | continue; |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 209 | if (layer->compositionType != HWC_OVERLAY) |
| 210 | continue; |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 211 | |
| 212 | ret = hwc_add_layer(i, ctx, layer, composition); |
| 213 | if (ret) { |
| 214 | ALOGE("Add layer failed %d", ret); |
| 215 | hwc_set_cleanup(num_displays, display_contents, composition); |
| 216 | return ret; |
| 217 | } |
Sean Paul | 0420612 | 2015-07-16 15:59:24 -0400 | [diff] [blame] | 218 | hwc_add_layer_to_retire_fence(layer, dc); |
| 219 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 220 | --num_planes; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | ret = ctx->drm.compositor()->QueueComposition(composition); |
Sean Paul | fd13828 | 2015-07-10 16:43:06 -0400 | [diff] [blame] | 225 | composition = NULL; |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 226 | if (ret) { |
| 227 | ALOGE("Failed to queue the composition"); |
Sean Paul | fd13828 | 2015-07-10 16:43:06 -0400 | [diff] [blame] | 228 | hwc_set_cleanup(num_displays, display_contents, NULL); |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 229 | return ret; |
| 230 | } |
| 231 | hwc_set_cleanup(num_displays, display_contents, NULL); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 232 | return ret; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 233 | } |
| 234 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 235 | static int hwc_event_control(struct hwc_composer_device_1 *dev, int display, |
| 236 | int event, int enabled) { |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 237 | if (event != HWC_EVENT_VSYNC || (enabled != 0 && enabled != 1)) |
| 238 | return -EINVAL; |
Sean Paul | eb9e75c | 2015-01-25 23:31:30 -0500 | [diff] [blame] | 239 | |
Sean Paul | 4057be3 | 2015-05-13 06:23:09 -0700 | [diff] [blame] | 240 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
| 241 | hwc_drm_display_t *hd = &ctx->displays[display]; |
| 242 | return hd->vsync_worker.VSyncControl(enabled); |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 243 | } |
| 244 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 245 | static int hwc_set_power_mode(struct hwc_composer_device_1 *dev, int display, |
| 246 | int mode) { |
| 247 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 248 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 249 | uint64_t dpmsValue = 0; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 250 | switch (mode) { |
| 251 | case HWC_POWER_MODE_OFF: |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 252 | dpmsValue = DRM_MODE_DPMS_OFF; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 253 | break; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 254 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 255 | /* We can't support dozing right now, so go full on */ |
| 256 | case HWC_POWER_MODE_DOZE: |
| 257 | case HWC_POWER_MODE_DOZE_SUSPEND: |
| 258 | case HWC_POWER_MODE_NORMAL: |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 259 | dpmsValue = DRM_MODE_DPMS_ON; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 260 | break; |
| 261 | }; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 262 | return ctx->drm.SetDpmsMode(display, dpmsValue); |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 263 | } |
| 264 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 265 | static int hwc_query(struct hwc_composer_device_1 * /* dev */, int what, |
| 266 | int *value) { |
| 267 | switch (what) { |
| 268 | case HWC_BACKGROUND_LAYER_SUPPORTED: |
| 269 | *value = 0; /* TODO: We should do this */ |
| 270 | break; |
| 271 | case HWC_VSYNC_PERIOD: |
| 272 | ALOGW("Query for deprecated vsync value, returning 60Hz"); |
| 273 | *value = 1000 * 1000 * 1000 / 60; |
| 274 | break; |
| 275 | case HWC_DISPLAY_TYPES_SUPPORTED: |
| 276 | *value = HWC_DISPLAY_PRIMARY | HWC_DISPLAY_EXTERNAL; |
| 277 | break; |
| 278 | } |
| 279 | return 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 280 | } |
| 281 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 282 | static void hwc_register_procs(struct hwc_composer_device_1 *dev, |
| 283 | hwc_procs_t const *procs) { |
| 284 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 285 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 286 | ctx->procs = procs; |
Sean Paul | 4057be3 | 2015-05-13 06:23:09 -0700 | [diff] [blame] | 287 | |
| 288 | for (hwc_context_t::DisplayMapIter iter = ctx->displays.begin(); |
| 289 | iter != ctx->displays.end(); ++iter) { |
| 290 | iter->second.vsync_worker.SetProcs(procs); |
| 291 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 292 | } |
| 293 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 294 | static int hwc_get_display_configs(struct hwc_composer_device_1 *dev, |
| 295 | int display, uint32_t *configs, |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 296 | size_t *num_configs) { |
| 297 | if (!*num_configs) |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 298 | return 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 299 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 300 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 301 | hwc_drm_display_t *hd = &ctx->displays[display]; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 302 | hd->config_ids.clear(); |
| 303 | |
| 304 | DrmConnector *connector = ctx->drm.GetConnectorForDisplay(display); |
| 305 | if (!connector) { |
| 306 | ALOGE("Failed to get connector for display %d", display); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 307 | return -ENODEV; |
| 308 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 309 | |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 310 | int ret = connector->UpdateModes(); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 311 | if (ret) { |
| 312 | ALOGE("Failed to update display modes %d", ret); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 313 | return ret; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 314 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 315 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 316 | for (DrmConnector::ModeIter iter = connector->begin_modes(); |
| 317 | iter != connector->end_modes(); ++iter) { |
| 318 | size_t idx = hd->config_ids.size(); |
| 319 | if (idx == *num_configs) |
| 320 | break; |
| 321 | hd->config_ids.push_back(iter->id()); |
| 322 | configs[idx] = iter->id(); |
| 323 | } |
| 324 | *num_configs = hd->config_ids.size(); |
| 325 | return *num_configs == 0 ? -1 : 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 326 | } |
| 327 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 328 | static int hwc_get_display_attributes(struct hwc_composer_device_1 *dev, |
| 329 | int display, uint32_t config, |
| 330 | const uint32_t *attributes, |
| 331 | int32_t *values) { |
| 332 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 333 | DrmConnector *c = ctx->drm.GetConnectorForDisplay(display); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 334 | if (!c) { |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 335 | ALOGE("Failed to get DrmConnector for display %d", display); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 336 | return -ENODEV; |
| 337 | } |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 338 | DrmMode mode; |
| 339 | for (DrmConnector::ModeIter iter = c->begin_modes(); iter != c->end_modes(); |
| 340 | ++iter) { |
| 341 | if (iter->id() == config) { |
| 342 | mode = *iter; |
| 343 | break; |
| 344 | } |
| 345 | } |
| 346 | if (mode.id() == 0) { |
| 347 | ALOGE("Failed to find active mode for display %d", display); |
| 348 | return -ENOENT; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 349 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 350 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 351 | uint32_t mm_width = c->mm_width(); |
| 352 | uint32_t mm_height = c->mm_height(); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 353 | for (int i = 0; attributes[i] != HWC_DISPLAY_NO_ATTRIBUTE; ++i) { |
| 354 | switch (attributes[i]) { |
| 355 | case HWC_DISPLAY_VSYNC_PERIOD: |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 356 | values[i] = 1000 * 1000 * 1000 / mode.v_refresh(); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 357 | break; |
| 358 | case HWC_DISPLAY_WIDTH: |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 359 | values[i] = mode.h_display(); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 360 | break; |
| 361 | case HWC_DISPLAY_HEIGHT: |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 362 | values[i] = mode.v_display(); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 363 | break; |
| 364 | case HWC_DISPLAY_DPI_X: |
| 365 | /* Dots per 1000 inches */ |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 366 | values[i] = mm_width ? (mode.h_display() * UM_PER_INCH) / mm_width : 0; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 367 | break; |
| 368 | case HWC_DISPLAY_DPI_Y: |
| 369 | /* Dots per 1000 inches */ |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 370 | values[i] = |
| 371 | mm_height ? (mode.v_display() * UM_PER_INCH) / mm_height : 0; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 372 | break; |
| 373 | } |
| 374 | } |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 375 | return 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 376 | } |
| 377 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 378 | static int hwc_get_active_config(struct hwc_composer_device_1 *dev, |
| 379 | int display) { |
| 380 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 381 | DrmConnector *c = ctx->drm.GetConnectorForDisplay(display); |
| 382 | if (!c) { |
| 383 | ALOGE("Failed to get DrmConnector for display %d", display); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 384 | return -ENODEV; |
| 385 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 386 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 387 | DrmMode mode = c->active_mode(); |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 388 | hwc_drm_display_t *hd = &ctx->displays[display]; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 389 | for (size_t i = 0; i < hd->config_ids.size(); ++i) { |
| 390 | if (hd->config_ids[i] == mode.id()) |
| 391 | return i; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 392 | } |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 393 | return -1; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 394 | } |
| 395 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 396 | static int hwc_set_active_config(struct hwc_composer_device_1 *dev, int display, |
| 397 | int index) { |
| 398 | struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 399 | hwc_drm_display_t *hd = &ctx->displays[display]; |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 400 | if (index >= (int)hd->config_ids.size()) { |
| 401 | ALOGE("Invalid config index %d passed in", index); |
| 402 | return -EINVAL; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 403 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 404 | |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 405 | DrmConnector *c = ctx->drm.GetConnectorForDisplay(display); |
| 406 | if (!c) { |
| 407 | ALOGE("Failed to get connector for display %d", display); |
| 408 | return -ENODEV; |
| 409 | } |
| 410 | DrmMode mode; |
| 411 | for (DrmConnector::ModeIter iter = c->begin_modes(); iter != c->end_modes(); |
| 412 | ++iter) { |
| 413 | if (iter->id() == hd->config_ids[index]) { |
| 414 | mode = *iter; |
| 415 | break; |
| 416 | } |
| 417 | } |
| 418 | if (mode.id() != hd->config_ids[index]) { |
| 419 | ALOGE("Could not find active mode for %d/%d", index, hd->config_ids[index]); |
| 420 | return -ENOENT; |
| 421 | } |
| 422 | int ret = ctx->drm.SetDisplayActiveMode(display, mode); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 423 | if (ret) { |
Sean Paul | 877be97 | 2015-06-03 14:08:27 -0400 | [diff] [blame] | 424 | ALOGE("Failed to set active config %d", ret); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 425 | return ret; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 426 | } |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 427 | return ret; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 428 | } |
| 429 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 430 | static int hwc_device_close(struct hw_device_t *dev) { |
| 431 | struct hwc_context_t *ctx = (struct hwc_context_t *)dev; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 432 | delete ctx; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 433 | return 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 434 | } |
| 435 | |
Sean Paul | 24a26e3 | 2015-02-04 10:34:47 -0800 | [diff] [blame] | 436 | /* |
| 437 | * TODO: This function sets the active config to the first one in the list. This |
| 438 | * should be fixed such that it selects the preferred mode for the display, or |
| 439 | * some other, saner, method of choosing the config. |
| 440 | */ |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 441 | static int hwc_set_initial_config(hwc_drm_display_t *hd) { |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 442 | uint32_t config; |
| 443 | size_t num_configs = 1; |
| 444 | int ret = hwc_get_display_configs(&hd->ctx->device, hd->display, &config, |
| 445 | &num_configs); |
| 446 | if (ret || !num_configs) |
| 447 | return 0; |
Sean Paul | 24a26e3 | 2015-02-04 10:34:47 -0800 | [diff] [blame] | 448 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 449 | ret = hwc_set_active_config(&hd->ctx->device, hd->display, 0); |
| 450 | if (ret) { |
| 451 | ALOGE("Failed to set active config d=%d ret=%d", hd->display, ret); |
| 452 | return ret; |
| 453 | } |
Sean Paul | 24a26e3 | 2015-02-04 10:34:47 -0800 | [diff] [blame] | 454 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 455 | return ret; |
Sean Paul | 24a26e3 | 2015-02-04 10:34:47 -0800 | [diff] [blame] | 456 | } |
| 457 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 458 | static int hwc_initialize_display(struct hwc_context_t *ctx, int display) { |
Sean Paul | e42febf | 2015-05-07 11:35:29 -0700 | [diff] [blame] | 459 | hwc_drm_display_t *hd = &ctx->displays[display]; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 460 | hd->ctx = ctx; |
| 461 | hd->display = display; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 462 | |
Sean Paul | b386f1b | 2015-05-13 06:33:23 -0700 | [diff] [blame] | 463 | int ret = hwc_set_initial_config(hd); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 464 | if (ret) { |
| 465 | ALOGE("Failed to set initial config for d=%d ret=%d", display, ret); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 466 | return ret; |
| 467 | } |
Sean Paul | 24a26e3 | 2015-02-04 10:34:47 -0800 | [diff] [blame] | 468 | |
Sean Paul | 4057be3 | 2015-05-13 06:23:09 -0700 | [diff] [blame] | 469 | ret = hd->vsync_worker.Init(&ctx->drm, display); |
| 470 | if (ret) { |
| 471 | ALOGE("Failed to create event worker for display %d %d\n", display, ret); |
| 472 | return ret; |
| 473 | } |
| 474 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 475 | return 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 476 | } |
| 477 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 478 | static int hwc_enumerate_displays(struct hwc_context_t *ctx) { |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 479 | int ret; |
| 480 | for (DrmResources::ConnectorIter c = ctx->drm.begin_connectors(); |
| 481 | c != ctx->drm.end_connectors(); ++c) { |
| 482 | ret = hwc_initialize_display(ctx, (*c)->display()); |
| 483 | if (ret) { |
| 484 | ALOGE("Failed to initialize display %d", (*c)->display()); |
| 485 | return ret; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 486 | } |
| 487 | } |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 488 | |
| 489 | return 0; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 490 | } |
| 491 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 492 | static int hwc_device_open(const struct hw_module_t *module, const char *name, |
| 493 | struct hw_device_t **dev) { |
| 494 | if (strcmp(name, HWC_HARDWARE_COMPOSER)) { |
| 495 | ALOGE("Invalid module name- %s", name); |
| 496 | return -EINVAL; |
| 497 | } |
| 498 | |
| 499 | struct hwc_context_t *ctx = new hwc_context_t(); |
| 500 | if (!ctx) { |
| 501 | ALOGE("Failed to allocate hwc context"); |
| 502 | return -ENOMEM; |
| 503 | } |
| 504 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 505 | int ret = ctx->drm.Init(); |
| 506 | if (ret) { |
| 507 | ALOGE("Can't initialize Drm object %d", ret); |
| 508 | delete ctx; |
| 509 | return ret; |
| 510 | } |
| 511 | |
Sean Paul | da6270d | 2015-06-01 14:11:52 -0400 | [diff] [blame] | 512 | ctx->importer = Importer::CreateInstance(&ctx->drm); |
| 513 | if (!ctx->importer) { |
| 514 | ALOGE("Failed to create importer instance"); |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 515 | delete ctx; |
| 516 | return ret; |
| 517 | } |
| 518 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 519 | ret = hwc_enumerate_displays(ctx); |
| 520 | if (ret) { |
| 521 | ALOGE("Failed to enumerate displays: %s", strerror(ret)); |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 522 | delete ctx; |
| 523 | return ret; |
| 524 | } |
| 525 | |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 526 | ctx->device.common.tag = HARDWARE_DEVICE_TAG; |
| 527 | ctx->device.common.version = HWC_DEVICE_API_VERSION_1_4; |
| 528 | ctx->device.common.module = const_cast<hw_module_t *>(module); |
| 529 | ctx->device.common.close = hwc_device_close; |
| 530 | |
Sean Paul | 9046c64 | 2015-06-10 17:27:47 -0400 | [diff] [blame] | 531 | ctx->device.dump = hwc_dump; |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 532 | ctx->device.prepare = hwc_prepare; |
| 533 | ctx->device.set = hwc_set; |
| 534 | ctx->device.eventControl = hwc_event_control; |
| 535 | ctx->device.setPowerMode = hwc_set_power_mode; |
| 536 | ctx->device.query = hwc_query; |
| 537 | ctx->device.registerProcs = hwc_register_procs; |
| 538 | ctx->device.getDisplayConfigs = hwc_get_display_configs; |
| 539 | ctx->device.getDisplayAttributes = hwc_get_display_attributes; |
| 540 | ctx->device.getActiveConfig = hwc_get_active_config; |
| 541 | ctx->device.setActiveConfig = hwc_set_active_config; |
| 542 | ctx->device.setCursorPositionAsync = NULL; /* TODO: Add cursor */ |
| 543 | |
| 544 | *dev = &ctx->device.common; |
| 545 | |
| 546 | return 0; |
| 547 | } |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 548 | } |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 549 | |
Sean Paul | 6a55e9f | 2015-04-30 15:31:06 -0400 | [diff] [blame] | 550 | static struct hw_module_methods_t hwc_module_methods = { |
| 551 | open : android::hwc_device_open |
| 552 | }; |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 553 | |
| 554 | hwc_module_t HAL_MODULE_INFO_SYM = { |
Sean Paul | ef8f1f9 | 2015-04-29 16:05:23 -0400 | [diff] [blame] | 555 | common : { |
| 556 | tag : HARDWARE_MODULE_TAG, |
| 557 | version_major : 1, |
| 558 | version_minor : 0, |
| 559 | id : HWC_HARDWARE_MODULE_ID, |
| 560 | name : "DRM hwcomposer module", |
| 561 | author : "The Android Open Source Project", |
| 562 | methods : &hwc_module_methods, |
| 563 | dso : NULL, |
| 564 | reserved : {0}, |
| 565 | } |
Sean Paul | e0c4c3d | 2015-01-20 16:56:04 -0500 | [diff] [blame] | 566 | }; |