blob: 1ed1609a1397782cdd5b8a4b04b6452e0e27975d [file] [log] [blame]
Stéphane Marchesin25a26062014-09-12 16:18:59 -07001/*
Daniele Castagna7a755de2016-12-16 17:32:30 -05002 * Copyright 2014 The Chromium OS Authors. All rights reserved.
Stéphane Marchesin25a26062014-09-12 16:18:59 -07003 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
Gurchetan Singh46faf6b2016-08-05 14:40:07 -07007#ifdef DRV_I915
Stéphane Marchesin25a26062014-09-12 16:18:59 -07008
9#include <errno.h>
Gurchetan Singh82a8eed2017-01-03 13:01:37 -080010#include <i915_drm.h>
11#include <intel_bufmgr.h>
Stéphane Marchesin25a26062014-09-12 16:18:59 -070012#include <string.h>
Gurchetan Singhef920532016-08-12 16:38:25 -070013#include <sys/mman.h>
Stéphane Marchesin25a26062014-09-12 16:18:59 -070014#include <xf86drm.h>
Stéphane Marchesin25a26062014-09-12 16:18:59 -070015
Gurchetan Singh46faf6b2016-08-05 14:40:07 -070016#include "drv_priv.h"
Stéphane Marchesin25a26062014-09-12 16:18:59 -070017#include "helpers.h"
18#include "util.h"
19
Gurchetan Singh179687e2016-10-28 10:07:35 -070020static struct supported_combination combos[18] = {
21 {DRM_FORMAT_ARGB1555, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080022 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070023 {DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080024 BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070025 {DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080026 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070027 {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080028 BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070029 {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080030 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070031 {DRM_FORMAT_GR88, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080032 BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070033 {DRM_FORMAT_R8, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080034 BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070035 {DRM_FORMAT_RGB565, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080036 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070037 {DRM_FORMAT_UYVY, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080038 BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070039 {DRM_FORMAT_UYVY, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080040 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070041 {DRM_FORMAT_XBGR8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080042 BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070043 {DRM_FORMAT_XBGR8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080044 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070045 {DRM_FORMAT_XRGB1555, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080046 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070047 {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080048 BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070049 {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080050 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070051 {DRM_FORMAT_YUYV, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080052 BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
Gurchetan Singh179687e2016-10-28 10:07:35 -070053 {DRM_FORMAT_YUYV, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080054 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070055 {DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
Gurchetan Singh458976f2016-11-23 17:32:33 -080056 BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
Gurchetan Singh179687e2016-10-28 10:07:35 -070057};
58
Gurchetan Singh46faf6b2016-08-05 14:40:07 -070059struct i915_device
Stéphane Marchesin25a26062014-09-12 16:18:59 -070060{
61 int gen;
Gurchetan Singh82a8eed2017-01-03 13:01:37 -080062 drm_intel_bufmgr *mgr;
63 uint32_t count;
64};
65
66struct i915_bo
67{
68 drm_intel_bo *ibos[DRV_MAX_PLANES];
Stéphane Marchesin25a26062014-09-12 16:18:59 -070069};
70
Stéphane Marchesin25a26062014-09-12 16:18:59 -070071static int get_gen(int device_id)
72{
Stéphane Marchesinec88e892015-11-03 16:14:59 -080073 const uint16_t gen3_ids[] = {0x2582, 0x2592, 0x2772, 0x27A2, 0x27AE,
74 0x29C2, 0x29B2, 0x29D2, 0xA001, 0xA011};
Stéphane Marchesina39dfde2014-09-15 15:38:25 -070075 unsigned i;
Stéphane Marchesin25a26062014-09-12 16:18:59 -070076 for(i = 0; i < ARRAY_SIZE(gen3_ids); i++)
77 if (gen3_ids[i] == device_id)
78 return 3;
79
80 return 4;
81}
82
Gurchetan Singh46faf6b2016-08-05 14:40:07 -070083static void i915_align_dimensions(struct driver *drv, uint32_t tiling_mode,
Stéphane Marchesinec88e892015-11-03 16:14:59 -080084 uint32_t *width, uint32_t *height, int bpp)
Stéphane Marchesin25a26062014-09-12 16:18:59 -070085{
Gurchetan Singh82a8eed2017-01-03 13:01:37 -080086 struct i915_device *i915_dev = (struct i915_device *)drv->priv;
Stéphane Marchesin5d867a42014-11-24 17:09:49 -080087 uint32_t width_alignment = 4, height_alignment = 4;
Stéphane Marchesin25a26062014-09-12 16:18:59 -070088
Gurchetan Singhd6fb5772016-08-29 19:13:51 -070089 switch (tiling_mode) {
90 default:
91 case I915_TILING_NONE:
92 width_alignment = 64 / bpp;
93 break;
Stéphane Marchesin5d867a42014-11-24 17:09:49 -080094
Gurchetan Singhd6fb5772016-08-29 19:13:51 -070095 case I915_TILING_X:
96 width_alignment = 512 / bpp;
97 height_alignment = 8;
98 break;
99
100 case I915_TILING_Y:
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800101 if (i915_dev->gen == 3) {
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800102 width_alignment = 512 / bpp;
103 height_alignment = 8;
Gurchetan Singhd6fb5772016-08-29 19:13:51 -0700104 } else {
105 width_alignment = 128 / bpp;
106 height_alignment = 32;
107 }
108 break;
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700109 }
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800110
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800111 if (i915_dev->gen > 3) {
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800112 *width = ALIGN(*width, width_alignment);
113 *height = ALIGN(*height, height_alignment);
114 } else {
115 uint32_t w;
Stéphane Marchesine3d7c1f2015-03-31 13:47:22 -0700116 for (w = width_alignment; w < *width; w <<= 1)
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800117 ;
118 *width = w;
119 *height = ALIGN(*height, height_alignment);
120 }
121}
122
Gurchetan Singh46faf6b2016-08-05 14:40:07 -0700123static int i915_verify_dimensions(struct driver *drv, uint32_t stride,
Stéphane Marchesinec88e892015-11-03 16:14:59 -0800124 uint32_t height)
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800125{
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800126 struct i915_device *i915_dev = (struct i915_device *)drv->priv;
127 if (i915_dev->gen <= 3 && stride > 8192)
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800128 return 0;
129
130 return 1;
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700131}
132
Gurchetan Singh3eb8d8f2017-01-03 13:36:13 -0800133static int i915_init(struct driver *drv)
134{
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800135 struct i915_device *i915_dev;
Gurchetan Singh3eb8d8f2017-01-03 13:36:13 -0800136 drm_i915_getparam_t get_param;
137 int device_id;
138 int ret;
139
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800140 i915_dev = calloc(1, sizeof(*i915_dev));
141 if (!i915_dev)
Gurchetan Singh3eb8d8f2017-01-03 13:36:13 -0800142 return -1;
143
144 memset(&get_param, 0, sizeof(get_param));
145 get_param.param = I915_PARAM_CHIPSET_ID;
146 get_param.value = &device_id;
147 ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GETPARAM, &get_param);
148 if (ret) {
149 fprintf(stderr, "drv: DRM_IOCTL_I915_GETPARAM failed\n");
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800150 free(i915_dev);
151 return -EINVAL;
Gurchetan Singh3eb8d8f2017-01-03 13:36:13 -0800152 }
153
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800154 i915_dev->gen = get_gen(device_id);
155 i915_dev->count = 0;
Gurchetan Singh3eb8d8f2017-01-03 13:36:13 -0800156
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800157 i915_dev->mgr = drm_intel_bufmgr_gem_init(drv->fd, 16 * 1024);
158 if (!i915_dev->mgr) {
159 fprintf(stderr, "drv: drm_intel_bufmgr_gem_init failed\n");
160 free(i915_dev);
161 return -EINVAL;
162 }
163
164 drv->priv = i915_dev;
Gurchetan Singh3eb8d8f2017-01-03 13:36:13 -0800165
166 drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
167 return drv_add_kms_flags(drv);
168}
169
170static void i915_close(struct driver *drv)
171{
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800172 struct i915_device *i915_dev = drv->priv;
173 drm_intel_bufmgr_destroy(i915_dev->mgr);
174 free(i915_dev);
Gurchetan Singh3eb8d8f2017-01-03 13:36:13 -0800175 drv->priv = NULL;
176}
177
Gurchetan Singhd7c84fd2016-08-16 18:18:24 -0700178static int i915_bo_create(struct bo *bo, uint32_t width, uint32_t height,
179 uint32_t format, uint32_t flags)
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700180{
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700181 int ret;
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800182 size_t plane;
183 char name[20];
184 uint32_t tiling_mode;
185 struct i915_bo *i915_bo;
186
187 int bpp = drv_stride_from_format(format, 1, 0);
188 struct i915_device *i915_dev = (struct i915_device *)bo->drv->priv;
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700189
Gurchetan Singh458976f2016-11-23 17:32:33 -0800190 if (flags & (BO_USE_CURSOR | BO_USE_LINEAR |
191 BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN))
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700192 tiling_mode = I915_TILING_NONE;
Gurchetan Singh458976f2016-11-23 17:32:33 -0800193 else if (flags & BO_USE_SCANOUT)
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700194 tiling_mode = I915_TILING_X;
Gurchetan Singh6bab0c12016-10-13 19:08:48 -0700195 else
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700196 tiling_mode = I915_TILING_Y;
197
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800198 i915_align_dimensions(bo->drv, tiling_mode, &width, &height, bpp);
Gurchetan Singh42cc6d62016-08-29 18:19:19 -0700199 drv_bo_from_format(bo, width, height, format);
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800200
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800201 if (!i915_verify_dimensions(bo->drv, bo->strides[0], height))
202 return -EINVAL;
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800203
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800204 snprintf(name, sizeof(name), "i915-buffer-%u", i915_dev->count);
205 i915_dev->count++;
Stéphane Marchesin5d867a42014-11-24 17:09:49 -0800206
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800207 i915_bo = calloc(1, sizeof(*i915_bo));
208 if (!i915_bo)
209 return -ENOMEM;
210
211 bo->priv = i915_bo;
212
213 i915_bo->ibos[0] = drm_intel_bo_alloc(i915_dev->mgr, name,
214 bo->total_size, 0);
215 if (!i915_bo->ibos[0]) {
216 fprintf(stderr, "drv: drm_intel_bo_alloc failed");
217 free(i915_bo);
218 bo->priv = NULL;
219 return -ENOMEM;
Ilja H. Friedelf9d2ab72015-04-09 14:08:36 -0700220 }
Gurchetan Singh83dc4fb2016-07-19 15:52:33 -0700221
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800222 for (plane = 0; plane < bo->num_planes; plane++) {
223 if (plane > 0)
224 drm_intel_bo_reference(i915_bo->ibos[0]);
Daniel Nicoara1de26dc2014-09-25 18:53:19 -0400225
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800226 bo->handles[plane].u32 = i915_bo->ibos[0]->handle;
227 i915_bo->ibos[plane] = i915_bo->ibos[0];
228 }
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700229
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800230 bo->tiling = tiling_mode;
231
232 ret = drm_intel_bo_set_tiling(i915_bo->ibos[0], &bo->tiling,
233 bo->strides[0]);
234
235 if (ret || bo->tiling != tiling_mode) {
236 fprintf(stderr, "drv: drm_intel_gem_bo_set_tiling failed "
237 "errno=%x, stride=%x\n", errno, bo->strides[0]);
238 /* Calls i915 bo destroy. */
239 bo->drv->backend->bo_destroy(bo);
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700240 return -errno;
241 }
242
243 return 0;
244}
245
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800246static int i915_bo_destroy(struct bo *bo)
247{
248 size_t plane;
249 struct i915_bo *i915_bo = bo->priv;
250
251 for (plane = 0; plane < bo->num_planes; plane++)
252 drm_intel_bo_unreference(i915_bo->ibos[plane]);
253
254 free(i915_bo);
255 bo->priv = NULL;
256
257 return 0;
258}
259
260static int i915_bo_import(struct bo *bo, struct drv_import_fd_data *data)
261{
262 size_t plane;
263 uint32_t swizzling;
264 struct i915_bo *i915_bo;
265 struct i915_device *i915_dev = bo->drv->priv;
266
267 i915_bo = calloc(1, sizeof(*i915_bo));
268 if (!i915_bo)
269 return -ENOMEM;
270
271 bo->priv = i915_bo;
272
273 /*
274 * When self-importing, libdrm_intel increments the reference count
275 * on the drm_intel_bo. It also returns the same drm_intel_bo per GEM
276 * handle. Thus, we don't need to increase the reference count
277 * (i.e, drv_increment_reference_count) when importing with this
278 * backend.
279 */
280 for (plane = 0; plane < bo->num_planes; plane++) {
281
282 i915_bo->ibos[plane] = drm_intel_bo_gem_create_from_prime(i915_dev->mgr,
283 data->fds[plane], data->sizes[plane]);
284
285 if (!i915_bo->ibos[plane]) {
286 /*
287 * Need to call GEM close on planes that were opened,
288 * if any. Adjust the num_planes variable to be the
289 * plane that failed, so GEM close will be called on
290 * planes before that plane.
291 */
292 bo->num_planes = plane;
293 i915_bo_destroy(bo);
294 fprintf(stderr, "drv: i915: failed to import failed");
295 return -EINVAL;
296 }
297
298 bo->handles[plane].u32 = i915_bo->ibos[plane]->handle;
299 }
300
301 if (drm_intel_bo_get_tiling(i915_bo->ibos[0], &bo->tiling,
302 &swizzling)) {
303 fprintf(stderr, "drv: drm_intel_bo_get_tiling failed");
304 i915_bo_destroy(bo);
305 return -EINVAL;
306 }
307
308 return 0;
309}
310
Gurchetan Singh1a31e602016-10-06 10:58:00 -0700311static void *i915_bo_map(struct bo *bo, struct map_info *data, size_t plane)
Gurchetan Singhef920532016-08-12 16:38:25 -0700312{
313 int ret;
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800314 struct i915_bo *i915_bo = bo->priv;
Gurchetan Singhef920532016-08-12 16:38:25 -0700315
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800316 if (bo->tiling == I915_TILING_NONE)
317 /* TODO(gsingh): use bo_map flags to determine if we should
318 * enable writing.
319 */
320 ret = drm_intel_bo_map(i915_bo->ibos[0], 1);
321 else
322 ret = drm_intel_gem_bo_map_gtt(i915_bo->ibos[0]);
Gurchetan Singhef920532016-08-12 16:38:25 -0700323
Gurchetan Singhef920532016-08-12 16:38:25 -0700324 if (ret) {
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800325 fprintf(stderr, "drv: i915_bo_map failed.");
Gurchetan Singhef920532016-08-12 16:38:25 -0700326 return MAP_FAILED;
327 }
328
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800329 return i915_bo->ibos[0]->virtual;
330}
Gurchetan Singh1a31e602016-10-06 10:58:00 -0700331
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800332static int i915_bo_unmap(struct bo *bo, struct map_info *data)
333{
334 int ret;
335 struct i915_bo *i915_bo = bo->priv;
336
337 if (bo->tiling == I915_TILING_NONE)
338 ret = drm_intel_bo_unmap(i915_bo->ibos[0]);
339 else
340 ret = drm_intel_gem_bo_unmap_gtt(i915_bo->ibos[0]);
341
342 return ret;
Gurchetan Singhef920532016-08-12 16:38:25 -0700343}
344
Gurchetan Singhf3b22da2016-11-21 10:46:38 -0800345static uint32_t i915_resolve_format(uint32_t format)
Gurchetan Singhbfba8c22016-08-16 17:57:10 -0700346{
347 switch (format) {
Gurchetan Singhf3b22da2016-11-21 10:46:38 -0800348 case DRM_FORMAT_FLEX_IMPLEMENTATION_DEFINED:
Gurchetan Singhd6fb5772016-08-29 19:13:51 -0700349 /*HACK: See b/28671744 */
Gurchetan Singhf3b22da2016-11-21 10:46:38 -0800350 return DRM_FORMAT_XBGR8888;
351 case DRM_FORMAT_FLEX_YCbCr_420_888:
352 return DRM_FORMAT_YVU420;
Gurchetan Singhd6fb5772016-08-29 19:13:51 -0700353 default:
354 return format;
Gurchetan Singhbfba8c22016-08-16 17:57:10 -0700355 }
356}
357
Gurchetan Singh179687e2016-10-28 10:07:35 -0700358struct backend backend_i915 =
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700359{
360 .name = "i915",
Gurchetan Singhd7c84fd2016-08-16 18:18:24 -0700361 .init = i915_init,
362 .close = i915_close,
363 .bo_create = i915_bo_create,
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800364 .bo_destroy = i915_bo_destroy,
365 .bo_import = i915_bo_import,
Gurchetan Singhd7c84fd2016-08-16 18:18:24 -0700366 .bo_map = i915_bo_map,
Gurchetan Singh82a8eed2017-01-03 13:01:37 -0800367 .bo_unmap = i915_bo_unmap,
Gurchetan Singhbfba8c22016-08-16 17:57:10 -0700368 .resolve_format = i915_resolve_format,
Stéphane Marchesin25a26062014-09-12 16:18:59 -0700369};
370
371#endif