4 * Copyright (C) 2010 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
;
64 struct omap_vout_device
*vouts
[MAX_VOUT_DEV
];
67 struct omap_dss_device
*displays
[MAX_DISPLAYS
];
69 struct omap_overlay
*overlays
[MAX_OVLS
];
71 struct omap_overlay_manager
*managers
[MAX_MANAGERS
];
74 /* per-device data structure */
75 struct omap_vout_device
{
77 struct omapvideo_info vid_info
;
78 struct video_device
*vfd
;
79 struct omap2video_device
*vid_dev
;
83 /* we don't allow to change image fmt/size once buffer has
87 /* allow to reuse previously allocated buffer which is big enough */
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
;
94 /* we don't allow to request new buffer when old buffers are
99 spinlock_t vbq_lock
; /* spinlock for videobuf queues */
100 unsigned long field_count
; /* field counter for videobuf_buffer */
102 /* non-NULL means streaming is in progress. */
105 struct v4l2_pix_format pix
;
106 struct v4l2_rect crop
;
107 struct v4l2_window win
;
108 struct v4l2_framebuffer fbuf
;
110 /* Lock to protect the shared data structures in ioctl */
113 /* V4L2 control structure for different control id */
114 struct v4l2_control control
[MAX_CID
];
115 enum dss_rotation rotation
;
118 /* V4L2 control structure for different control id */
120 int bpp
; /* bytes per pixel */
121 int vrfb_bpp
; /* bytes per pixel with respect to VRFB */
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
;
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
];
137 s32 tv_field1_offset
;
140 /* Buffer queue variables */
141 struct omap_vout_device
*vout
;
142 enum v4l2_buf_type type
;
143 struct videobuf_queue vbq
;
147 #endif /* ifndef OMAP_VOUTDEF_H */