~gma500/emgd/trunk

« back to all changes in this revision

Viewing changes to emgd/emgd-dkms-1.5.15.2856/emgd/video/overlay/plb/ovl_regs_plb.h

  • Committer: José Bernardo Bandos
  • Date: 2010-08-28 15:24:51 UTC
  • Revision ID: jbs@jbs-laptop-20100828152451-tnizfct0fpxvq1kv
Intel emgd drivers

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- pse-c -*-
 
2
 *-----------------------------------------------------------------------------
 
3
 * Filename: ovl_regs_plb.h
 
4
 * $Revision: 1.2 $
 
5
 *-----------------------------------------------------------------------------
 
6
 * Copyright © 2002-2010, Intel Corporation.
 
7
 *  
 
8
 * This program is free software; you can redistribute it and/or modify it
 
9
 * under the terms and conditions of the GNU General Public License,
 
10
 * version 2, as published by the Free Software Foundation.
 
11
 * 
 
12
 * This program is distributed in the hope it will be useful, but WITHOUT
 
13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
14
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
15
 * more details.
 
16
 * 
 
17
 * You should have received a copy of the GNU General Public License along with
 
18
 * this program; if not, write to the Free Software Foundation, Inc., 
 
19
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 
20
 *-----------------------------------------------------------------------------
 
21
 * Description:
 
22
 *  This is the internal header file for overlay. It should be not be 
 
23
 *  by any other module besides the overlay module itself. It contains the
 
24
 *  neccessary hardware virtualized register dependant information including
 
25
 *  values, structures and addresses specifically for the Napa core
 
26
 *-----------------------------------------------------------------------------
 
27
 */
 
28
 
 
29
#ifndef OVL_REGS_PLB_H_
 
30
#define OVL_REGS_PLB_H_
 
31
 
 
32
/* Overlay Update Register Image Structure.*/
 
33
typedef struct _ovl_reg_image_plb{
 
34
 
 
35
        volatile unsigned int                   buffer0_yrgb_ptr;
 
36
        volatile unsigned int                   buffer1_yrgb_ptr;
 
37
        volatile unsigned int                   buffer0_u_ptr;
 
38
        volatile unsigned int                   buffer0_v_ptr;
 
39
        volatile unsigned int                   buffer1_u_ptr;
 
40
        volatile unsigned int                   buffer1_v_ptr;
 
41
        volatile unsigned short                 yrgb_stride;
 
42
        volatile unsigned short                 uv_stride;
 
43
        volatile unsigned short                 yrgb_vert_phase_field0;
 
44
        volatile unsigned short                 yrgb_vert_phase_field1;
 
45
        volatile unsigned short                 uv_vert_phase_field0;
 
46
        volatile unsigned short                 uv_vert_phase_field1;
 
47
        volatile unsigned short                 yrgb_hphase;
 
48
        volatile unsigned short                 uv_hphase;
 
49
        volatile unsigned int                   init_phase_shift;
 
50
        volatile unsigned short                 dest_pos_x_left;
 
51
        volatile unsigned short                 dest_pos_y_top;
 
52
        volatile unsigned short                 dest_width_x;
 
53
        volatile unsigned short                 dest_height_y;
 
54
        volatile unsigned short                 source_yrgb_width;
 
55
        volatile unsigned short                 source_uv_width;
 
56
        volatile unsigned short                 source_yrgb_width_swords;
 
57
        volatile unsigned short                 source_uv_width_swords;
 
58
        volatile unsigned short                 source_yrgb_height;
 
59
        volatile unsigned short                 source_uv_height;
 
60
        volatile unsigned int                   yrgb_scale;
 
61
        volatile unsigned int                   uv_scale;
 
62
        volatile unsigned int                   col_ctl_brt_con;
 
63
        volatile unsigned int                   col_ctl_sat_hue;
 
64
        volatile unsigned int                   dest_ckey_val;
 
65
        volatile unsigned int                   dest_ckey_mask;
 
66
        volatile unsigned int                   source_ckey_high;
 
67
        volatile unsigned int                   source_ckey_low;
 
68
        volatile unsigned int                   source_ckey_mask;
 
69
        volatile unsigned int                   config;
 
70
        volatile unsigned int                   command;
 
71
        volatile unsigned int                   reserved1;
 
72
        volatile unsigned short                 alpha_pos_x_left;
 
73
        volatile unsigned short                 alpha_pos_y_top;
 
74
        volatile unsigned short                 alpha_width_x;
 
75
        volatile unsigned short                 alpha_height_y;
 
76
        volatile unsigned int                   reserved2;
 
77
        volatile unsigned int                   reserved3;
 
78
        volatile unsigned int                   reserved4;
 
79
        volatile unsigned int                   reserved5;
 
80
        volatile unsigned int                   reserved6;
 
81
        volatile unsigned int                   reserved7;
 
82
        volatile unsigned int                   reserved8;
 
83
        volatile unsigned int                   reserved9;
 
84
        volatile unsigned int                   reserved10;
 
85
        volatile unsigned int                   reserved11;
 
86
        volatile unsigned int                   reserved11a; /*ovl_fast_horz_downscale;*/
 
87
        volatile unsigned int                   vert_downscale;
 
88
        volatile unsigned int                   reserved12[86];
 
89
        volatile unsigned short                 y_vert_coeff_single[52]; /*offset 0x200 --> 3*17/2 + 1*/
 
90
        volatile unsigned int                   reserved13[38];
 
91
        volatile unsigned short                 y_horz_coeff_single[86]; /*offset 0x300 --> 5*17/2 + 1*/
 
92
        volatile unsigned int                   reserved14[85];
 
93
        volatile unsigned short                 uv_vert_coeff_single[52]; /*offset 0x500 --> 3*17/2 + 1*/
 
94
        volatile unsigned int                   reserved15[38];
 
95
        volatile unsigned short                 uv_horz_coeff_single[52]; /*offset 0x600 --> 3*17/2 + 1*/
 
96
        volatile unsigned int                   reserved16[38];
 
97
 
 
98
} ovl_reg_image_plb_t;
 
