aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/omap/omap_voutdef.h
diff options
context:
space:
mode:
authorarchit taneja <archit@ti.com>2011-06-14 02:54:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:05 -0400
commita137ac870ba7df53e0c68cf2af2c79a71a2050c0 (patch)
tree6a5eb70143928deaaa4aa0a7fa4137e4a19ad4f8 /drivers/media/video/omap/omap_voutdef.h
parente213e438ce2a7451572f1c00ed87893ca25d3ea9 (diff)
[media] OMAP_VOUT: CLEANUP: Move generic functions and macros to common files
Move the inline functions rotate_90_or_270(), rotation_enabled(), and calc_rotation() from omap_vout.c to omap_voutdef.h. Move the independent functions omap_vout_alloc_buffer() and omap_vout_free_buffer() to omap_voutlib.c. Remove extern identifier from function definitions in omap_voutlib.h Add static identifier to functions that are used locally in omap_vout.c Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap/omap_voutdef.h')
-rw-r--r--drivers/media/video/omap/omap_voutdef.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/media/video/omap/omap_voutdef.h b/drivers/media/video/omap/omap_voutdef.h
index 659497b84996..31e6261b2c49 100644
--- a/drivers/media/video/omap/omap_voutdef.h
+++ b/drivers/media/video/omap/omap_voutdef.h
@@ -27,6 +27,31 @@
27#define MAX_DISPLAYS 3 27#define MAX_DISPLAYS 3
28#define MAX_MANAGERS 3 28#define MAX_MANAGERS 3
29 29
30#define QQVGA_WIDTH 160
31#define QQVGA_HEIGHT 120
32
33/* Max Resolution supported by the driver */
34#define VID_MAX_WIDTH 1280 /* Largest width */
35#define VID_MAX_HEIGHT 720 /* Largest height */
36
37/* Mimimum requirement is 2x2 for DSS */
38#define VID_MIN_WIDTH 2
39#define VID_MIN_HEIGHT 2
40
41/* 2048 x 2048 is max res supported by OMAP display controller */
42#define MAX_PIXELS_PER_LINE 2048
43
44#define VRFB_TX_TIMEOUT 1000
45#define VRFB_NUM_BUFS 4
46
47/* Max buffer size tobe allocated during init */
48#define OMAP_VOUT_MAX_BUF_SIZE (VID_MAX_WIDTH*VID_MAX_HEIGHT*4)
49
50enum dma_channel_state {
51 DMA_CHAN_NOT_ALLOTED,
52 DMA_CHAN_ALLOTED,
53};
54
30/* Enum for Rotation 55/* Enum for Rotation
31 * DSS understands rotation in 0, 1, 2, 3 context 56 * DSS understands rotation in 0, 1, 2, 3 context
32 * while V4L2 driver understands it as 0, 90, 180, 270 57 * while V4L2 driver understands it as 0, 90, 180, 270
@@ -144,4 +169,41 @@ struct omap_vout_device {
144 int io_allowed; 169 int io_allowed;
145 170
146}; 171};
172
173/*
174 * Return true if rotation is 90 or 270
175 */
176static inline int rotate_90_or_270(const struct omap_vout_device *vout)
177{
178 return (vout->rotation == dss_rotation_90_degree ||
179 vout->rotation == dss_rotation_270_degree);
180}
181
182/*
183 * Return true if rotation is enabled
184 */
185static inline int rotation_enabled(const struct omap_vout_device *vout)
186{
187 return vout->rotation || vout->mirror;
188}
189
190/*
191 * Reverse the rotation degree if mirroring is enabled
192 */
193static inline int calc_rotation(const struct omap_vout_device *vout)
194{
195 if (!vout->mirror)
196 return vout->rotation;
197
198 switch (vout->rotation) {
199 case dss_rotation_90_degree:
200 return dss_rotation_270_degree;
201 case dss_rotation_270_degree:
202 return dss_rotation_90_degree;
203 case dss_rotation_180_degree:
204 return dss_rotation_0_degree;
205 default:
206 return dss_rotation_180_degree;
207 }
208}
147#endif /* ifndef OMAP_VOUTDEF_H */ 209#endif /* ifndef OMAP_VOUTDEF_H */