OSDN Git Service

minigbm: consolidate flags
[android-x86/external-minigbm.git] / virtio_gpu.c
1 /*
2  * Copyright 2016 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
7 #include "drv_priv.h"
8 #include "helpers.h"
9 #include "util.h"
10
11 static struct supported_combination combos[2] = {
12         {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
13                 BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
14                 BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
15         {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
16                 BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
17                 BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
18 };
19
20 static int virtio_gpu_init(struct driver *drv)
21 {
22         drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
23         return drv_add_kms_flags(drv);
24 }
25
26 struct backend backend_virtio_gpu =
27 {
28         .name = "virtio_gpu",
29         .init = virtio_gpu_init,
30         .bo_create = drv_dumb_bo_create,
31         .bo_destroy = drv_dumb_bo_destroy,
32         .bo_map = drv_dumb_bo_map,
33 };
34