OSDN Git Service

minigbm: Fix cursor and scanout 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[4] = {
12         {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, DRV_BO_USE_CURSOR | DRV_BO_USE_LINEAR},
13         {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, DRV_BO_USE_RENDERING},
14         {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, DRV_BO_USE_CURSOR | DRV_BO_USE_LINEAR},
15         {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, DRV_BO_USE_RENDERING},
16 };
17
18 static int virtio_gpu_init(struct driver *drv)
19 {
20         drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
21         return drv_add_kms_flags(drv);
22 }
23
24 struct backend backend_virtio_gpu =
25 {
26         .name = "virtio_gpu",
27         .init = virtio_gpu_init,
28         .bo_create = drv_dumb_bo_create,
29         .bo_destroy = drv_dumb_bo_destroy,
30         .bo_map = drv_dumb_bo_map,
31 };
32