aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/davinci/vpif_display.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/davinci/vpif_display.h')
-rw-r--r--drivers/media/video/davinci/vpif_display.h181
1 files changed, 0 insertions, 181 deletions
diff --git a/drivers/media/video/davinci/vpif_display.h b/drivers/media/video/davinci/vpif_display.h
deleted file mode 100644
index 8967ffb44058..000000000000
--- a/drivers/media/video/davinci/vpif_display.h
+++ /dev/null
@@ -1,181 +0,0 @@
1/*
2 * VPIF display header file
3 *
4 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed .as is. WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef DAVINCIHD_DISPLAY_H
17#define DAVINCIHD_DISPLAY_H
18
19/* Header files */
20#include <linux/videodev2.h>
21#include <media/v4l2-common.h>
22#include <media/v4l2-device.h>
23#include <media/videobuf-core.h>
24#include <media/videobuf2-dma-contig.h>
25#include <media/davinci/vpif_types.h>
26
27#include "vpif.h"
28
29/* Macros */
30#define VPIF_DISPLAY_VERSION "0.0.2"
31
32#define VPIF_VALID_FIELD(field) \
33 (((V4L2_FIELD_ANY == field) || (V4L2_FIELD_NONE == field)) || \
34 (((V4L2_FIELD_INTERLACED == field) || (V4L2_FIELD_SEQ_TB == field)) || \
35 (V4L2_FIELD_SEQ_BT == field)))
36
37#define VPIF_DISPLAY_MAX_DEVICES (2)
38#define VPIF_SLICED_BUF_SIZE (256)
39#define VPIF_SLICED_MAX_SERVICES (3)
40#define VPIF_VIDEO_INDEX (0)
41#define VPIF_VBI_INDEX (1)
42#define VPIF_HBI_INDEX (2)
43
44/* Setting it to 1 as HBI/VBI support yet to be added , else 3*/
45#define VPIF_NUMOBJECTS (1)
46
47/* Macros */
48#define ISALIGNED(a) (0 == ((a) & 7))
49
50/* enumerated data types */
51/* Enumerated data type to give id to each device per channel */
52enum vpif_channel_id {
53 VPIF_CHANNEL2_VIDEO = 0, /* Channel2 Video */
54 VPIF_CHANNEL3_VIDEO, /* Channel3 Video */
55};
56
57/* structures */
58
59struct video_obj {
60 enum v4l2_field buf_field;
61 u32 latest_only; /* indicate whether to return
62 * most recent displayed frame only */
63 v4l2_std_id stdid; /* Currently selected or default
64 * standard */
65 u32 dv_preset;
66 struct v4l2_bt_timings bt_timings;
67 u32 output_id; /* Current output id */
68};
69
70struct vbi_obj {
71 int num_services;
72 struct vpif_vbi_params vbiparams; /* vpif parameters for the raw
73 * vbi data */
74};
75
76struct vpif_disp_buffer {
77 struct vb2_buffer vb;
78 struct list_head list;
79};
80
81struct common_obj {
82 /* Buffer specific parameters */
83 u8 *fbuffers[VIDEO_MAX_FRAME]; /* List of buffer pointers for
84 * storing frames */
85 u32 numbuffers; /* number of buffers */
86 struct vpif_disp_buffer *cur_frm; /* Pointer pointing to current
87 * vb2_buffer */
88 struct vpif_disp_buffer *next_frm; /* Pointer pointing to next
89 * vb2_buffer */
90 enum v4l2_memory memory; /* This field keeps track of
91 * type of buffer exchange
92 * method user has selected */
93 struct v4l2_format fmt; /* Used to store the format */
94 struct vb2_queue buffer_queue; /* Buffer queue used in
95 * video-buf */
96 /* allocator-specific contexts for each plane */
97 struct vb2_alloc_ctx *alloc_ctx;
98
99 struct list_head dma_queue; /* Queue of filled frames */
100 spinlock_t irqlock; /* Used in video-buf */
101
102 /* channel specific parameters */
103 struct mutex lock; /* lock used to access this
104 * structure */
105 u32 io_usrs; /* number of users performing
106 * IO */
107 u8 started; /* Indicates whether streaming
108 * started */
109 u32 ytop_off; /* offset of Y top from the
110 * starting of the buffer */
111 u32 ybtm_off; /* offset of Y bottom from the
112 * starting of the buffer */
113 u32 ctop_off; /* offset of C top from the
114 * starting of the buffer */
115 u32 cbtm_off; /* offset of C bottom from the
116 * starting of the buffer */
117 /* Function pointer to set the addresses */
118 void (*set_addr) (unsigned long, unsigned long,
119 unsigned long, unsigned long);
120 u32 height;
121 u32 width;
122};
123
124struct channel_obj {
125 /* V4l2 specific parameters */
126 struct video_device *video_dev; /* Identifies video device for
127 * this channel */
128 struct v4l2_prio_state prio; /* Used to keep track of state of
129 * the priority */
130 atomic_t usrs; /* number of open instances of
131 * the channel */
132 u32 field_id; /* Indicates id of the field
133 * which is being displayed */
134 u8 initialized; /* flag to indicate whether
135 * encoder is initialized */
136
137 enum vpif_channel_id channel_id;/* Identifies channel */
138 struct vpif_params vpifparams;
139 struct common_obj common[VPIF_NUMOBJECTS];
140 struct video_obj video;
141 struct vbi_obj vbi;
142};
143
144/* File handle structure */
145struct vpif_fh {
146 struct channel_obj *channel; /* pointer to channel object for
147 * opened device */
148 u8 io_allowed[VPIF_NUMOBJECTS]; /* Indicates whether this file handle
149 * is doing IO */
150 enum v4l2_priority prio; /* Used to keep track priority of
151 * this instance */
152 u8 initialized; /* Used to keep track of whether this
153 * file handle has initialized
154 * channel or not */
155};
156
157/* vpif device structure */
158struct vpif_device {
159 struct v4l2_device v4l2_dev;
160 struct channel_obj *dev[VPIF_DISPLAY_NUM_CHANNELS];
161 struct v4l2_subdev **sd;
162
163};
164
165struct vpif_config_params {
166 u32 min_bufsize[VPIF_DISPLAY_NUM_CHANNELS];
167 u32 channel_bufsize[VPIF_DISPLAY_NUM_CHANNELS];
168 u8 numbuffers[VPIF_DISPLAY_NUM_CHANNELS];
169 u32 video_limit[VPIF_DISPLAY_NUM_CHANNELS];
170 u8 min_numbuffers;
171};
172
173/* Struct which keeps track of the line numbers for the sliced vbi service */
174struct vpif_service_line {
175 u16 service_id;
176 u16 service_line[2];
177 u16 enc_service_id;
178 u8 bytestowrite;
179};
180
181#endif /* DAVINCIHD_DISPLAY_H */