99
 
 
100
/* Color Correction */
 
101
#define OVL_YUV_COLOR_DEF_CONT_BRGHT    0x10c00fb
 
102
#define OVL_YUV_COLOR_DEF_SATN_HUE      0x0000091
 
103
#define OVL_RGB_COLOR_DEF_CONT_BRGHT    0x1000000
 
104
#define OVL_RGB_COLOR_DEF_SATN_HUE      0x0000080
 
105
 
 
106
/* Overlay Config */
 
107
#define OVL_CONFIG_NO_LINE_BUFF     0xffffffff
 
108
#define OVL_CONFIG_TWO_LINE_BUFF    0x00000000
 
109
#define OVL_CONFIG_THREE_LINE_BUFF  0x00000001
 
110
#define OVL_CONFIG_LINE_BUFF_MASK   0x00000001
 
111
 
 
112
/* Overlay Command Definitions */
 
113
/* 422 Swap */
 
114
#define OVL_CMD_UV_SWAP                         0x00004000
 
115
#define OVL_CMD_Y_SWAP                          0x00008000
 
116
#define OVL_CMD_YUV_SWAP                        0x0000C000
 
117
 
 
118
/* Source Format */
 
119
#define OVL_CMD_RGB_8888                        0x00000400
 
120
#define OVL_CMD_RGB_565                         0x00000C00
 
121
#define OVL_CMD_RGB_555                         0x00000800
 
122
#define OVL_CMD_YUV_NV12Alt                     0x00001C00 /*planar NV12, Alternate?*/
 
123
#define OVL_CMD_YUV_NV12                        0x00002C00 /*planar NV12*/
 
124
#define OVL_CMD_YUV_422                         0x00002000 /*packed YUV422*/
 
125
#define OVL_CMD_YUV_411                         0x00002400 /*packed YUV411*/
 
126
#define OVL_CMD_YUV_420P                        0x00003000 /*planar YUV420*/
 
127
#define OVL_CMD_YUV_422P                        0x00003400 /*planar YUV422*/
 
128
#define OVL_CMD_YUV_410P                        0x00003800 /*planar YUV410*/
 
129
#define OVL_CMD_YUV_444P                        0x00003C00 /*planar YUV444*/
 
130
#define OVL_CMD_SRC_FMT_MASK            0x00003C00 /*mask for above*/
 
131
 
 
132
/* Flip Type */
 
133
#define OVL_CMD_FRAME_MODE          0x00000000
 
134
#define OVL_CMD_FIELD_MODE                      0x00000020
 
135
 
 
136
/* Field Sync Flip Enable */
 
137
#define OVL_CMD_FIELD_SYNC_FLIP                 0x00000080
 
138
 
 
139
/* Buffer and Field */
 
140
#define OVL_CMD_ACT_BUF0                        0x00000000
 
141
#define OVL_CMD_ACT_BUF1                        0x00000004
 
142
#define OVL_CMD_ACT_FLD0                        0x00000000
 
143
#define OVL_CMD_ACT_FLD1                        0x00000002
 
144
 
 
145
/* Initial phase register */
 
146
#define Y_VPP_FLD0_PLUS1                        0x100000
 
147
#define Y_VPP_FLD0_PLUS2                        0x200000
 
148
#define Y_VPP_FLD0_MINUS1                       0xF00000
 
149
#define Y_VPP_FLD1_PLUS1                        0x010000
 
150
#define Y_VPP_FLD1_PLUS2                        0x020000
 
151
#define Y_VPP_FLD1_MINUS1                       0x0F0000
 
152
#define Y_HPP_PLUS1                                     0x001000
 
153
#define Y_HPP_PLUS2                                     0x002000
 
154
#define Y_HPP_MINUS1                            0x00F000
 
155
#define UV_VPP_FLD0_PLUS1                       0x000100
 
156
#define UV_VPP_FLD0_PLUS2                       0x000200
 
157
#define UV_VPP_FLD0_MINUS1                      0x000F00
 
158
#define UV_VPP_FLD1_PLUS1                       0x000010
 
159
#define UV_VPP_FLD1_PLUS2                       0x000020
 
160
#define UV_VPP_FLD1_MINUS1                      0x0000F0
 
161
#define UV_HPP_PLUS1                            0x000001
 
162
#define UV_HPP_PLUS2                            0x000002
 
163
#define UV_HPP_MINUS1                           0x00000F
 
164
 
 
165
#define OVL_REG_ADDR_GAMMA5                                             0x30010
 
166
#define OVL_REG_ADDR_GAMMA4                                             0x30014
 
167
#define OVL_REG_ADDR_GAMMA3                                             0x30018
 
168
#define OVL_REG_ADDR_GAMMA2                                             0x3001C
 
169
#define OVL_REG_ADDR_GAMMA1                                             0x30020
 
170
#define OVL_REG_ADDR_GAMMA0                                             0x30024
 
171
#define OVL_TOTAL_GAMMA_REG                                             6
 
172
 
 
173
/* following value are needed because hardware seems to display yuv slightly dimmer 
 
174
   than RGB when color data is calculated out to be equal */
 
175
#define MID_CONTRAST_YUV                                        0x43//4a
 
176
#define MID_SATURATION_YUV                                      0x91//92
 
177
#define MID_BRIGHTNESS_YUV                                      -5
 
178
 
 
179
#endif /* OVL_REGISTER_IMAGE_H_ */