blob: e62d127820de5a83e8382e9972e58e67da49eb92 [file] [log] [blame]
Rob Clarkef1b9582012-03-28 14:39:43 -05001/*
2 * Copyright (C) 2011 Texas Instruments, Inc
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *
23 * Authors:
24 * Rob Clark <rob@ti.com>
25 */
26
27#ifndef OMAP_DRMIF_H_
28#define OMAP_DRMIF_H_
29
30#include <xf86drm.h>
31#include <stdint.h>
32#include <omap_drm.h>
33
34struct omap_bo;
35struct omap_device;
36
37/* device related functions:
38 */
39
40struct omap_device * omap_device_new(int fd);
Rob Clark22574aa2012-07-13 16:18:25 -050041struct omap_device * omap_device_ref(struct omap_device *dev);
Rob Clarkef1b9582012-03-28 14:39:43 -050042void omap_device_del(struct omap_device *dev);
43int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value);
44int omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value);
45
46/* buffer-object related functions:
47 */
48
49struct omap_bo * omap_bo_new(struct omap_device *dev,
50 uint32_t size, uint32_t flags);
51struct omap_bo * omap_bo_new_tiled(struct omap_device *dev,
52 uint32_t width, uint32_t height, uint32_t flags);
Rob Clark22574aa2012-07-13 16:18:25 -050053struct omap_bo * omap_bo_ref(struct omap_bo *bo);
Rob Clarkef1b9582012-03-28 14:39:43 -050054struct omap_bo * omap_bo_from_name(struct omap_device *dev, uint32_t name);
Rob Clark42f8a682012-06-11 17:17:17 -050055struct omap_bo * omap_bo_from_dmabuf(struct omap_device *dev, int fd);
Rob Clarkef1b9582012-03-28 14:39:43 -050056void omap_bo_del(struct omap_bo *bo);
57int omap_bo_get_name(struct omap_bo *bo, uint32_t *name);
58uint32_t omap_bo_handle(struct omap_bo *bo);
Rob Clarkf00efc72012-04-11 09:51:36 -050059int omap_bo_dmabuf(struct omap_bo *bo);
Rob Clarkef1b9582012-03-28 14:39:43 -050060uint32_t omap_bo_size(struct omap_bo *bo);
61void * omap_bo_map(struct omap_bo *bo);
62int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op);
63int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op);
64
65#endif /* OMAP_DRMIF_H_ */