ed246f7d25603916ccd7bccb62ea6f2f78debb0b
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / rockchip / rockchip_drm_buf.h
1 /*
2  * Copyright (C) ROCKCHIP, Inc.
3  * Author:yzq<yzq@rock-chips.com>
4  * This software is licensed under the terms of the GNU General Public
5  * License version 2, as published by the Free Software Foundation, and
6  * may be copied, distributed, and modified under those terms.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13 #ifndef _ROCKCHIP_DRM_BUF_H_
14 #define _ROCKCHIP_DRM_BUF_H_
15
16 /* create and initialize buffer object. */
17 struct rockchip_drm_gem_buf *rockchip_drm_init_buf(struct drm_device *dev,
18                                                 unsigned int size);
19
20 /* destroy buffer object. */
21 void rockchip_drm_fini_buf(struct drm_device *dev,
22                                 struct rockchip_drm_gem_buf *buffer);
23
24 /* allocate physical memory region and setup sgt. */
25 int rockchip_drm_alloc_buf(struct drm_device *dev,
26                                 struct rockchip_drm_gem_buf *buf,
27                                 unsigned int flags);
28
29 /* release physical memory region, and sgt. */
30 void rockchip_drm_free_buf(struct drm_device *dev,
31                                 unsigned int flags,
32                                 struct rockchip_drm_gem_buf *buffer);
33
34 #endif