aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInki Dae2013-02-18 06:51:00 -0600
committerRob Clark2013-03-08 10:49:42 -0600
commitbbf6e3dea3c79ea8e0c3e1dd8f80014201e003fc (patch)
treeccf81397767c8ee57073fb6e1e4fef45a1acb766 /exynos/exynos_drm.h
parentade2ad2d66ac341a12eca37bcb30d40199eb4e02 (diff)
downloadexternal-libgbm-bbf6e3dea3c79ea8e0c3e1dd8f80014201e003fc.tar.gz
external-libgbm-bbf6e3dea3c79ea8e0c3e1dd8f80014201e003fc.tar.xz
external-libgbm-bbf6e3dea3c79ea8e0c3e1dd8f80014201e003fc.zip
libdrm/exynos: add test application for 2d gpu.
This patch adds library and test application for g2d gpu(fimg2d). The fimg2d hardware is a 2D graphics accelerator(G2D) that supports Bit Block Transfer(BitBLT). The library includes the following primitive drawing operations: .solid fill - This operation fills the given buffer with the given color data. .copy - This operation copies contents in source buffer to destination buffer. .copy_with_scale - This operation copies contents in source buffer to destination buffer scaling up or down properly. .blend - This operation blends contents in source buffer with the ones in destination buffer. And the above operations uses gem handle or user space address allocated by malloc() as source or destination buffer. And the test application includes just simple primitive drawing tests with the above library. And the guide to test is as the following, "#exynos_fimg2d_test -s connector_id@crtc_id:mode" With this above simple command, four primitive drawing operations would be called step by step and also rendered on the output device to the given connector and crtc id. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'exynos/exynos_drm.h')
-rw-r--r--exynos/exynos_drm.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/exynos/exynos_drm.h b/exynos/exynos_drm.h
index aa97b223..c3c6579e 100644
--- a/exynos/exynos_drm.h
+++ b/exynos/exynos_drm.h
@@ -123,6 +123,46 @@ enum e_drm_exynos_gem_mem_type {
123 EXYNOS_BO_WC 123 EXYNOS_BO_WC
124}; 124};
125 125
126struct drm_exynos_g2d_get_ver {
127 __u32 major;
128 __u32 minor;
129};
130
131struct drm_exynos_g2d_cmd {
132 __u32 offset;
133 __u32 data;
134};
135
136enum drm_exynos_g2d_buf_type {
137 G2D_BUF_USERPTR = 1 << 31,
138};
139
140enum drm_exynos_g2d_event_type {
141 G2D_EVENT_NOT,
142 G2D_EVENT_NONSTOP,
143 G2D_EVENT_STOP, /* not yet */
144};
145
146struct drm_exynos_g2d_userptr {
147 unsigned long userptr;
148 unsigned long size;
149};
150
151struct drm_exynos_g2d_set_cmdlist {
152 __u64 cmd;
153 __u64 cmd_buf;
154 __u32 cmd_nr;
155 __u32 cmd_buf_nr;
156
157 /* for g2d event */
158 __u64 event_type;
159 __u64 user_data;
160};
161
162struct drm_exynos_g2d_exec {
163 __u64 async;
164};
165
126#define DRM_EXYNOS_GEM_CREATE 0x00 166#define DRM_EXYNOS_GEM_CREATE 0x00
127#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 167#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01
128#define DRM_EXYNOS_GEM_MMAP 0x02 168#define DRM_EXYNOS_GEM_MMAP 0x02
@@ -130,6 +170,11 @@ enum e_drm_exynos_gem_mem_type {
130#define DRM_EXYNOS_GEM_GET 0x04 170#define DRM_EXYNOS_GEM_GET 0x04
131#define DRM_EXYNOS_VIDI_CONNECTION 0x07 171#define DRM_EXYNOS_VIDI_CONNECTION 0x07
132 172
173/* G2D */
174#define DRM_EXYNOS_G2D_GET_VER 0x20
175#define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
176#define DRM_EXYNOS_G2D_EXEC 0x22
177
133#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ 178#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
134 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) 179 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
135 180
@@ -145,4 +190,11 @@ enum e_drm_exynos_gem_mem_type {
145#define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \ 190#define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \
146 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection) 191 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection)
147 192
193#define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \
194 DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)
195#define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
196 DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist)
197#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
198 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
199
148#endif 200#endif