Daniele Castagna | 71db2b5 | 2016-12-16 16:24:06 -0500 | [diff] [blame] | 1 | /* |
Daniele Castagna | 7a755de | 2016-12-16 17:32:30 -0500 | [diff] [blame] | 2 | * Copyright 2016 The Chromium OS Authors. All rights reserved. |
Daniele Castagna | 71db2b5 | 2016-12-16 16:24:06 -0500 | [diff] [blame] | 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 | |
Gurchetan Singh | 8ac0c9a | 2017-05-15 09:34:22 -0700 | [diff] [blame] | 11 | static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 }; |
Daniele Castagna | 71db2b5 | 2016-12-16 16:24:06 -0500 | [diff] [blame] | 12 | |
| 13 | static int nouveau_init(struct driver *drv) |
| 14 | { |
Gurchetan Singh | 8ac0c9a | 2017-05-15 09:34:22 -0700 | [diff] [blame] | 15 | int ret; |
| 16 | ret = drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats), |
| 17 | &LINEAR_METADATA, BO_USE_RENDER_MASK); |
| 18 | if (ret) |
| 19 | return ret; |
| 20 | |
| 21 | return drv_modify_linear_combinations(drv); |
Daniele Castagna | 71db2b5 | 2016-12-16 16:24:06 -0500 | [diff] [blame] | 22 | } |
| 23 | |
Gurchetan Singh | 1b1d56a | 2017-03-10 16:25:23 -0800 | [diff] [blame] | 24 | struct backend backend_nouveau = { |
Daniele Castagna | 71db2b5 | 2016-12-16 16:24:06 -0500 | [diff] [blame] | 25 | .name = "nouveau", |
| 26 | .init = nouveau_init, |
| 27 | .bo_create = drv_dumb_bo_create, |
| 28 | .bo_destroy = drv_dumb_bo_destroy, |
Gurchetan Singh | 71611d6 | 2017-01-03 16:49:56 -0800 | [diff] [blame] | 29 | .bo_import = drv_prime_bo_import, |
Daniele Castagna | 71db2b5 | 2016-12-16 16:24:06 -0500 | [diff] [blame] | 30 | .bo_map = drv_dumb_bo_map, |
| 31 | }; |