diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-20 12:37:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-20 12:37:45 -0400 |
commit | fb091be08d1acf184e8801dfdcace6e0cb19b1fe (patch) | |
tree | cbd0c4200fd8628d592167589ca790e36fc4ae26 /drivers/media/video/omap/omap_voutdef.h | |
parent | bd7fc2f2d807fdb254f7efc542f8eec3f23e289e (diff) | |
parent | e8d0416796d43a950ec7b65629e53419b2e22453 (diff) |
Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (534 commits)
V4L/DVB (13554a): v4l: Use the video_drvdata function in drivers
V4L/DVB: vivi and mem2mem_testdev need slab.h to build
V4L/DVB: tm6000: bugfix image position
V4L/DVB: IR/imon: remove dead IMON_KEY_RELEASE_OFFSET
V4L/DVB: tm6000: README - add vbi
V4L/DVB: Fix unlock logic at medusa_video_init
V4L/DVB: fix dvb frontend lockup
V4L/DVB: s2255drv: remove dead code
V4L/DVB: s2255drv: return if vdev not found
V4L/DVB: ov511: cleanup: remove unneeded null check
V4L/DVB: media/mem2mem: dereferencing free memory
V4L/DVB: media/IR: Add missing include file to rc-map.c
V4L/DVB: dvb/stv6110x: cleanup error handling
V4L/DVB: ngene: Add lgdt3303 and mt2131 deps to Kconfig
V4L/DVB: ngene: start separating out DVB functions into separate file
V4L/DVB: ngene: split out card specific code into a separate file
V4L/DVB: ngene: split out i2c code into a separate file
V4L/DVB: ngene: add initial support for digital side of Avermedia m780
V4L/DVB: ngene: properly support boards where channel 0 isn't a TS input
V4L-DVB: ngene: make sure that tuner headers are included
...
Diffstat (limited to 'drivers/media/video/omap/omap_voutdef.h')
-rw-r--r-- | drivers/media/video/omap/omap_voutdef.h | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/drivers/media/video/omap/omap_voutdef.h b/drivers/media/video/omap/omap_voutdef.h new file mode 100644 index 000000000000..ea3a047f8bca --- /dev/null +++ b/drivers/media/video/omap/omap_voutdef.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* | ||
2 | * omap_voutdef.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef OMAP_VOUTDEF_H | ||
12 | #define OMAP_VOUTDEF_H | ||
13 | |||
14 | #include <plat/display.h> | ||
15 | |||
16 | #define YUYV_BPP 2 | ||
17 | #define RGB565_BPP 2 | ||
18 | #define RGB24_BPP 3 | ||
19 | #define RGB32_BPP 4 | ||
20 | #define TILE_SIZE 32 | ||
21 | #define YUYV_VRFB_BPP 2 | ||
22 | #define RGB_VRFB_BPP 1 | ||
23 | #define MAX_CID 3 | ||
24 | #define MAC_VRFB_CTXS 4 | ||
25 | #define MAX_VOUT_DEV 2 | ||
26 | #define MAX_OVLS 3 | ||
27 | #define MAX_DISPLAYS 3 | ||
28 | #define MAX_MANAGERS 3 | ||
29 | |||
30 | /* Enum for Rotation | ||
31 | * DSS understands rotation in 0, 1, 2, 3 context | ||
32 | * while V4L2 driver understands it as 0, 90, 180, 270 | ||
33 | */ | ||
34 | enum dss_rotation { | ||
35 | dss_rotation_0_degree = 0, | ||
36 | dss_rotation_90_degree = 1, | ||
37 | dss_rotation_180_degree = 2, | ||
38 | dss_rotation_270_degree = 3, | ||
39 | }; | ||
40 | /* | ||
41 | * This structure is used to store the DMA transfer parameters | ||
42 | * for VRFB hidden buffer | ||
43 | */ | ||
44 | struct vid_vrfb_dma { | ||
45 | int dev_id; | ||
46 | int dma_ch; | ||
47 | int req_status; | ||
48 | int tx_status; | ||
49 | wait_queue_head_t wait; | ||
50 | }; | ||
51 | |||
52 | struct omapvideo_info { | ||
53 | int id; | ||
54 | int num_overlays; | ||
55 | struct omap_overlay *overlays[MAX_OVLS]; | ||
56 | }; | ||
57 | |||
58 | struct omap2video_device { | ||
59 | struct mutex mtx; | ||
60 | |||
61 | int state; | ||
62 | |||
63 | struct v4l2_device v4l2_dev; | ||
64 | struct omap_vout_device *vouts[MAX_VOUT_DEV]; | ||
65 | |||
66 | int num_displays; | ||
67 | struct omap_dss_device *displays[MAX_DISPLAYS]; | ||
68 | int num_overlays; | ||
69 | struct omap_overlay *overlays[MAX_OVLS]; | ||
70 | int num_managers; | ||
71 | struct omap_overlay_manager *managers[MAX_MANAGERS]; | ||
72 | }; | ||
73 | |||
74 | /* per-device data structure */ | ||
75 | struct omap_vout_device { | ||
76 | |||
77 | struct omapvideo_info vid_info; | ||
78 | struct video_device *vfd; | ||
79 | struct omap2video_device *vid_dev; | ||
80 | int vid; | ||
81 | int opened; | ||
82 | |||
83 | /* we don't allow to change image fmt/size once buffer has | ||
84 | * been allocated | ||
85 | */ | ||
86 | int buffer_allocated; | ||
87 | /* allow to reuse previously allocated buffer which is big enough */ | ||
88 | int buffer_size; | ||
89 | /* keep buffer info across opens */ | ||
90 | unsigned long buf_virt_addr[VIDEO_MAX_FRAME]; | ||
91 | unsigned long buf_phy_addr[VIDEO_MAX_FRAME]; | ||
92 | enum omap_color_mode dss_mode; | ||
93 | |||
94 | /* we don't allow to request new buffer when old buffers are | ||
95 | * still mmaped | ||
96 | */ | ||
97 | int mmap_count; | ||
98 | |||
99 | spinlock_t vbq_lock; /* spinlock for videobuf queues */ | ||
100 | unsigned long field_count; /* field counter for videobuf_buffer */ | ||
101 | |||
102 | /* non-NULL means streaming is in progress. */ | ||
103 | bool streaming; | ||
104 | |||
105 | struct v4l2_pix_format pix; | ||
106 | struct v4l2_rect crop; | ||
107 | struct v4l2_window win; | ||
108 | struct v4l2_framebuffer fbuf; | ||
109 | |||
110 | /* Lock to protect the shared data structures in ioctl */ | ||
111 | struct mutex lock; | ||
112 | |||
113 | /* V4L2 control structure for different control id */ | ||
114 | struct v4l2_control control[MAX_CID]; | ||
115 | enum dss_rotation rotation; | ||
116 | bool mirror; | ||
117 | int flicker_filter; | ||
118 | /* V4L2 control structure for different control id */ | ||
119 | |||
120 | int bpp; /* bytes per pixel */ | ||
121 | int vrfb_bpp; /* bytes per pixel with respect to VRFB */ | ||
122 | |||
123 | struct vid_vrfb_dma vrfb_dma_tx; | ||
124 | unsigned int smsshado_phy_addr[MAC_VRFB_CTXS]; | ||
125 | unsigned int smsshado_virt_addr[MAC_VRFB_CTXS]; | ||
126 | struct vrfb vrfb_context[MAC_VRFB_CTXS]; | ||
127 | bool vrfb_static_allocation; | ||
128 | unsigned int smsshado_size; | ||
129 | unsigned char pos; | ||
130 | |||
131 | int ps, vr_ps, line_length, first_int, field_id; | ||
132 | enum v4l2_memory memory; | ||
133 | struct videobuf_buffer *cur_frm, *next_frm; | ||
134 | struct list_head dma_queue; | ||
135 | u8 *queued_buf_addr[VIDEO_MAX_FRAME]; | ||
136 | u32 cropped_offset; | ||
137 | s32 tv_field1_offset; | ||
138 | void *isr_handle; | ||
139 | |||
140 | /* Buffer queue variables */ | ||
141 | struct omap_vout_device *vout; | ||
142 | enum v4l2_buf_type type; | ||
143 | struct videobuf_queue vbq; | ||
144 | int io_allowed; | ||
145 | |||
146 | }; | ||
147 | #endif /* ifndef OMAP_VOUTDEF_H */ | ||