2 * drivers/media/video/omap/omap_voutdef.h
4 * Copyright (C) 2009 Texas Instruments.
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.
11 #ifndef OMAP_VOUTDEF_H
12 #define OMAP_VOUTDEF_H
14 #include <plat/display.h>
21 #define YUYV_VRFB_BPP 2
22 #define RGB_VRFB_BPP 1
24 #define MAC_VRFB_CTXS 4
25 #define MAX_VOUT_DEV 2
27 #define MAX_DISPLAYS 3
28 #define MAX_MANAGERS 3
31 * DSS understands rotation in 0, 1, 2, 3 context
32 * while V4L2 driver understands it as 0, 90, 180, 270
35 dss_rotation_0_degree
= 0,
36 dss_rotation_90_degree
= 1,
37 dss_rotation_180_degree
= 2,
38 dss_rotation_270_degree
= 3,
41 * This structure is used to store the DMA transfer parameters
42 * for VRFB hidden buffer
49 wait_queue_head_t wait
;
52 struct omapvideo_info
{
55 struct omap_overlay
*overlays
[MAX_OVLS
];
58 struct omap2video_device
{
63 struct v4l2_device v4l2_dev
;
65 struct omap_vout_device
*vouts
[MAX_VOUT_DEV
];
68 struct omap_dss_device
*displays
[MAX_DISPLAYS
];
70 struct omap_overlay
*overlays
[MAX_OVLS
];
72 struct omap_overlay_manager
*managers
[MAX_MANAGERS
];
75 /* per-device data structure */
76 struct omap_vout_device
{
78 struct omapvideo_info vid_info
;
79 struct video_device
*vfd
;
80 struct omap2video_device
*vid_dev
;
84 /* we don't allow to change image fmt/size once buffer has
88 /* allow to reuse previously allocated buffer which is big enough */
90 /* keep buffer info across opens */
91 unsigned long buf_virt_addr
[VIDEO_MAX_FRAME
];
92 unsigned long buf_phy_addr
[VIDEO_MAX_FRAME
];
93 enum omap_color_mode dss_mode
;
95 /* we don't allow to request new buffer when old buffers are
100 spinlock_t vbq_lock
; /* spinlock for videobuf queues */
101 unsigned long field_count
; /* field counter for videobuf_buffer */
103 /* non-NULL means streaming is in progress. */
106 struct v4l2_pix_format pix
;
107 struct v4l2_rect crop
;
108 struct v4l2_window win
;
109 struct v4l2_framebuffer fbuf
;
111 /* Lock to protect the shared data structures in ioctl */
114 /* V4L2 control structure for different control id */
115 struct v4l2_control control
[MAX_CID
];
116 enum dss_rotation rotation
;
119 /* V4L2 control structure for different control id */
121 int bpp
; /* bytes per pixel */
122 int vrfb_bpp
; /* bytes per pixel with respect to VRFB */
124 struct vid_vrfb_dma vrfb_dma_tx
;
125 unsigned int smsshado_phy_addr
[MAC_VRFB_CTXS
];
126 unsigned int smsshado_virt_addr
[MAC_VRFB_CTXS
];
127 struct vrfb vrfb_context
[MAC_VRFB_CTXS
];
128 bool vrfb_static_allocation
;
129 unsigned int smsshado_size
;
132 int ps
, vr_ps
, line_length
, first_int
, field_id
;
133 enum v4l2_memory memory
;
134 struct videobuf_buffer
*cur_frm
, *next_frm
;
135 struct list_head dma_queue
;
136 u8
*queued_buf_addr
[VIDEO_MAX_FRAME
];
138 s32 tv_field1_offset
;
141 /* Buffer queue variables */
142 struct omap_vout_device
*vout
;
143 enum v4l2_buf_type type
;
144 struct videobuf_queue vbq
;
148 #endif /* ifndef OMAP_VOUTDEF_H */