blob: 31b0995ad69169f890982d1ac28ac0425f884e9e [file] [log] [blame]
Thierry Redingd6a4c2c2012-12-01 10:30:38 +01001/*
2 * Copyright © 2012, 2013 Thierry Reding
3 * Copyright © 2013 Erik Faye-Lund
4 * Copyright © 2014 NVIDIA Corporation
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef __DRM_TEGRA_H__
26#define __DRM_TEGRA_H__ 1
27
28#include <stdint.h>
29#include <stdlib.h>
30
31struct drm_tegra_bo;
32struct drm_tegra;
33
34int drm_tegra_new(struct drm_tegra **drmp, int fd);
35void drm_tegra_close(struct drm_tegra *drm);
36
37int drm_tegra_bo_new(struct drm_tegra_bo **bop, struct drm_tegra *drm,
38 uint32_t flags, uint32_t size);
39int drm_tegra_bo_wrap(struct drm_tegra_bo **bop, struct drm_tegra *drm,
40 uint32_t handle, uint32_t flags, uint32_t size);
41struct drm_tegra_bo *drm_tegra_bo_ref(struct drm_tegra_bo *bo);
42void drm_tegra_bo_unref(struct drm_tegra_bo *bo);
43int drm_tegra_bo_get_handle(struct drm_tegra_bo *bo, uint32_t *handle);
44int drm_tegra_bo_map(struct drm_tegra_bo *bo, void **ptr);
45int drm_tegra_bo_unmap(struct drm_tegra_bo *bo);
46
Thierry Redingd3ad65d2014-11-27 15:31:34 +010047int drm_tegra_bo_get_flags(struct drm_tegra_bo *bo, uint32_t *flags);
48int drm_tegra_bo_set_flags(struct drm_tegra_bo *bo, uint32_t flags);
49
Thierry Redingf99522e2014-11-27 15:32:43 +010050struct drm_tegra_bo_tiling {
51 uint32_t mode;
52 uint32_t value;
53};
54
55int drm_tegra_bo_get_tiling(struct drm_tegra_bo *bo,
56 struct drm_tegra_bo_tiling *tiling);
57int drm_tegra_bo_set_tiling(struct drm_tegra_bo *bo,
58 const struct drm_tegra_bo_tiling *tiling);
59
Thierry Redingd6a4c2c2012-12-01 10:30:38 +010060#endif /* __DRM_TEGRA_H__ */