aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/omap/omap_voutdef.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/omap/omap_voutdef.h')
-rw-r--r--drivers/media/video/omap/omap_voutdef.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/drivers/media/video/omap/omap_voutdef.h b/drivers/media/video/omap/omap_voutdef.h
index 659497b84996..d793501cafcc 100644
--- a/drivers/media/video/omap/omap_voutdef.h
+++ b/drivers/media/video/omap/omap_voutdef.h
@@ -12,6 +12,7 @@
12#define OMAP_VOUTDEF_H 12#define OMAP_VOUTDEF_H
13 13
14#include <video/omapdss.h> 14#include <video/omapdss.h>
15#include <plat/vrfb.h>
15 16
16#define YUYV_BPP 2 17#define YUYV_BPP 2
17#define RGB565_BPP 2 18#define RGB565_BPP 2
@@ -27,6 +28,31 @@
27#define MAX_DISPLAYS 3 28#define MAX_DISPLAYS 3
28#define MAX_MANAGERS 3 29#define MAX_MANAGERS 3
29 30
31#define QQVGA_WIDTH 160
32#define QQVGA_HEIGHT 120
33
34/* Max Resolution supported by the driver */
35#define VID_MAX_WIDTH 1280 /* Largest width */
36#define VID_MAX_HEIGHT 720 /* Largest height */
37
38/* Mimimum requirement is 2x2 for DSS */
39#define VID_MIN_WIDTH 2
40#define VID_MIN_HEIGHT 2
41
42/* 2048 x 2048 is max res supported by OMAP display controller */
43#define MAX_PIXELS_PER_LINE 2048
44
45#define VRFB_TX_TIMEOUT 1000
46#define VRFB_NUM_BUFS 4
47
48/* Max buffer size tobe allocated during init */
49#define OMAP_VOUT_MAX_BUF_SIZE (VID_MAX_WIDTH*VID_MAX_HEIGHT*4)
50
51enum dma_channel_state {
52 DMA_CHAN_NOT_ALLOTED,
53 DMA_CHAN_ALLOTED,
54};
55
30/* Enum for Rotation 56/* Enum for Rotation
31 * DSS understands rotation in 0, 1, 2, 3 context 57 * DSS understands rotation in 0, 1, 2, 3 context
32 * while V4L2 driver understands it as 0, 90, 180, 270 58 * while V4L2 driver understands it as 0, 90, 180, 270
@@ -37,6 +63,18 @@ enum dss_rotation {
37 dss_rotation_180_degree = 2, 63 dss_rotation_180_degree = 2,
38 dss_rotation_270_degree = 3, 64 dss_rotation_270_degree = 3,
39}; 65};
66
67/* Enum for choosing rotation type for vout
68 * DSS2 doesn't understand no rotation as an
69 * option while V4L2 driver doesn't support
70 * rotation in the case where VRFB is not built in
71 * the kernel
72 */
73enum vout_rotaion_type {
74 VOUT_ROT_NONE = 0,
75 VOUT_ROT_VRFB = 1,
76};
77
40/* 78/*
41 * This structure is used to store the DMA transfer parameters 79 * This structure is used to store the DMA transfer parameters
42 * for VRFB hidden buffer 80 * for VRFB hidden buffer
@@ -53,6 +91,7 @@ struct omapvideo_info {
53 int id; 91 int id;
54 int num_overlays; 92 int num_overlays;
55 struct omap_overlay *overlays[MAX_OVLS]; 93 struct omap_overlay *overlays[MAX_OVLS];
94 enum vout_rotaion_type rotation_type;
56}; 95};
57 96
58struct omap2video_device { 97struct omap2video_device {
@@ -144,4 +183,43 @@ struct omap_vout_device {
144 int io_allowed; 183 int io_allowed;
145 184
146}; 185};
186
187/*
188 * Return true if rotation is 90 or 270
189 */
190static inline int is_rotation_90_or_270(const struct omap_vout_device *vout)
191{
192 return (vout->rotation == dss_rotation_90_degree ||
193 vout->rotation == dss_rotation_270_degree);
194}
195
196/*
197 * Return true if rotation is enabled
198 */
199static inline int is_rotation_enabled(const struct omap_vout_device *vout)
200{
201 return vout->rotation || vout->mirror;
202}
203
204/*
205 * Reverse the rotation degree if mirroring is enabled
206 */
207static inline int calc_rotation(const struct omap_vout_device *vout)
208{
209 if (!vout->mirror)
210 return vout->rotation;
211
212 switch (vout->rotation) {
213 case dss_rotation_90_degree:
214 return dss_rotation_270_degree;
215 case dss_rotation_270_degree:
216 return dss_rotation_90_degree;
217 case dss_rotation_180_degree:
218 return dss_rotation_0_degree;
219 default:
220 return dss_rotation_180_degree;
221 }
222}
223
224void omap_vout_free_buffers(struct omap_vout_device *vout);
147#endif /* ifndef OMAP_VOUTDEF_H */ 225#endif /* ifndef OMAP_VOUTDEF_H */