aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/omapgfx/gfx_bc.h
blob: ea2bf226925476a9e2d9dc31dbb3a2981c939908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**********************************************************************
 *
 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2. This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 *
 ******************************************************************************/

#ifndef __V4L2_GFX_BC_H__
#define __V4L2_GFX_BC_H__

#include <media/v4l2-dev.h>

struct bc_buf_params_common {
	int count;	/*number of buffers */
	int width;	/*buffer width in pixel, multiple of 32 */
	int height;	/*buffer height in pixel  */
	u32 pixel_fmt;	/* V4L2 buffer pixel format */
	int stride;
	int size;
};

struct bc_buf_params {
	int count;	/*number of buffers (in) */
	int width;	/*buffer width in pixel, multiple of 32 (in) */
	int height;	/*buffer height in pixel (in) */
	u32 pixel_fmt;	/* V4L2 buffer pixel format (in) */
	int stride;	/*(out) */
	int size;	/*(out */
};

struct bc_buf_params2 {
	int count;	/*number of buffers (in) */
	int width;	/*buffer width in pixel, multiple of 32 (in) */
	int height;	/*buffer height in pixel (in) */
	u32 pixel_fmt;	/* V4L2 buffer pixel format (in) */
	int stride;	/*(in) */
	int size;	/*(out */
};
extern int bc_init(void);
extern void bc_cleanup(void);

/* bc_setup
 *
 * This API will validate the buffer parameters in order to setup a
 * buffer class device. Buffers should be added with subsequent calls to
 * bc_setup_buffer()
 */
extern int bc_setup(int id, struct bc_buf_params2 *p);

/* bc_setup_buffer
 *
 * Only called after a successful bc_setup(), add a physical buffer reference
 * to this device
 */
extern int bc_setup_buffer(
			int id, struct bc_buf_params2 *p, unsigned long *paddr);

/* bc_setup_complete
 *
 * Called after all physical buffers have been added to the device
 */
extern int bc_setup_complete(int id, struct bc_buf_params2 *p);

/* bc_sync_status
 *
 * Return the synchronization status of this devices buffer
 *
 * Return values:
 * 0	SGX still has pending operations on the buffer
 * 1	SGX done with the buffer
 */
extern int bc_sync_status(int id, int bufidx);
#endif