Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| 3 | * Use of this source code is governed by a BSD-style license that can be |
| 4 | * found in the LICENSE file. |
| 5 | */ |
| 6 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 7 | #ifdef DRV_I915 |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 8 | |
| 9 | #include <errno.h> |
| 10 | #include <string.h> |
| 11 | #include <stdio.h> |
Gurchetan Singh | ef92053 | 2016-08-12 16:38:25 -0700 | [diff] [blame] | 12 | #include <sys/mman.h> |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 13 | #include <xf86drm.h> |
| 14 | #include <i915_drm.h> |
| 15 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 16 | #include "drv_priv.h" |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 17 | #include "helpers.h" |
| 18 | #include "util.h" |
| 19 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 20 | struct i915_device |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 21 | { |
| 22 | int gen; |
| 23 | }; |
| 24 | |
| 25 | |
| 26 | static int get_gen(int device_id) |
| 27 | { |
Stéphane Marchesin | ec88e89 | 2015-11-03 16:14:59 -0800 | [diff] [blame] | 28 | const uint16_t gen3_ids[] = {0x2582, 0x2592, 0x2772, 0x27A2, 0x27AE, |
| 29 | 0x29C2, 0x29B2, 0x29D2, 0xA001, 0xA011}; |
Stéphane Marchesin | a39dfde | 2014-09-15 15:38:25 -0700 | [diff] [blame] | 30 | unsigned i; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 31 | for(i = 0; i < ARRAY_SIZE(gen3_ids); i++) |
| 32 | if (gen3_ids[i] == device_id) |
| 33 | return 3; |
| 34 | |
| 35 | return 4; |
| 36 | } |
| 37 | |
Gurchetan Singh | d7c84fd | 2016-08-16 18:18:24 -0700 | [diff] [blame] | 38 | static int i915_init(struct driver *drv) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 39 | { |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 40 | struct i915_device *i915_drv; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 41 | drm_i915_getparam_t get_param; |
| 42 | int device_id; |
| 43 | int ret; |
| 44 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 45 | i915_drv = (struct i915_device*)malloc(sizeof(*i915_drv)); |
| 46 | if (!i915_drv) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 47 | return -1; |
| 48 | |
| 49 | memset(&get_param, 0, sizeof(get_param)); |
| 50 | get_param.param = I915_PARAM_CHIPSET_ID; |
| 51 | get_param.value = &device_id; |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 52 | ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GETPARAM, &get_param); |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 53 | if (ret) { |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 54 | fprintf(stderr, "drv: DRM_IOCTL_I915_GETPARAM failed\n"); |
| 55 | free(i915_drv); |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 56 | return -1; |
| 57 | } |
| 58 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 59 | i915_drv->gen = get_gen(device_id); |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 60 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 61 | drv->priv = i915_drv; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 62 | |
| 63 | return 0; |
| 64 | } |
| 65 | |
Gurchetan Singh | d7c84fd | 2016-08-16 18:18:24 -0700 | [diff] [blame] | 66 | static void i915_close(struct driver *drv) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 67 | { |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 68 | free(drv->priv); |
| 69 | drv->priv = NULL; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 70 | } |
| 71 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 72 | static void i915_align_dimensions(struct driver *drv, uint32_t tiling_mode, |
Stéphane Marchesin | ec88e89 | 2015-11-03 16:14:59 -0800 | [diff] [blame] | 73 | uint32_t *width, uint32_t *height, int bpp) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 74 | { |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 75 | struct i915_device *i915_drv = (struct i915_device *)drv->priv; |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 76 | uint32_t width_alignment = 4, height_alignment = 4; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 77 | |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 78 | switch(tiling_mode) { |
| 79 | default: |
| 80 | case I915_TILING_NONE: |
| 81 | width_alignment = 64 / bpp; |
| 82 | break; |
| 83 | |
| 84 | case I915_TILING_X: |
| 85 | width_alignment = 512 / bpp; |
| 86 | height_alignment = 8; |
| 87 | break; |
| 88 | |
| 89 | case I915_TILING_Y: |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 90 | if (i915_drv->gen == 3) { |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 91 | width_alignment = 512 / bpp; |
| 92 | height_alignment = 8; |
| 93 | } else { |
| 94 | width_alignment = 128 / bpp; |
| 95 | height_alignment = 32; |
| 96 | } |
| 97 | break; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 98 | } |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 99 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 100 | if (i915_drv->gen > 3) { |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 101 | *width = ALIGN(*width, width_alignment); |
| 102 | *height = ALIGN(*height, height_alignment); |
| 103 | } else { |
| 104 | uint32_t w; |
Stéphane Marchesin | e3d7c1f | 2015-03-31 13:47:22 -0700 | [diff] [blame] | 105 | for (w = width_alignment; w < *width; w <<= 1) |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 106 | ; |
| 107 | *width = w; |
| 108 | *height = ALIGN(*height, height_alignment); |
| 109 | } |
| 110 | } |
| 111 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 112 | static int i915_verify_dimensions(struct driver *drv, uint32_t stride, |
Stéphane Marchesin | ec88e89 | 2015-11-03 16:14:59 -0800 | [diff] [blame] | 113 | uint32_t height) |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 114 | { |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 115 | struct i915_device *i915_drv = (struct i915_device *)drv->priv; |
| 116 | if (i915_drv->gen <= 3 && stride > 8192) |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 117 | return 0; |
| 118 | |
| 119 | return 1; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Gurchetan Singh | d7c84fd | 2016-08-16 18:18:24 -0700 | [diff] [blame] | 122 | static int i915_bo_create(struct bo *bo, uint32_t width, uint32_t height, |
| 123 | uint32_t format, uint32_t flags) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 124 | { |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 125 | struct driver *drv = bo->drv; |
Gurchetan Singh | 83dc4fb | 2016-07-19 15:52:33 -0700 | [diff] [blame^] | 126 | int bpp = drv_stride_from_format(format, 1, 0); |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 127 | struct drm_i915_gem_create gem_create; |
| 128 | struct drm_i915_gem_set_tiling gem_set_tiling; |
| 129 | uint32_t tiling_mode = I915_TILING_NONE; |
Gurchetan Singh | 83dc4fb | 2016-07-19 15:52:33 -0700 | [diff] [blame^] | 130 | size_t size, plane; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 131 | int ret; |
| 132 | |
Gurchetan Singh | bfba8c2 | 2016-08-16 17:57:10 -0700 | [diff] [blame] | 133 | if (flags & (DRV_BO_USE_CURSOR | DRV_BO_USE_LINEAR | |
| 134 | DRV_BO_USE_SW_READ_OFTEN | DRV_BO_USE_SW_WRITE_OFTEN)) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 135 | tiling_mode = I915_TILING_NONE; |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 136 | else if (flags & DRV_BO_USE_SCANOUT) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 137 | tiling_mode = I915_TILING_X; |
Gurchetan Singh | bfba8c2 | 2016-08-16 17:57:10 -0700 | [diff] [blame] | 138 | else if (flags & (DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 139 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_SW_READ_RARELY | |
| 140 | DRV_BO_USE_HW_2D | DRV_BO_USE_SW_WRITE_RARELY)) |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 141 | tiling_mode = I915_TILING_Y; |
| 142 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 143 | i915_align_dimensions(drv, tiling_mode, &width, &height, bpp); |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 144 | |
Gurchetan Singh | 83dc4fb | 2016-07-19 15:52:33 -0700 | [diff] [blame^] | 145 | switch (format) { |
| 146 | case DRV_FORMAT_YVU420: |
| 147 | bo->strides[0] = drv_stride_from_format(format, width, 0); |
| 148 | bo->strides[1] = bo->strides[2] = drv_stride_from_format(format, width, 1); |
| 149 | bo->sizes[0] = height * bo->strides[0]; |
| 150 | bo->sizes[1] = bo->sizes[2] = (height / 2) * bo->strides[1]; |
| 151 | bo->offsets[0] = 0; |
| 152 | bo->offsets[1] = bo->sizes[0]; |
| 153 | bo->offsets[2] = bo->offsets[1] + bo->sizes[1]; |
| 154 | break; |
| 155 | default: |
| 156 | bo->strides[0] = drv_stride_from_format(format, width, 0); |
| 157 | bo->sizes[0] = height * bo->strides[0]; |
| 158 | bo->offsets[0] = 0; |
| 159 | } |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 160 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 161 | if (!i915_verify_dimensions(drv, bo->strides[0], height)) |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 162 | return EINVAL; |
| 163 | |
Gurchetan Singh | 83dc4fb | 2016-07-19 15:52:33 -0700 | [diff] [blame^] | 164 | size = bo->offsets[bo->num_planes - 1] + bo->sizes[bo->num_planes - 1]; |
| 165 | |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 166 | memset(&gem_create, 0, sizeof(gem_create)); |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 167 | gem_create.size = size; |
| 168 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 169 | ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GEM_CREATE, &gem_create); |
Ilja H. Friedel | f9d2ab7 | 2015-04-09 14:08:36 -0700 | [diff] [blame] | 170 | if (ret) { |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 171 | fprintf(stderr, "drv: DRM_IOCTL_I915_GEM_CREATE failed " |
Ilja H. Friedel | f9d2ab7 | 2015-04-09 14:08:36 -0700 | [diff] [blame] | 172 | "(size=%zu)\n", size); |
Stéphane Marchesin | 5d867a4 | 2014-11-24 17:09:49 -0800 | [diff] [blame] | 173 | return ret; |
Ilja H. Friedel | f9d2ab7 | 2015-04-09 14:08:36 -0700 | [diff] [blame] | 174 | } |
Gurchetan Singh | 83dc4fb | 2016-07-19 15:52:33 -0700 | [diff] [blame^] | 175 | |
| 176 | for (plane = 0; plane < bo->num_planes; plane++) |
| 177 | bo->handles[plane].u32 = gem_create.handle; |
Daniel Nicoara | 1de26dc | 2014-09-25 18:53:19 -0400 | [diff] [blame] | 178 | |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 179 | memset(&gem_set_tiling, 0, sizeof(gem_set_tiling)); |
| 180 | do { |
Yuly Novikov | 96c7a3b | 2015-12-08 22:48:29 -0500 | [diff] [blame] | 181 | gem_set_tiling.handle = bo->handles[0].u32; |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 182 | gem_set_tiling.tiling_mode = tiling_mode; |
Yuly Novikov | 96c7a3b | 2015-12-08 22:48:29 -0500 | [diff] [blame] | 183 | gem_set_tiling.stride = bo->strides[0]; |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 184 | ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GEM_SET_TILING, |
Stéphane Marchesin | ec88e89 | 2015-11-03 16:14:59 -0800 | [diff] [blame] | 185 | &gem_set_tiling); |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 186 | } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); |
| 187 | |
| 188 | if (ret == -1) { |
| 189 | struct drm_gem_close gem_close; |
Yuly Novikov | 96c7a3b | 2015-12-08 22:48:29 -0500 | [diff] [blame] | 190 | gem_close.handle = bo->handles[0].u32; |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 191 | fprintf(stderr, "drv: DRM_IOCTL_I915_GEM_SET_TILING failed " |
Ilja H. Friedel | f9d2ab7 | 2015-04-09 14:08:36 -0700 | [diff] [blame] | 192 | "errno=%x (handle=%x, tiling=%x, stride=%x)\n", |
| 193 | errno, |
| 194 | gem_set_tiling.handle, |
| 195 | gem_set_tiling.tiling_mode, |
| 196 | gem_set_tiling.stride); |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 197 | drmIoctl(drv->fd, DRM_IOCTL_GEM_CLOSE, &gem_close); |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 198 | return -errno; |
| 199 | } |
| 200 | |
| 201 | return 0; |
| 202 | } |
| 203 | |
Gurchetan Singh | d7c84fd | 2016-08-16 18:18:24 -0700 | [diff] [blame] | 204 | static void *i915_bo_map(struct bo *bo) |
Gurchetan Singh | ef92053 | 2016-08-12 16:38:25 -0700 | [diff] [blame] | 205 | { |
| 206 | int ret; |
| 207 | struct drm_i915_gem_mmap_gtt gem_map; |
| 208 | |
| 209 | memset(&gem_map, 0, sizeof(gem_map)); |
| 210 | gem_map.handle = bo->handles[0].u32; |
| 211 | |
| 212 | ret = drmIoctl(bo->drv->fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &gem_map); |
| 213 | if (ret) { |
| 214 | fprintf(stderr, "drv: DRM_IOCTL_I915_GEM_MMAP_GTT failed\n"); |
| 215 | return MAP_FAILED; |
| 216 | } |
| 217 | |
| 218 | return mmap(0, bo->sizes[0], PROT_READ | PROT_WRITE, MAP_SHARED, |
| 219 | bo->drv->fd, gem_map.offset); |
| 220 | } |
| 221 | |
Gurchetan Singh | bfba8c2 | 2016-08-16 17:57:10 -0700 | [diff] [blame] | 222 | drv_format_t i915_resolve_format(drv_format_t format) |
| 223 | { |
| 224 | switch (format) { |
| 225 | case DRV_FORMAT_FLEX_IMPLEMENTATION_DEFINED: |
| 226 | /*HACK: See b/28671744 */ |
| 227 | return DRV_FORMAT_XBGR8888; |
| 228 | case DRV_FORMAT_FLEX_YCbCr_420_888: |
Gurchetan Singh | bfba8c2 | 2016-08-16 17:57:10 -0700 | [diff] [blame] | 229 | return DRV_FORMAT_YVU420; |
| 230 | default: |
| 231 | return format; |
| 232 | } |
| 233 | } |
| 234 | |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 235 | const struct backend backend_i915 = |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 236 | { |
| 237 | .name = "i915", |
Gurchetan Singh | d7c84fd | 2016-08-16 18:18:24 -0700 | [diff] [blame] | 238 | .init = i915_init, |
| 239 | .close = i915_close, |
| 240 | .bo_create = i915_bo_create, |
Gurchetan Singh | 46faf6b | 2016-08-05 14:40:07 -0700 | [diff] [blame] | 241 | .bo_destroy = drv_gem_bo_destroy, |
Gurchetan Singh | d7c84fd | 2016-08-16 18:18:24 -0700 | [diff] [blame] | 242 | .bo_map = i915_bo_map, |
Gurchetan Singh | bfba8c2 | 2016-08-16 17:57:10 -0700 | [diff] [blame] | 243 | .resolve_format = i915_resolve_format, |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 244 | .format_list = { |
Gurchetan Singh | bfba8c2 | 2016-08-16 17:57:10 -0700 | [diff] [blame] | 245 | {DRV_FORMAT_XRGB8888, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 246 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 247 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 248 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 249 | {DRV_FORMAT_XRGB8888, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 250 | DRV_BO_USE_LINEAR | DRV_BO_USE_SW_READ_OFTEN | |
| 251 | DRV_BO_USE_SW_WRITE_OFTEN}, |
| 252 | {DRV_FORMAT_ARGB8888, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 253 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 254 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 255 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 256 | {DRV_FORMAT_ARGB8888, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 257 | DRV_BO_USE_LINEAR | DRV_BO_USE_SW_READ_OFTEN | |
| 258 | DRV_BO_USE_SW_WRITE_OFTEN}, |
| 259 | {DRV_FORMAT_XBGR8888, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 260 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 261 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 262 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 263 | {DRV_FORMAT_ABGR8888, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 264 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 265 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 266 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 267 | {DRV_FORMAT_XRGB1555, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 268 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 269 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 270 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 271 | {DRV_FORMAT_ARGB1555, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 272 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 273 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 274 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 275 | {DRV_FORMAT_RGB565, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 276 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 277 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 278 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 279 | {DRV_FORMAT_UYVY, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 280 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 281 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 282 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 283 | {DRV_FORMAT_UYVY, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 284 | DRV_BO_USE_LINEAR | DRV_BO_USE_SW_READ_OFTEN | |
| 285 | DRV_BO_USE_SW_WRITE_OFTEN}, |
| 286 | {DRV_FORMAT_YUYV, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 287 | DRV_BO_USE_RENDERING | DRV_BO_USE_HW_TEXTURE | |
| 288 | DRV_BO_USE_HW_RENDER | DRV_BO_USE_HW_2D | |
| 289 | DRV_BO_USE_SW_READ_RARELY | DRV_BO_USE_SW_WRITE_RARELY}, |
| 290 | {DRV_FORMAT_YUYV, DRV_BO_USE_SCANOUT | DRV_BO_USE_CURSOR | |
| 291 | DRV_BO_USE_LINEAR | DRV_BO_USE_SW_READ_OFTEN | |
| 292 | DRV_BO_USE_SW_WRITE_OFTEN}, |
| 293 | {DRV_FORMAT_R8, DRV_BO_USE_SCANOUT | DRV_BO_USE_LINEAR | |
| 294 | DRV_BO_USE_SW_READ_OFTEN | DRV_BO_USE_SW_WRITE_OFTEN}, |
| 295 | {DRV_FORMAT_GR88, DRV_BO_USE_SCANOUT | DRV_BO_USE_LINEAR | |
| 296 | DRV_BO_USE_SW_READ_OFTEN | DRV_BO_USE_SW_WRITE_OFTEN}, |
Gurchetan Singh | 83dc4fb | 2016-07-19 15:52:33 -0700 | [diff] [blame^] | 297 | {DRV_FORMAT_YVU420, DRV_BO_USE_LINEAR | DRV_BO_USE_SW_READ_OFTEN | |
| 298 | DRV_BO_USE_SW_WRITE_OFTEN}, |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 299 | } |
| 300 | }; |
| 301 | |
| 302 | #endif |