Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vpbe_display.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation version 2.
7  *
8  * This program is distributed WITHOUT ANY WARRANTY of any
9  * kind, whether express or implied; without even the implied warranty
10  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  */
13 #ifndef VPBE_DISPLAY_H
14 #define VPBE_DISPLAY_H
15 
16 /* Header files */
17 #include <linux/videodev2.h>
18 #include <media/v4l2-common.h>
21 #include <media/davinci/vpbe_osd.h>
22 #include <media/davinci/vpbe.h>
23 
24 #define VPBE_DISPLAY_MAX_DEVICES 2
25 
29 };
30 
31 #define VPBE_DISPLAY_DRV_NAME "vpbe-display"
32 
33 #define VPBE_DISPLAY_MAJOR_RELEASE 1
34 #define VPBE_DISPLAY_MINOR_RELEASE 0
35 #define VPBE_DISPLAY_BUILD 1
36 #define VPBE_DISPLAY_VERSION_CODE ((VPBE_DISPLAY_MAJOR_RELEASE << 16) | \
37  (VPBE_DISPLAY_MINOR_RELEASE << 8) | \
38  VPBE_DISPLAY_BUILD)
39 
40 #define VPBE_DISPLAY_VALID_FIELD(field) ((V4L2_FIELD_NONE == field) || \
41  (V4L2_FIELD_ANY == field) || (V4L2_FIELD_INTERLACED == field))
42 
43 /* Exp ratio numerator and denominator constants */
44 #define VPBE_DISPLAY_H_EXP_RATIO_N 9
45 #define VPBE_DISPLAY_H_EXP_RATIO_D 8
46 #define VPBE_DISPLAY_V_EXP_RATIO_N 6
47 #define VPBE_DISPLAY_V_EXP_RATIO_D 5
48 
49 /* Zoom multiplication factor */
50 #define VPBE_DISPLAY_ZOOM_4X 4
51 #define VPBE_DISPLAY_ZOOM_2X 2
52 
53 /* Structures */
55  int enable;
56  /* Layer ID used by Display Manager */
57  enum osd_layer id;
63 };
64 
65 /* vpbe display object structure */
66 struct vpbe_layer {
67  /* number of buffers in fbuffers */
68  unsigned int numbuffers;
69  /* Pointer to the vpbe_display */
71  /* Pointer pointing to current v4l2_buffer */
73  /* Pointer pointing to next v4l2_buffer */
75  /* videobuf specific parameters
76  * Buffer queue used in video-buf
77  */
79  /* Queue of filled frames */
81  /* Used in video-buf */
83  /* V4l2 specific parameters */
84  /* Identifies video device for this layer */
86  /* This field keeps track of type of buffer exchange mechanism user
87  * has selected
88  */
90  /* Used to keep track of state of the priority */
92  /* Used to store pixel format */
95  /* Video layer configuration params */
97  /* vpbe specific parameters
98  * enable window for display
99  */
100  unsigned char window_enable;
101  /* number of open instances of the layer */
102  unsigned int usrs;
103  /* number of users performing IO */
104  unsigned int io_usrs;
105  /* Indicates id of the field which is being displayed */
106  unsigned int field_id;
107  /* Indicates whether streaming started */
108  unsigned char started;
109  /* Identifies device object */
111  /* facilitation of ioctl ops lock by v4l2*/
112  struct mutex opslock;
114 };
115 
116 /* vpbe device structure */
117 struct vpbe_display {
118  /* layer specific parameters */
119  /* lock for isr updates to buf layers*/
121  /* C-Plane offset from start of y-plane */
122  unsigned int cbcr_ofst;
126 };
127 
128 /* File handle structure */
129 struct vpbe_fh {
130  /* vpbe device structure */
132  /* pointer to layer object for opened device */
133  struct vpbe_layer *layer;
134  /* Indicates whether this file handle is doing IO */
135  unsigned char io_allowed;
136  /* Used to keep track priority of this instance */
138 };
139 
141  unsigned char min_numbuffers;
145 };
146 
147 #endif /* VPBE_DISPLAY_H */