~ubuntu-branches/ubuntu/trusty/xserver-xorg-video-geode-lts-utopic/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gfx/tv_fs450.h

  • Committer: Package Import Robot
  • Author(s): Maarten Lankhorst
  • Date: 2015-01-06 10:39:17 UTC
  • Revision ID: package-import@ubuntu.com-20150106103917-bumwel1243pseqs6
Tags: upstream-2.11.16
ImportĀ upstreamĀ versionĀ 2.11.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2005 Advanced Micro Devices, Inc.
 
2
 *
 
3
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 
4
 * of this software and associated documentation files (the "Software"), to
 
5
 * deal in the Software without restriction, including without limitation the
 
6
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 
7
 * sell copies of the Software, and to permit persons to whom the Software is
 
8
 * furnished to do so, subject to the following conditions:
 
9
 *
 
10
 * The above copyright notice and this permission notice shall be included in
 
11
 * all copies or substantial portions of the Software.
 
12
 *
 
13
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
14
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
15
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
16
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
17
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
18
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 
19
 * IN THE SOFTWARE.
 
20
 *
 
21
 * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
 
22
 * contributors may be used to endorse or promote products derived from this
 
23
 * software without specific prior written permission.
 
24
 * */
 
25
 
 
26
/* 
 
27
 * This file defines the common FS450 API.
 
28
 * */
 
29
 
 
30
#ifndef __FS450_H__
 
31
#define __FS450_H__
 
32
 
 
33
#ifdef __cplusplus
 
