forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/rockchip: Add GEM create ioctl support
Rockchip Socs have GPU, we need allocate GPU accelerated buffers. So add special ioctls GEM_CREATE to support accelerated buffers. Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org>
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* | ||
* Copyright (c) Fuzhou Rockchip Electronics Co.Ltd | ||
* Authors: | ||
* Mark Yao <yzq@rock-chips.com> | ||
* | ||
* base on exynos_drm.h | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#ifndef _UAPI_ROCKCHIP_DRM_H | ||
#define _UAPI_ROCKCHIP_DRM_H | ||
|
||
#include <drm/drm.h> | ||
|
||
/** | ||
* User-desired buffer creation information structure. | ||
* | ||
* @size: user-desired memory allocation size. | ||
* @flags: user request for setting memory type or cache attributes. | ||
* @handle: returned a handle to created gem object. | ||
* - this handle will be set by gem module of kernel side. | ||
*/ | ||
struct drm_rockchip_gem_create { | ||
uint64_t size; | ||
uint32_t flags; | ||
uint32_t handle; | ||
}; | ||
|
||
/** | ||
* A structure for getting buffer offset. | ||
* | ||
* @handle: a pointer to gem object created. | ||
* @pad: just padding to be 64-bit aligned. | ||
* @offset: relatived offset value of the memory region allocated. | ||
* - this value should be set by user. | ||
*/ | ||
struct drm_rockchip_gem_map_off { | ||
uint32_t handle; | ||
uint32_t pad; | ||
uint64_t offset; | ||
}; | ||
|
||
#define DRM_ROCKCHIP_GEM_CREATE 0x00 | ||
#define DRM_ROCKCHIP_GEM_MAP_OFFSET 0x01 | ||
|
||
#define DRM_IOCTL_ROCKCHIP_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ | ||
DRM_ROCKCHIP_GEM_CREATE, struct drm_rockchip_gem_create) | ||
|
||
#define DRM_IOCTL_ROCKCHIP_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \ | ||
DRM_ROCKCHIP_GEM_MAP_OFFSET, struct drm_rockchip_gem_map_off) | ||
|
||
#endif /* _UAPI_ROCKCHIP_DRM_H */ |