Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
crystalhd_fw_if.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) 2005-2009, Broadcom Corporation.
3  *
4  * Name: crystalhd_fw_if . h
5  *
6  * Description:
7  * BCM70012 Firmware interface definitions.
8  *
9  * HISTORY:
10  *
11  **********************************************************************
12  * This file is part of the crystalhd device driver.
13  *
14  * This driver is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, version 2 of the License.
17  *
18  * This driver is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this driver. If not, see <http://www.gnu.org/licenses/>.
25  **********************************************************************/
26 
27 #ifndef _CRYSTALHD_FW_IF_H_
28 #define _CRYSTALHD_FW_IF_H_
29 
30 /* TBD: Pull in only required defs into this file.. */
31 
32 /* User Data Header */
33 struct user_data {
34  struct user_data *next;
37 };
38 
39 /*------------------------------------------------------*
40  * MPEG Extension to the PPB *
41  *------------------------------------------------------*/
42 struct ppb_mpeg {
45 
46  /* Always valid, defaults to picture size if no
47  sequence display extension in the stream. */
50 
51  /* MPEG_VALID_PANSCAN
52  Offsets are a copy values from the MPEG stream. */
56 
57  /* MPEG_VALID_USERDATA
58  User data is in the form of a linked list. */
61 
62 };
63 
64 
65 /*------------------------------------------------------*
66  * VC1 Extension to the PPB *
67  *------------------------------------------------------*/
68 struct ppb_vc1 {
71 
72  /* Always valid, defaults to picture size if no
73  sequence display extension in the stream. */
76 
77  /* VC1 pan scan windows */
83 
84  /* VC1_VALID_USERDATA
85  User data is in the form of a linked list. */
88 
89 };
90 
91 /*------------------------------------------------------*
92  * H.264 Extension to the PPB *
93  *------------------------------------------------------*/
94 
101 /* maximum number of model-values as for Thomson spec(standard says 5) */
102 #define MAX_FGT_MODEL_VALUE (3)
103 
104 /* maximum number of intervals(as many as 256 intervals?) */
105 #define MAX_FGT_VALUE_INTERVAL (256)
106 
107 struct fgt_sei {
108  struct fgt_sei *next;
112 
113  unsigned char cancel_flag; /* Cancel flag: 1 no film grain. */
114  unsigned char model_id; /* Model id. */
115 
116  /* +unused SE based on Thomson spec */
117  unsigned char color_desc_flag; /* Separate color descrition flag. */
118  unsigned char bit_depth_luma; /* Bit depth luma minus 8. */
119  unsigned char bit_depth_chroma; /* Bit depth chroma minus 8. */
120  unsigned char full_range_flag; /* Full range flag. */
121  unsigned char color_primaries; /* Color primaries. */
122  unsigned char transfer_charact; /* Transfer characteristics. */
123  unsigned char matrix_coeff; /*< Matrix coefficients. */
124  /* -unused SE based on Thomson spec */
125 
126  unsigned char blending_mode_id; /* Blending mode. */
127  unsigned char log2_scale_factor; /* Log2 scale factor (2-7). */
128  unsigned char comp_flag[3]; /* Components [0,2] parameters present flag. */
129  unsigned char num_intervals_minus1[3]; /* Number of intensity level intervals. */
130  unsigned char num_model_values[3]; /* Number of model values. */
131  uint16_t repetition_period; /* Repetition period (0-16384) */
132 
133 };
134 
135 struct ppb_h264 {
136  /* 'valid' specifies which fields (or sets of
137  * fields) below are valid. If the corresponding
138  * bit in 'valid' is NOT set then that field(s)
139  * is (are) not initialized. */
141 
142  int32_t poc_top; /* POC for Top Field/Frame */
143  int32_t poc_bottom; /* POC for Bottom Field */
145 
146  /* H264_VALID_PANSCAN */
152 
153  /* H264_VALID_CT_TYPE */
156 
157  /* H264_VALID_SPS_CROP */
162 
163  /* H264_VALID_VUI */
166 
167  /* H264_VALID_USER */
170 
171  /* H264 VALID FGT */
172  struct fgt_sei *pfgt;
173 
174 };
175 
176 struct ppb {
177  /* Common fields. */
178  uint32_t picture_number; /* Ordinal display number */
179  uint32_t video_buffer; /* Video (picbuf) number */
180  uint32_t video_address; /* Address of picbuf Y */
181  uint32_t video_address_uv; /* Address of picbuf UV */
182  uint32_t video_stripe; /* Picbuf stripe */
183  uint32_t video_width; /* Picbuf width */
184  uint32_t video_height; /* Picbuf height */
185 
186  uint32_t channel_id; /* Decoder channel ID */
187  uint32_t status; /* reserved */
188  uint32_t width; /* pixels */
189  uint32_t height; /* pixels */
190  uint32_t chroma_format; /* see above */
191  uint32_t pulldown; /* see above */
192  uint32_t flags; /* see above */
193  uint32_t pts; /* 32 LSBs of PTS */
194  uint32_t protocol; /* protocolXXX (above) */
195 
196  uint32_t frame_rate; /* see above */
197  uint32_t matrix_coeff; /* see above */
198  uint32_t aspect_ratio; /* see above */
199  uint32_t colour_primaries; /* see above */
200  uint32_t transfer_char; /* see above */
201  uint32_t pcr_offset; /* 45kHz if PCR type; else 27MHz */
202  uint32_t n_drop; /* Number of pictures to be dropped */
203 
205  /* upper 16-bits is Y and lower 16-bits is X */
206 
207  uint32_t picture_tag; /* Indexing tag from BUD packets */
211 
212  /* Protocol-specific extensions. */
213  union {
214  struct ppb_h264 h264;
215  struct ppb_mpeg mpeg;
216  struct ppb_vc1 vc1;
217  } other;
218 
219 };
220 
221 struct c011_pib {
230  struct ppb ppb;
231 
232 };
233 
247 
248 };
249 
250 #define eCMD_C011_CMD_BASE (0x73763000)
251 
252 /* host commands */
254  eCMD_TS_GET_NEXT_PIC = 0x7376F100, /* debug get next picture */
255  eCMD_TS_GET_LAST_PIC = 0x7376F102, /* debug get last pic status */
256  eCMD_TS_READ_WRITE_MEM = 0x7376F104, /* debug read write memory */
257 
258  /* New API commands */
259  /* General commands */
266 
267  /* Decoding commands */
336  = eCMD_C011_CMD_BASE + 0x150,
337 
338  /* Decoder RevD commands */
339  eCMD_C011_DEC_CHAN_SET_CSC = eCMD_C011_CMD_BASE + 0x180, /* color space conversion */
342  /* Note: 0x183 not implemented yet in Rev D main */
344 
345  /* Decoder 7412 commands (7412-only) */
349 
351 
352  /* Encoding commands */
358 
360 
361 };
362 
363 #endif