34
extern "C" {
 
35
#endif
 
36
 
 
37
/*==========================================================================*/
 
38
/*      Init and cleanup functions*/
 
39
 
 
40
    int FS450_init(void);
 
41
    void FS450_cleanup(void);
 
42
    /* call FS450_init at startup to probe for and initialize FS450. */
 
43
    /* returns 0 if successful. */
 
44
 
 
45
/*==========================================================================*/
 
46
/*      TV output on or off*/
 
47
 
 
48
    int FS450_get_tv_enable(unsigned int *p_on);
 
49
    int FS450_set_tv_enable(unsigned int on);
 
50
    /* on is 1 for TV on, 0 for off */
 
51
 
 
52
/*==========================================================================*/
 
53
/*      TV standard*/
 
54
 
 
55
    int FS450_get_tv_standard(unsigned long *p_standard);
 
56
    int FS450_get_available_tv_standards(unsigned long *p_standards);
 
57
    int FS450_set_tv_standard(unsigned long standard);
 
58
    /* standard is one of the FS450_TV_STANDARD constants */
 
59
    /* standards is a bitmask of zero or more FS450_TV_STANDARD constants */
 
60
 
 
61
/* FS450 TV Standard flags*/
 
62
#define FS450_TV_STANDARD_NTSC_M 0x0001
 
63
#define FS450_TV_STANDARD_NTSC_M_J 0x0002
 
64
#define FS450_TV_STANDARD_PAL_B 0x0004
 
65
#define FS450_TV_STANDARD_PAL_D 0x0008
 
66
#define FS450_TV_STANDARD_PAL_H 0x0010
 
67
#define FS450_TV_STANDARD_PAL_I 0x0020
 
68
#define FS450_TV_STANDARD_PAL_M 0x0040
 
69
#define FS450_TV_STANDARD_PAL_N 0x0080
 
70
#define FS450_TV_STANDARD_PAL_G 0x0100
 
71
 
 
72
/*==========================================================================*/
 
73
/*      VGA mode assumed by FS450*/
 
74
 
 
75
    int FS450_get_vga_mode(unsigned long *p_vga_mode);
 
76
    int FS450_get_available_vga_modes(unsigned long *p_vga_modes);
 
77
    int FS450_set_vga_mode(unsigned long vga_mode);
 
78
    /* vga_mode is one of the FS450_VGA_MODE constants */
 
79
    /* vga_modes is a bitmask of zero or more FS450_VGA_MODE constants */
 
80
 
 
81
/* FS450 VGA Mode flags*/
 
82
#define FS450_VGA_MODE_UNKNOWN 0
 
83
#define FS450_VGA_MODE_640X480 0x0001
 
84
#define FS450_VGA_MODE_720X487 0x0002
 
85
#define FS450_VGA_MODE_720X576 0x0004
 
86
#define FS450_VGA_MODE_800X600 0x0008
 
87
#define FS450_VGA_MODE_1024X768 0x0010
 
88
 
 
89
/*==========================================================================*/
 
90
/*      TVout mode*/
 
91
 
 
92
    int FS450_get_tvout_mode(unsigned long *p_tvout_mode);
 
93
    int FS450_set_tvout_mode(unsigned long tvout_mode);
 
94
    /* tvout_mode is a bitmask of FS450_TVOUT_MODE constants */
 
95
 
 
96
/* FS450 TVout mode flags*/
 
97
#define FS450_TVOUT_MODE_CVBS 0x0001
 
98
#define FS450_TVOUT_MODE_YC 0x0002
 
99
#define FS450_TVOUT_MODE_RGB 0x0004
 
100
#define FS450_TVOUT_MODE_CVBS_YC (FS450_TVOUT_MODE_CVBS | FS450_TVOUT_MODE_YC)
 
101
 
 
102
/*==========================================================================*/
 
103
/*      Flicker control*/
 
104
 
 
105
    int FS450_get_sharpness(int *p_sharpness);
 
106
    int FS450_set_sharpness(int sharpness);
 
107
    /* sharpness is a percentage in tenths of a percent, 0 to 1000 */
 
108
 
 
109
    int FS450_get_flicker_filter(int *p_flicker);
 
110
    int FS450_set_flicker_filter(int flicker);
 
111
    /* flicker_filter is a percentage in tenths of a percent, 0 to 1000 */
 
112
 
 
113
/*==========================================================================*/
 
114
/*      Size and Position*/
 
115
 
 
116
    int FS450_get_overscan(int *p_x, int *p_y);
 
117
    int FS450_set_overscan(int x, int y);
 
118
    int FS450_get_position(int *p_x, int *p_y);
 
119
    int FS450_set_position(int x, int y);
 
120
    /* x and y are horizontal and vertical adjustments, -1000 to +1000 */
 
121
 
 
122
/*==========================================================================*/
 
123
/*      Visual adjustments*/
 
124
 
 
125
    int FS450_get_color(int *p_color);
 
126
    int FS450_set_color(int color);
 
127
    /* color is a percentage, 0 to 100 */
 
128
 
 
129
    int FS450_get_brightness(int *p_brightness);
 
130
    int FS450_set_brightness(int brightness);
 
131
    /* brightness is a percentage, 0 to 100 */
 
132
 
 
133
    int FS450_get_contrast(int *p_contrast);
 
134
    int FS450_set_contrast(int constrast);
 
135
    /* contrast is a percentage, 0 to 100 */
 
136
 
 
137
/*==========================================================================*/
 
138
/*      Luma and Chroma filter*/
 
139
 
 
140
    int FS450_get_yc_filter(unsigned int *p_yc_filter);
 
141
    int FS450_set_yc_filter(unsigned int yc_filter);
 
142
    /* yc_filter is a bitmask of FS450_LUMA_FILTER and/or FS450_CHROMA_FILTER */
 
143
 
 
144
/* FS450 Luma and Chroma Filters*/
 
145
#define FS450_LUMA_FILTER 0x0001
 
146
#define FS450_CHROMA_FILTER 0x0002
 
147
 
 
148
/*==========================================================================*/
 
149
/*      Macrovision*/
 
150
 
 
151
    int FS450_get_aps_trigger_bits(unsigned int *p_trigger_bits);
 
152
    int FS450_set_aps_trigger_bits(unsigned int trigger_bits);
 
153
    /* trigger_bits is one of the FS450_APS_TRIGGER constants */
 
154
 
 
155
/* APS Trigger Bits*/
 
156
#define FS450_APS_TRIGGER_OFF                   0
 
157
#define FS450_APS_TRIGGER_AGC_ONLY              1
 
158
#define FS450_APS_TRIGGER_AGC_2_LINE    2
 
159
#define FS450_APS_TRIGGER_AGC_4_LINE    3
 
160
 
 
161
/*==========================================================================*/
 
162
/*      direct access to Houston and platform registers (debug builds only)
 
163
 *      The two functions FS450_ReadRegister and FS450_WriteRegister allow access
 
164
 *      to device registers.  These functions are intended for debugging purposes
 
165
 *      only and should not be included in a shipping product.
 
166
 *      */
 
167
 
 
168
#ifdef FS450_DIRECTREG
 
169
 
 
170
#define SOURCE_HOUSTON 0
 
171
#define SOURCE_GCC 1
 
172
 
 
173
    typedef struct _S_REG_INFO {
 
174
        int source;
 
175
        unsigned int size;
 
176
        unsigned long offset;
 
177
        unsigned long value;
 
178
    } S_REG_INFO;
 
179
 
 
180
    int FS450_ReadRegister(S_REG_INFO * p_reg);
 
181
    int FS450_WriteRegister(S_REG_INFO * p_reg);
 
182
 
 
183
#endif
 
184
 
 
185
/*==========================================================================*/
 
186
/* Error Codes*/
 
187
 
 
188
#define ERR_INVALID_PARAMETER                   0x1000
 
189
#define ERR_NOT_SUPPORTED                               0x1001
 
190
#define ERR_CANNOT_CHANGE_WHILE_TV_ON   0x1002
 
191
 
 
192
#define ERR_DRIVER_NOT_FOUND                    0x1100
 
193
#define ERR_DRIVER_ERROR                                0x1101
 
194
#define ERR_DEVICE_NOT_FOUND                    0x1120
 
195
 
 
196
#define ERR_I2C_MISSING_DEVICE                  0x1200
 
197
#define ERR_I2C_WRITE_FAILED                    0x1201
 
198
#define ERR_I2C_READ_FAILED                             0x1202
 
199
 
 
200
#ifdef __cplusplus
 
201
}
 
202
#endif
 
203
#endif