aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/drm
diff options
context:
space:
mode:
authorEunchul Kim <chulspro.kim@samsung.com>2012-12-14 04:10:31 -0500
committerInki Dae <daeinki@gmail.com>2012-12-14 12:29:08 -0500
commitcb471f14b5eebfed22bb9f2d0f06601f171c574a (patch)
tree955334335ef7d041553dc6d6b1351b9a8f3fa593 /include/uapi/drm
parentd636ead86fb806085de4ce98693e8d91c419d8f3 (diff)
drm/exynos: add ipp subsystem
This patch adds Image Post Processing(IPP) support for exynos drm driver. IPP supports image scaler/rotator and input/output DMA operations using IPP subsystem framework to control FIMC, Rotator and GSC hardware and supports some user interfaces for user side. And each IPP-based drivers support Memory to Memory operations with various converting. And in case of FIMC hardware, it also supports Writeback and Display output operations through local path. Features: - Memory to Memory operation support. - Various pixel formats support. - Image scaling support. - Color Space Conversion support. - Image crop operation support. - Rotate operation support to 90, 180 or 270 degree. - Flip operation support to vertical, horizontal or both. - Writeback operation support to display blended image of FIMD fifo on screen A summary to IPP Subsystem operations: First of all, user should get property capabilities from IPP subsystem and set these properties to hardware registers for desired operations. The properties could be pixel format, position, rotation degree and flip operation. And next, user should set source and destination buffer data using DRM_EXYNOS_IPP_QUEUE_BUF ioctl command with gem handles to source and destinition buffers. And next, user can control user-desired hardware with desired operations such as play, stop, pause and resume controls. And finally, user can aware of dma operation completion and also get destination buffer that it contains user-desried result through dequeue command. IOCTL commands: - DRM_EXYNOS_IPP_GET_PROPERTY . get ipp driver capabilitis and id. - DRM_EXYNOS_IPP_SET_PROPERTY . set format, position, rotation, flip to source and destination buffers - DRM_EXYNOS_IPP_QUEUE_BUF . enqueue/dequeue buffer and make event list. - DRM_EXYNOS_IPP_CMD_CTRL . play/stop/pause/resume control. Event: - DRM_EXYNOS_IPP_EVENT . a event to notify dma operation completion to user side. Basic control flow: Open -> Get properties -> User choose desired IPP sub driver(FIMC, Rotator or GSCALER) -> Set Property -> Create gem handle -> Enqueue to source and destination buffers -> Command control(Play) -> Event is notified to User -> User gets destinition buffer complated -> (Enqueue to source and destination buffers -> Event is notified to User) * N -> Queue/Dequeue to source and destination buffers -> Command control(Stop) -> Free gem handle -> Close Changelog v1 ~ v5: - added comments, code fixups and cleanups. Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com> Signed-off-by: Jinyoung Jeon <jy0.jeon@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'include/uapi/drm')
-rw-r--r--include/uapi/drm/exynos_drm.h190
1 files changed, 190 insertions, 0 deletions
diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index 49f010f2b27f..e7f52c334005 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -163,6 +163,170 @@ struct drm_exynos_g2d_exec {
163 __u64 async; 163 __u64 async;
164}; 164};
165 165
166enum drm_exynos_ops_id {
167 EXYNOS_DRM_OPS_SRC,
168 EXYNOS_DRM_OPS_DST,
169 EXYNOS_DRM_OPS_MAX,
170};
171
172struct drm_exynos_sz {
173 __u32 hsize;
174 __u32 vsize;
175};
176
177struct drm_exynos_pos {
178 __u32 x;
179 __u32 y;
180 __u32 w;
181 __u32 h;
182};
183
184enum drm_exynos_flip {
185 EXYNOS_DRM_FLIP_NONE = (0 << 0),
186 EXYNOS_DRM_FLIP_VERTICAL = (1 << 0),
187 EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1),
188};
189
190enum drm_exynos_degree {
191 EXYNOS_DRM_DEGREE_0,
192 EXYNOS_DRM_DEGREE_90,
193 EXYNOS_DRM_DEGREE_180,
194 EXYNOS_DRM_DEGREE_270,
195};
196
197enum drm_exynos_planer {
198 EXYNOS_DRM_PLANAR_Y,
199 EXYNOS_DRM_PLANAR_CB,
200 EXYNOS_DRM_PLANAR_CR,
201 EXYNOS_DRM_PLANAR_MAX,
202};
203
204/**
205 * A structure for ipp supported property list.
206 *
207 * @version: version of this structure.
208 * @ipp_id: id of ipp driver.
209 * @count: count of ipp driver.
210 * @writeback: flag of writeback supporting.
211 * @flip: flag of flip supporting.
212 * @degree: flag of degree information.
213 * @csc: flag of csc supporting.
214 * @crop: flag of crop supporting.
215 * @scale: flag of scale supporting.
216 * @refresh_min: min hz of refresh.
217 * @refresh_max: max hz of refresh.
218 * @crop_min: crop min resolution.
219 * @crop_max: crop max resolution.
220 * @scale_min: scale min resolution.
221 * @scale_max: scale max resolution.
222 */
223struct drm_exynos_ipp_prop_list {
224 __u32 version;
225 __u32 ipp_id;
226 __u32 count;
227 __u32 writeback;
228 __u32 flip;
229 __u32 degree;
230 __u32 csc;
231 __u32 crop;
232 __u32 scale;
233 __u32 refresh_min;
234 __u32 refresh_max;
235 __u32 reserved;
236 struct drm_exynos_sz crop_min;
237 struct drm_exynos_sz crop_max;
238 struct drm_exynos_sz scale_min;
239 struct drm_exynos_sz scale_max;
240};
241
242/**
243 * A structure for ipp config.
244 *
245 * @ops_id: property of operation directions.
246 * @flip: property of mirror, flip.
247 * @degree: property of rotation degree.
248 * @fmt: property of image format.
249 * @sz: property of image size.
250 * @pos: property of image position(src-cropped,dst-scaler).
251 */
252struct drm_exynos_ipp_config {
253 enum drm_exynos_ops_id ops_id;
254 enum drm_exynos_flip flip;
255 enum drm_exynos_degree degree;
256 __u32 fmt;
257 struct drm_exynos_sz sz;
258 struct drm_exynos_pos pos;
259};
260
261enum drm_exynos_ipp_cmd {
262 IPP_CMD_NONE,
263 IPP_CMD_M2M,
264 IPP_CMD_WB,
265 IPP_CMD_OUTPUT,
266 IPP_CMD_MAX,
267};
268
269/**
270 * A structure for ipp property.
271 *
272 * @config: source, destination config.
273 * @cmd: definition of command.
274 * @ipp_id: id of ipp driver.
275 * @prop_id: id of property.
276 * @refresh_rate: refresh rate.
277 */
278struct drm_exynos_ipp_property {
279 struct drm_exynos_ipp_config config[EXYNOS_DRM_OPS_MAX];
280 enum drm_exynos_ipp_cmd cmd;
281 __u32 ipp_id;
282 __u32 prop_id;
283 __u32 refresh_rate;
284};
285
286enum drm_exynos_ipp_buf_type {
287 IPP_BUF_ENQUEUE,
288 IPP_BUF_DEQUEUE,
289};
290
291/**
292 * A structure for ipp buffer operations.
293 *
294 * @ops_id: operation directions.
295 * @buf_type: definition of buffer.
296 * @prop_id: id of property.
297 * @buf_id: id of buffer.
298 * @handle: Y, Cb, Cr each planar handle.
299 * @user_data: user data.
300 */
301struct drm_exynos_ipp_queue_buf {
302 enum drm_exynos_ops_id ops_id;
303 enum drm_exynos_ipp_buf_type buf_type;
304 __u32 prop_id;
305 __u32 buf_id;
306 __u32 handle[EXYNOS_DRM_PLANAR_MAX];
307 __u32 reserved;
308 __u64 user_data;
309};
310
311enum drm_exynos_ipp_ctrl {
312 IPP_CTRL_PLAY,
313 IPP_CTRL_STOP,
314 IPP_CTRL_PAUSE,
315 IPP_CTRL_RESUME,
316 IPP_CTRL_MAX,
317};
318
319/**
320 * A structure for ipp start/stop operations.
321 *
322 * @prop_id: id of property.
323 * @ctrl: definition of control.
324 */
325struct drm_exynos_ipp_cmd_ctrl {
326 __u32 prop_id;
327 enum drm_exynos_ipp_ctrl ctrl;
328};
329
166#define DRM_EXYNOS_GEM_CREATE 0x00 330#define DRM_EXYNOS_GEM_CREATE 0x00
167#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 331#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01
168#define DRM_EXYNOS_GEM_MMAP 0x02 332#define DRM_EXYNOS_GEM_MMAP 0x02
@@ -175,6 +339,12 @@ struct drm_exynos_g2d_exec {
175#define DRM_EXYNOS_G2D_SET_CMDLIST 0x21 339#define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
176#define DRM_EXYNOS_G2D_EXEC 0x22 340#define DRM_EXYNOS_G2D_EXEC 0x22
177 341
342/* IPP - Image Post Processing */
343#define DRM_EXYNOS_IPP_GET_PROPERTY 0x30
344#define DRM_EXYNOS_IPP_SET_PROPERTY 0x31
345#define DRM_EXYNOS_IPP_QUEUE_BUF 0x32
346#define DRM_EXYNOS_IPP_CMD_CTRL 0x33
347
178#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ 348#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
179 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) 349 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
180 350
@@ -197,8 +367,18 @@ struct drm_exynos_g2d_exec {
197#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ 367#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
198 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec) 368 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
199 369
370#define DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
371 DRM_EXYNOS_IPP_GET_PROPERTY, struct drm_exynos_ipp_prop_list)
372#define DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
373 DRM_EXYNOS_IPP_SET_PROPERTY, struct drm_exynos_ipp_property)
374#define DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF DRM_IOWR(DRM_COMMAND_BASE + \
375 DRM_EXYNOS_IPP_QUEUE_BUF, struct drm_exynos_ipp_queue_buf)
376#define DRM_IOCTL_EXYNOS_IPP_CMD_CTRL DRM_IOWR(DRM_COMMAND_BASE + \
377 DRM_EXYNOS_IPP_CMD_CTRL, struct drm_exynos_ipp_cmd_ctrl)
378
200/* EXYNOS specific events */ 379/* EXYNOS specific events */
201#define DRM_EXYNOS_G2D_EVENT 0x80000000 380#define DRM_EXYNOS_G2D_EVENT 0x80000000
381#define DRM_EXYNOS_IPP_EVENT 0x80000001
202 382
203struct drm_exynos_g2d_event { 383struct drm_exynos_g2d_event {
204 struct drm_event base; 384 struct drm_event base;
@@ -209,4 +389,14 @@ struct drm_exynos_g2d_event {
209 __u32 reserved; 389 __u32 reserved;
210}; 390};
211 391
392struct drm_exynos_ipp_event {
393 struct drm_event base;
394 __u64 user_data;
395 __u32 tv_sec;
396 __u32 tv_usec;
397 __u32 prop_id;
398 __u32 reserved;
399 __u32 buf_id[EXYNOS_DRM_OPS_MAX];
400};
401
212#endif /* _UAPI_EXYNOS_DRM_H_ */ 402#endif /* _UAPI_EXYNOS_DRM_H_ */