gfx_rtns.h revision f29dbc25
1f29dbc25Smrg/* Copyright (c) 2005 Advanced Micro Devices, Inc.
2f29dbc25Smrg *
3f29dbc25Smrg * Permission is hereby granted, free of charge, to any person obtaining a copy
4f29dbc25Smrg * of this software and associated documentation files (the "Software"), to
5f29dbc25Smrg * deal in the Software without restriction, including without limitation the
6f29dbc25Smrg * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7f29dbc25Smrg * sell copies of the Software, and to permit persons to whom the Software is
8f29dbc25Smrg * furnished to do so, subject to the following conditions:
9f29dbc25Smrg *
10f29dbc25Smrg * The above copyright notice and this permission notice shall be included in
11f29dbc25Smrg * all copies or substantial portions of the Software.
12f29dbc25Smrg *
13f29dbc25Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14f29dbc25Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15f29dbc25Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16f29dbc25Smrg * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17f29dbc25Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18f29dbc25Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19f29dbc25Smrg * IN THE SOFTWARE.
20f29dbc25Smrg *
21f29dbc25Smrg * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
22f29dbc25Smrg * contributors may be used to endorse or promote products derived from this
23f29dbc25Smrg * software without specific prior written permission.
24f29dbc25Smrg * */
25f29dbc25Smrg
26f29dbc25Smrg/*
27f29dbc25Smrg * This header file defines the Durango routines and variables used
28f29dbc25Smrg * to access the memory mapped regions.
29f29dbc25Smrg * */
30f29dbc25Smrg
31f29dbc25Smrg#ifndef _gfx_rtns_h
32f29dbc25Smrg#define _gfx_rtns_h
33f29dbc25Smrg
34f29dbc25Smrg/* INCLUDE DURANGO DEFINITIONS */
35f29dbc25Smrg/* These definitions are placed in another file to allow their inclusion
36f29dbc25Smrg * in a user application.  Such applications generally work through driver
37f29dbc25Smrg * shell routines that simply pass their parameters to Durango routines.
38f29dbc25Smrg * An external file provides an easy way to provide the definitions for these
39f29dbc25Smrg * parameters without the applications gaining any Durango visisbility.
40f29dbc25Smrg * */
41f29dbc25Smrg
42f29dbc25Smrg#include "gfx_type.h"
43f29dbc25Smrg
44f29dbc25Smrg/* COMPILER OPTION FOR C++ PROGRAMS */
45f29dbc25Smrg
46f29dbc25Smrg#ifdef __cplusplus
47f29dbc25Smrgextern "C"
48f29dbc25Smrg{
49f29dbc25Smrg#endif
50f29dbc25Smrg
51f29dbc25Smrg/* DURANGO MEMORY POINTERS */
52f29dbc25Smrg
53f29dbc25Smrg    extern unsigned char *gfx_virt_regptr;
54f29dbc25Smrg    extern unsigned char *gfx_virt_fbptr;
55f29dbc25Smrg    extern unsigned char *gfx_virt_vidptr;
56f29dbc25Smrg    extern unsigned char *gfx_virt_vipptr;
57f29dbc25Smrg    extern unsigned char *gfx_virt_spptr;
58f29dbc25Smrg    extern unsigned char *gfx_virt_gpptr;
59f29dbc25Smrg
60f29dbc25Smrg    extern unsigned char *gfx_phys_regptr;
61f29dbc25Smrg    extern unsigned char *gfx_phys_fbptr;
62f29dbc25Smrg    extern unsigned char *gfx_phys_vidptr;
63f29dbc25Smrg    extern unsigned char *gfx_phys_vipptr;
64f29dbc25Smrg    extern unsigned char *gfx_phys_spptr;
65f29dbc25Smrg    extern unsigned char *gfx_phys_gpptr;
66f29dbc25Smrg
67f29dbc25Smrg/* DURANGO VARIBLES FOR RUNTIME SELECTION AND POSSIBLE VALUES */
68f29dbc25Smrg
69f29dbc25Smrg    extern int gfx_display_type;
70f29dbc25Smrg#define GFX_DISPLAY_TYPE_GU1		0x0001
71f29dbc25Smrg#define GFX_DISPLAY_TYPE_GU2		0x0002
72f29dbc25Smrg
73f29dbc25Smrg    extern int gfx_init_type;
74f29dbc25Smrg#define GFX_INIT_TYPE_GU1           0x0001
75f29dbc25Smrg#define GFX_INIT_TYPE_GU2           0x0002
76f29dbc25Smrg
77f29dbc25Smrg    extern int gfx_msr_type;
78f29dbc25Smrg#define GFX_MSR_TYPE_REDCLOUD       0x0001
79f29dbc25Smrg
80f29dbc25Smrg    extern int gfx_2daccel_type;
81f29dbc25Smrg#define GFX_2DACCEL_TYPE_GU1		0x0001
82f29dbc25Smrg#define GFX_2DACCEL_TYPE_GU2		0x0002
83f29dbc25Smrg
84f29dbc25Smrg    extern int gfx_video_type;
85f29dbc25Smrg#define GFX_VIDEO_TYPE_CS5530		0x0001
86f29dbc25Smrg#define GFX_VIDEO_TYPE_SC1200		0x0002
87f29dbc25Smrg#define GFX_VIDEO_TYPE_REDCLOUD     0x0004
88f29dbc25Smrg
89f29dbc25Smrg    extern int gfx_vip_type;
90f29dbc25Smrg#define GFX_VIP_TYPE_SC1200			0x0001
91f29dbc25Smrg
92f29dbc25Smrg    extern int gfx_decoder_type;
93f29dbc25Smrg#define GFX_DECODER_TYPE_SAA7114	0x0001
94f29dbc25Smrg
95f29dbc25Smrg    extern int gfx_tv_type;
96f29dbc25Smrg#define GFX_TV_TYPE_SC1200			0x0001
97f29dbc25Smrg#define GFX_TV_TYPE_FS451			0x0002
98f29dbc25Smrg
99f29dbc25Smrg    extern int gfx_i2c_type;
100f29dbc25Smrg#define GFX_I2C_TYPE_ACCESS			0x0001
101f29dbc25Smrg#define GFX_I2C_TYPE_GPIO			0x0002
102f29dbc25Smrg
103f29dbc25Smrg/* GLOBAL CPU INFORMATION */
104f29dbc25Smrg
105f29dbc25Smrg    extern unsigned long gfx_cpu_version;
106f29dbc25Smrg    extern unsigned long gfx_cpu_frequency;
107f29dbc25Smrg    extern unsigned long gfx_vid_version;
108f29dbc25Smrg    extern ChipType gfx_chip_revision;
109f29dbc25Smrg
110f29dbc25Smrg/* ROUTINES IN GFX_INIT.C */
111f29dbc25Smrg
112f29dbc25Smrg    unsigned long gfx_pci_config_read(unsigned long address);
113f29dbc25Smrg    void gfx_pci_config_write(unsigned long address, unsigned long data);
114f29dbc25Smrg    unsigned long gfx_get_core_freq(void);
115f29dbc25Smrg    unsigned long gfx_detect_cpu(void);
116f29dbc25Smrg    unsigned long gfx_detect_video(void);
117f29dbc25Smrg    unsigned long gfx_get_cpu_register_base(void);
118f29dbc25Smrg    unsigned long gfx_get_graphics_register_base(void);
119f29dbc25Smrg    unsigned long gfx_get_frame_buffer_base(void);
120f29dbc25Smrg    unsigned long gfx_get_frame_buffer_size(void);
121f29dbc25Smrg    unsigned long gfx_get_vid_register_base(void);
122f29dbc25Smrg    unsigned long gfx_get_vip_register_base(void);
123f29dbc25Smrg
124f29dbc25Smrg/* ROUTINES IN GFX_MSR.C */
125f29dbc25Smrg
126f29dbc25Smrg    int gfx_msr_init(void);
127f29dbc25Smrg    DEV_STATUS gfx_id_msr_device(MSR * pDev, unsigned long address);
128f29dbc25Smrg    DEV_STATUS gfx_get_msr_dev_address(unsigned int device,
129f29dbc25Smrg        unsigned long *address);
130f29dbc25Smrg    DEV_STATUS gfx_get_glink_id_at_address(unsigned int *device,
131f29dbc25Smrg        unsigned long address);
132f29dbc25Smrg    DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister,
133f29dbc25Smrg        Q_WORD * msrValue);
134f29dbc25Smrg    DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister,
135f29dbc25Smrg        Q_WORD * msrValue);
136f29dbc25Smrg
137f29dbc25Smrg/* ROUTINES IN GFX_DISP.C */
138f29dbc25Smrg
139f29dbc25Smrg    int gfx_set_display_bpp(unsigned short bpp);
140f29dbc25Smrg    int gfx_is_display_mode_supported(int xres, int yres, int bpp, int hz);
141f29dbc25Smrg    int gfx_set_display_mode(int xres, int yres, int bpp, int hz);
142f29dbc25Smrg    int gfx_set_display_timings(unsigned short bpp, unsigned short flags,
143f29dbc25Smrg        unsigned short hactive, unsigned short hblank_start,
144f29dbc25Smrg        unsigned short hsync_start, unsigned short hsync_end,
145f29dbc25Smrg        unsigned short hblank_end, unsigned short htotal,
146f29dbc25Smrg        unsigned short vactive, unsigned short vblank_start,
147f29dbc25Smrg        unsigned short vsync_start, unsigned short vsync_end,
148f29dbc25Smrg        unsigned short vblank_end, unsigned short vtotal,
149f29dbc25Smrg        unsigned long frequency);
150f29dbc25Smrg    int gfx_set_vtotal(unsigned short vtotal);
151f29dbc25Smrg    void gfx_set_display_pitch(unsigned short pitch);
152f29dbc25Smrg    void gfx_set_display_offset(unsigned long offset);
153f29dbc25Smrg    int gfx_set_display_palette_entry(unsigned long index,
154f29dbc25Smrg        unsigned long palette);
155f29dbc25Smrg    int gfx_set_display_palette(unsigned long *palette);
156f29dbc25Smrg    void gfx_video_shutdown(void);
157f29dbc25Smrg    void gfx_set_clock_frequency(unsigned long frequency);
158f29dbc25Smrg    int gfx_set_crt_enable(int enable);
159f29dbc25Smrg    void gfx_set_cursor_enable(int enable);
160f29dbc25Smrg    void gfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor);
161f29dbc25Smrg    void gfx_set_cursor_position(unsigned long memoffset,
162f29dbc25Smrg        unsigned short xpos, unsigned short ypos,
163f29dbc25Smrg        unsigned short xhotspot, unsigned short yhotspot);
164f29dbc25Smrg    void gfx_set_cursor_shape32(unsigned long memoffset,
165f29dbc25Smrg        unsigned long *andmask, unsigned long *xormask);
166f29dbc25Smrg    void gfx_set_cursor_shape64(unsigned long memoffset,
167f29dbc25Smrg        unsigned long *andmask, unsigned long *xormask);
168f29dbc25Smrg    void gfx_set_icon_enable(int enable);
169f29dbc25Smrg    void gfx_set_icon_colors(unsigned long color0, unsigned long color1,
170f29dbc25Smrg        unsigned long color2);
171f29dbc25Smrg    void gfx_set_icon_position(unsigned long memoffset, unsigned short xpos);
172f29dbc25Smrg    void gfx_set_icon_shape64(unsigned long memoffset, unsigned long *andmask,
173f29dbc25Smrg        unsigned long *xormask, unsigned int lines);
174f29dbc25Smrg
175f29dbc25Smrg    int gfx_set_compression_enable(int enable);
176f29dbc25Smrg    int gfx_set_compression_offset(unsigned long offset);
177f29dbc25Smrg    int gfx_set_compression_pitch(unsigned short pitch);
178f29dbc25Smrg    int gfx_set_compression_size(unsigned short size);
179f29dbc25Smrg    void gfx_set_display_priority_high(int enable);
180f29dbc25Smrg    int gfx_test_timing_active(void);
181f29dbc25Smrg    int gfx_test_vertical_active(void);
182f29dbc25Smrg    int gfx_wait_vertical_blank(void);
183f29dbc25Smrg    void gfx_delay_milliseconds(unsigned long milliseconds);
184f29dbc25Smrg    void gfx_delay_microseconds(unsigned long microseconds);
185f29dbc25Smrg    void gfx_enable_panning(int x, int y);
186f29dbc25Smrg    int gfx_is_panel_mode_supported(int panelResX, int panelResY,
187f29dbc25Smrg        unsigned short width, unsigned short height, unsigned short bpp);
188f29dbc25Smrg    int gfx_set_fixed_timings(int panelResX, int panelResY,
189f29dbc25Smrg        unsigned short width, unsigned short height, unsigned short bpp);
190f29dbc25Smrg    int gfx_set_panel_present(int panelResX, int panelResY,
191f29dbc25Smrg        unsigned short width, unsigned short height, unsigned short bpp);
192f29dbc25Smrg    void gfx_reset_timing_lock(void);
193f29dbc25Smrg
194f29dbc25Smrg/* "READ" ROUTINES IN GFX_DISP.C */
195f29dbc25Smrg
196f29dbc25Smrg    int gfx_get_display_details(unsigned int mode, int *xres, int *yres,
197f29dbc25Smrg        int *hz);
198f29dbc25Smrg    unsigned short gfx_get_display_pitch(void);
199f29dbc25Smrg    int gfx_get_vsa2_softvga_enable(void);
200f29dbc25Smrg    int gfx_get_sync_polarities(void);
201f29dbc25Smrg    unsigned long gfx_get_clock_frequency(void);
202f29dbc25Smrg    unsigned long gfx_get_max_supported_pixel_clock(void);
203f29dbc25Smrg    int gfx_mode_frequency_supported(int xres, int yres, int bpp,
204f29dbc25Smrg        unsigned long frequency);
205f29dbc25Smrg    int gfx_get_refreshrate_from_frequency(int xres, int yres, int bpp,
206f29dbc25Smrg        int *hz, unsigned long frequency);
207f29dbc25Smrg    int gfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz,
208f29dbc25Smrg        unsigned long frequency);
209f29dbc25Smrg    int gfx_get_frequency_from_refreshrate(int xres, int yres, int bpp,
210f29dbc25Smrg        int hz, int *frequency);
211f29dbc25Smrg    int gfx_get_display_mode_count(void);
212f29dbc25Smrg    int gfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz);
213f29dbc25Smrg    unsigned long gfx_get_frame_buffer_line_size(void);
214f29dbc25Smrg    unsigned short gfx_get_hactive(void);
215f29dbc25Smrg    unsigned short gfx_get_hblank_start(void);
216f29dbc25Smrg    unsigned short gfx_get_hsync_start(void);
217f29dbc25Smrg    unsigned short gfx_get_hsync_end(void);
218f29dbc25Smrg    unsigned short gfx_get_hblank_end(void);
219f29dbc25Smrg    unsigned short gfx_get_htotal(void);
220f29dbc25Smrg    unsigned short gfx_get_vactive(void);
221f29dbc25Smrg    unsigned short gfx_get_vline(void);
222f29dbc25Smrg    unsigned short gfx_get_vblank_start(void);
223f29dbc25Smrg    unsigned short gfx_get_vsync_start(void);
224f29dbc25Smrg    unsigned short gfx_get_vsync_end(void);
225f29dbc25Smrg    unsigned short gfx_get_vblank_end(void);
226f29dbc25Smrg    unsigned short gfx_get_vtotal(void);
227f29dbc25Smrg    unsigned short gfx_get_display_bpp(void);
228f29dbc25Smrg    unsigned long gfx_get_display_offset(void);
229f29dbc25Smrg    int gfx_get_display_palette_entry(unsigned long index,
230f29dbc25Smrg        unsigned long *palette);
231f29dbc25Smrg    void gfx_get_display_palette(unsigned long *palette);
232f29dbc25Smrg    unsigned long gfx_get_cursor_enable(void);
233f29dbc25Smrg    unsigned long gfx_get_cursor_offset(void);
234f29dbc25Smrg    unsigned long gfx_get_cursor_position(void);
235f29dbc25Smrg    unsigned long gfx_get_cursor_clip(void);
236f29dbc25Smrg    unsigned long gfx_get_cursor_color(int color);
237f29dbc25Smrg    unsigned long gfx_get_icon_enable(void);
238f29dbc25Smrg    unsigned long gfx_get_icon_offset(void);
239f29dbc25Smrg    unsigned long gfx_get_icon_position(void);
240f29dbc25Smrg    unsigned long gfx_get_icon_color(int color);
241f29dbc25Smrg    int gfx_get_compression_enable(void);
242f29dbc25Smrg    unsigned long gfx_get_compression_offset(void);
243f29dbc25Smrg    unsigned short gfx_get_compression_pitch(void);
244f29dbc25Smrg    unsigned short gfx_get_compression_size(void);
245f29dbc25Smrg    int gfx_get_display_priority_high(void);
246f29dbc25Smrg    int gfx_get_valid_bit(int line);
247f29dbc25Smrg
248f29dbc25Smrg/* ROUTINES IN GFX_RNDR.C */
249f29dbc25Smrg
250f29dbc25Smrg    void gfx_set_bpp(unsigned short bpp);
251f29dbc25Smrg    void gfx_set_solid_pattern(unsigned long color);
252f29dbc25Smrg    void gfx_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor,
253f29dbc25Smrg        unsigned long data0, unsigned long data1, unsigned char transparency);
254f29dbc25Smrg    void gfx_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor,
255f29dbc25Smrg        unsigned long data0, unsigned long data1, unsigned long data2,
256f29dbc25Smrg        unsigned long data3, unsigned char transparency);
257f29dbc25Smrg    void gfx_load_color_pattern_line(short y, unsigned long *pattern_8x8);
258f29dbc25Smrg    void gfx_set_solid_source(unsigned long color);
259f29dbc25Smrg    void gfx_set_mono_source(unsigned long bgcolor, unsigned long fgcolor,
260f29dbc25Smrg        unsigned short transparent);
261f29dbc25Smrg    void gfx_set_pattern_flags(unsigned short flags);
262f29dbc25Smrg    void gfx_set_raster_operation(unsigned char rop);
263f29dbc25Smrg    void gfx_pattern_fill(unsigned short x, unsigned short y,
264f29dbc25Smrg        unsigned short width, unsigned short height);
265f29dbc25Smrg    void gfx_color_pattern_fill(unsigned short x, unsigned short y,
266f29dbc25Smrg        unsigned short width, unsigned short height, unsigned long *pattern);
267f29dbc25Smrg    void gfx_screen_to_screen_blt(unsigned short srcx, unsigned short srcy,
268f29dbc25Smrg        unsigned short dstx, unsigned short dsty, unsigned short width,
269f29dbc25Smrg        unsigned short height);
270f29dbc25Smrg    void gfx_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy,
271f29dbc25Smrg        unsigned short dstx, unsigned short dsty, unsigned short width,
272f29dbc25Smrg        unsigned short height, unsigned long color);
273f29dbc25Smrg    void gfx_color_bitmap_to_screen_blt(unsigned short srcx,
274f29dbc25Smrg        unsigned short srcy, unsigned short dstx, unsigned short dsty,
275f29dbc25Smrg        unsigned short width, unsigned short height, unsigned char *data,
276f29dbc25Smrg        long pitch);
277f29dbc25Smrg    void gfx_color_bitmap_to_screen_xblt(unsigned short srcx,
278f29dbc25Smrg        unsigned short srcy, unsigned short dstx, unsigned short dsty,
279f29dbc25Smrg        unsigned short width, unsigned short height, unsigned char *data,
280f29dbc25Smrg        long pitch, unsigned long color);
281f29dbc25Smrg    void gfx_mono_bitmap_to_screen_blt(unsigned short srcx,
282f29dbc25Smrg        unsigned short srcy, unsigned short dstx, unsigned short dsty,
283f29dbc25Smrg        unsigned short width, unsigned short height, unsigned char *data,
284f29dbc25Smrg        short pitch);
285f29dbc25Smrg    void gfx_text_blt(unsigned short dstx, unsigned short dsty,
286f29dbc25Smrg        unsigned short width, unsigned short height, unsigned char *data);
287f29dbc25Smrg    void gfx_bresenham_line(unsigned short x, unsigned short y,
288f29dbc25Smrg        unsigned short length, unsigned short initerr,
289f29dbc25Smrg        unsigned short axialerr, unsigned short diagerr,
290f29dbc25Smrg        unsigned short flags);
291f29dbc25Smrg    void gfx_wait_until_idle(void);
292f29dbc25Smrg    int gfx_test_blt_pending(void);
293f29dbc25Smrg
294f29dbc25Smrg/* SECOND GENERATION RENDERING ROUTINES */
295f29dbc25Smrg
296f29dbc25Smrg    void gfx2_set_source_stride(unsigned short stride);
297f29dbc25Smrg    void gfx2_set_destination_stride(unsigned short stride);
298f29dbc25Smrg    void gfx2_set_pattern_origin(int x, int y);
299f29dbc25Smrg    void gfx2_set_source_transparency(unsigned long color,
300f29dbc25Smrg        unsigned long mask);
301f29dbc25Smrg    void gfx2_set_alpha_mode(int mode);
302f29dbc25Smrg    void gfx2_set_alpha_value(unsigned char value);
303f29dbc25Smrg    void gfx2_pattern_fill(unsigned long dstoffset, unsigned short width,
304f29dbc25Smrg        unsigned short height);
305f29dbc25Smrg    void gfx2_color_pattern_fill(unsigned long dstoffset,
306f29dbc25Smrg        unsigned short width, unsigned short height, unsigned long *pattern);
307f29dbc25Smrg    void gfx2_screen_to_screen_blt(unsigned long srcoffset,
308f29dbc25Smrg        unsigned long dstoffset, unsigned short width, unsigned short height,
309f29dbc25Smrg        int flags);
310f29dbc25Smrg    void gfx2_mono_expand_blt(unsigned long srcbase, unsigned short srcx,
311f29dbc25Smrg        unsigned short srcy, unsigned long dstoffset, unsigned short width,
312f29dbc25Smrg        unsigned short height, int byte_packed);
313f29dbc25Smrg    void gfx2_color_bitmap_to_screen_blt(unsigned short srcx,
314f29dbc25Smrg        unsigned short srcy, unsigned long dstoffset, unsigned short width,
315f29dbc25Smrg        unsigned short height, unsigned char *data, short pitch);
316f29dbc25Smrg    void gfx2_mono_bitmap_to_screen_blt(unsigned short srcx,
317f29dbc25Smrg        unsigned short srcy, unsigned long dstoffset, unsigned short width,
318f29dbc25Smrg        unsigned short height, unsigned char *data, short pitch);
319f29dbc25Smrg    void gfx2_text_blt(unsigned long dstoffset, unsigned short width,
320f29dbc25Smrg        unsigned short height, unsigned char *data);
321f29dbc25Smrg    void gfx2_bresenham_line(unsigned long dstoffset, unsigned short length,
322f29dbc25Smrg        unsigned short initerr, unsigned short axialerr,
323f29dbc25Smrg        unsigned short diagerr, unsigned short flags);
324f29dbc25Smrg    void gfx2_sync_to_vblank(void);
325f29dbc25Smrg
326f29dbc25Smrg/* ROUTINES IN GFX_VID.C */
327f29dbc25Smrg
328f29dbc25Smrg    int gfx_set_video_enable(int enable);
329f29dbc25Smrg    int gfx_set_video_format(unsigned long format);
330f29dbc25Smrg    int gfx_set_video_size(unsigned short width, unsigned short height);
331f29dbc25Smrg    int gfx_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch);
332f29dbc25Smrg    int gfx_set_video_offset(unsigned long offset);
333f29dbc25Smrg    int gfx_set_video_yuv_offsets(unsigned long yoffset,
334f29dbc25Smrg        unsigned long uoffset, unsigned long voffset);
335f29dbc25Smrg    int gfx_set_video_window(short x, short y, unsigned short w,
336f29dbc25Smrg        unsigned short h);
337f29dbc25Smrg    int gfx_set_video_left_crop(unsigned short x);
338f29dbc25Smrg    int gfx_set_video_upscale(unsigned short srcw, unsigned short srch,
339f29dbc25Smrg        unsigned short dstw, unsigned short dsth);
340f29dbc25Smrg    int gfx_set_video_scale(unsigned short srcw, unsigned short srch,
341f29dbc25Smrg        unsigned short dstw, unsigned short dsth);
342f29dbc25Smrg    int gfx_set_video_vertical_downscale(unsigned short srch,
343f29dbc25Smrg        unsigned short dsth);
344f29dbc25Smrg    void gfx_set_video_vertical_downscale_enable(int enable);
345f29dbc25Smrg    int gfx_set_video_downscale_config(unsigned short type, unsigned short m);
346f29dbc25Smrg    int gfx_set_video_color_key(unsigned long key, unsigned long mask,
347f29dbc25Smrg        int bluescreen);
348f29dbc25Smrg    int gfx_set_video_filter(int xfilter, int yfilter);
349f29dbc25Smrg    int gfx_set_video_palette(unsigned long *palette);
350f29dbc25Smrg    int gfx_set_graphics_palette(unsigned long *palette);
351f29dbc25Smrg    int gfx_set_video_palette_bypass(int enable);
352f29dbc25Smrg    int gfx_set_video_palette_entry(unsigned long index, unsigned long color);
353f29dbc25Smrg    int gfx_set_graphics_palette_entry(unsigned long index,
354f29dbc25Smrg        unsigned long color);
355f29dbc25Smrg    int gfx_set_video_downscale_coefficients(unsigned short coef1,
356f29dbc25Smrg        unsigned short coef2, unsigned short coef3, unsigned short coef4);
357f29dbc25Smrg    int gfx_set_video_downscale_enable(int enable);
358f29dbc25Smrg    int gfx_set_video_source(VideoSourceType source);
359f29dbc25Smrg    int gfx_set_vbi_source(VbiSourceType source);
360f29dbc25Smrg    int gfx_set_vbi_lines(unsigned long even, unsigned long odd);
361f29dbc25Smrg    int gfx_set_vbi_total(unsigned long even, unsigned long odd);
362f29dbc25Smrg    int gfx_set_video_interlaced(int enable);
363f29dbc25Smrg    int gfx_set_color_space_YUV(int enable);
364f29dbc25Smrg    int gfx_set_vertical_scaler_offset(char offset);
365f29dbc25Smrg    int gfx_set_top_line_in_odd(int enable);
366f29dbc25Smrg    int gfx_set_genlock_delay(unsigned long delay);
367f29dbc25Smrg    int gfx_set_genlock_enable(int flags);
368f29dbc25Smrg    int gfx_set_video_cursor(unsigned long key, unsigned long mask,
369f29dbc25Smrg        unsigned short select_color2, unsigned long color1,
370f29dbc25Smrg        unsigned long color2);
371f29dbc25Smrg    int gfx_set_video_cursor_enable(int enable);
372f29dbc25Smrg    int gfx_set_video_request(short x, short y);
373f29dbc25Smrg
374f29dbc25Smrg    int gfx_select_alpha_region(int region);
375f29dbc25Smrg    int gfx_set_alpha_enable(int enable);
376f29dbc25Smrg    int gfx_set_alpha_window(short x, short y,
377f29dbc25Smrg        unsigned short width, unsigned short height);
378f29dbc25Smrg    int gfx_set_alpha_value(unsigned char alpha, char delta);
379f29dbc25Smrg    int gfx_set_alpha_priority(int priority);
380f29dbc25Smrg    int gfx_set_alpha_color(unsigned long color);
381f29dbc25Smrg    int gfx_set_alpha_color_enable(int enable);
382f29dbc25Smrg    int gfx_set_no_ck_outside_alpha(int enable);
383f29dbc25Smrg    int gfx_disable_softvga(void);
384f29dbc25Smrg    int gfx_enable_softvga(void);
385f29dbc25Smrg    int gfx_set_macrovision_enable(int enable);
386f29dbc25Smrg    unsigned long gfx_get_max_video_width(void);
387f29dbc25Smrg
388f29dbc25Smrg/* READ ROUTINES IN GFX_VID.C */
389f29dbc25Smrg
390f29dbc25Smrg    int gfx_get_video_enable(void);
391f29dbc25Smrg    int gfx_get_video_format(void);
392f29dbc25Smrg    unsigned long gfx_get_video_src_size(void);
393f29dbc25Smrg    unsigned long gfx_get_video_line_size(void);
394f29dbc25Smrg    unsigned long gfx_get_video_xclip(void);
395f29dbc25Smrg    unsigned long gfx_get_video_offset(void);
396f29dbc25Smrg    void gfx_get_video_yuv_offsets(unsigned long *yoffset,
397f29dbc25Smrg        unsigned long *uoffset, unsigned long *voffset);
398f29dbc25Smrg    void gfx_get_video_yuv_pitch(unsigned long *ypitch,
399f29dbc25Smrg        unsigned long *uvpitch);
400f29dbc25Smrg    unsigned long gfx_get_video_upscale(void);
401f29dbc25Smrg    unsigned long gfx_get_video_scale(void);
402f29dbc25Smrg    unsigned long gfx_get_video_downscale_delta(void);
403f29dbc25Smrg    int gfx_get_video_vertical_downscale_enable(void);
404f29dbc25Smrg    int gfx_get_video_downscale_config(unsigned short *type,
405f29dbc25Smrg        unsigned short *m);
406f29dbc25Smrg    void gfx_get_video_downscale_coefficients(unsigned short *coef1,
407f29dbc25Smrg        unsigned short *coef2, unsigned short *coef3, unsigned short *coef4);
408f29dbc25Smrg    void gfx_get_video_downscale_enable(int *enable);
409f29dbc25Smrg    unsigned long gfx_get_video_dst_size(void);
410f29dbc25Smrg    unsigned long gfx_get_video_position(void);
411f29dbc25Smrg    unsigned long gfx_get_video_color_key(void);
412f29dbc25Smrg    unsigned long gfx_get_video_color_key_mask(void);
413f29dbc25Smrg    int gfx_get_video_palette_entry(unsigned long index,
414f29dbc25Smrg        unsigned long *palette);
415f29dbc25Smrg    int gfx_get_video_color_key_src(void);
416f29dbc25Smrg    int gfx_get_video_filter(void);
417f29dbc25Smrg    int gfx_get_video_request(short *x, short *y);
418f29dbc25Smrg    int gfx_get_video_source(VideoSourceType * source);
419f29dbc25Smrg    int gfx_get_vbi_source(VbiSourceType * source);
420f29dbc25Smrg    unsigned long gfx_get_vbi_lines(int odd);
421f29dbc25Smrg    unsigned long gfx_get_vbi_total(int odd);
422f29dbc25Smrg    int gfx_get_video_interlaced(void);
423f29dbc25Smrg    int gfx_get_color_space_YUV(void);
424f29dbc25Smrg    int gfx_get_vertical_scaler_offset(char *offset);
425f29dbc25Smrg    unsigned long gfx_get_genlock_delay(void);
426f29dbc25Smrg    int gfx_get_genlock_enable(void);
427f29dbc25Smrg    int gfx_get_video_cursor(unsigned long *key, unsigned long *mask,
428f29dbc25Smrg        unsigned short *select_color2, unsigned long *color1,
429f29dbc25Smrg        unsigned short *color2);
430f29dbc25Smrg    unsigned long gfx_read_crc(void);
431f29dbc25Smrg    unsigned long gfx_read_crc32(void);
432f29dbc25Smrg    unsigned long gfx_read_window_crc(int source, unsigned short x,
433f29dbc25Smrg        unsigned short y, unsigned short width, unsigned short height,
434f29dbc25Smrg        int crc32);
435f29dbc25Smrg    int gfx_get_macrovision_enable(void);
436f29dbc25Smrg
437f29dbc25Smrg    void gfx_get_alpha_enable(int *enable);
438f29dbc25Smrg    void gfx_get_alpha_size(unsigned short *x, unsigned short *y,
439f29dbc25Smrg        unsigned short *width, unsigned short *height);
440f29dbc25Smrg    void gfx_get_alpha_value(unsigned char *alpha, char *delta);
441f29dbc25Smrg    void gfx_get_alpha_priority(int *priority);
442f29dbc25Smrg    void gfx_get_alpha_color(unsigned long *color);
443f29dbc25Smrg
444f29dbc25Smrg/* ROUTINES IN GFX_VIP.C */
445f29dbc25Smrg
446f29dbc25Smrg    int gfx_set_vip_enable(int enable);
447f29dbc25Smrg    int gfx_set_vip_capture_run_mode(int mode);
448f29dbc25Smrg    int gfx_set_vip_base(unsigned long even, unsigned long odd);
449f29dbc25Smrg    int gfx_set_vip_pitch(unsigned long pitch);
450f29dbc25Smrg    int gfx_set_vip_mode(int mode);
451f29dbc25Smrg    int gfx_set_vbi_enable(int enable);
452f29dbc25Smrg    int gfx_set_vbi_mode(int mode);
453f29dbc25Smrg    int gfx_set_vbi_base(unsigned long even, unsigned long odd);
454f29dbc25Smrg    int gfx_set_vbi_pitch(unsigned long pitch);
455f29dbc25Smrg    int gfx_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines);
456f29dbc25Smrg    int gfx_set_vbi_interrupt(int enable);
457f29dbc25Smrg    int gfx_set_vip_bus_request_threshold_high(int enable);
458f29dbc25Smrg    int gfx_set_vip_last_line(int last_line);
459f29dbc25Smrg    int gfx_test_vip_odd_field(void);
460f29dbc25Smrg    int gfx_test_vip_bases_updated(void);
461f29dbc25Smrg    int gfx_test_vip_fifo_overflow(void);
462f29dbc25Smrg    int gfx_get_vip_line(void);
463f29dbc25Smrg
464f29dbc25Smrg/* READ ROUTINES IN GFX_VIP.C */
465f29dbc25Smrg
466f29dbc25Smrg    int gfx_get_vip_enable(void);
467f29dbc25Smrg    unsigned long gfx_get_vip_base(int odd);
468f29dbc25Smrg    unsigned long gfx_get_vip_pitch(void);
469f29dbc25Smrg    int gfx_get_vip_mode(void);
470f29dbc25Smrg    int gfx_get_vbi_enable(void);
471f29dbc25Smrg    int gfx_get_vbi_mode(void);
472f29dbc25Smrg    unsigned long gfx_get_vbi_base(int odd);
473f29dbc25Smrg    unsigned long gfx_get_vbi_pitch(void);
474f29dbc25Smrg    unsigned long gfx_get_vbi_direct(int odd);
475f29dbc25Smrg    int gfx_get_vbi_interrupt(void);
476f29dbc25Smrg    int gfx_get_vip_bus_request_threshold_high(void);
477f29dbc25Smrg
478f29dbc25Smrg/* ROUTINES IN GFX_DCDR.C */
479f29dbc25Smrg
480f29dbc25Smrg    int gfx_set_decoder_defaults(void);
481f29dbc25Smrg    int gfx_set_decoder_analog_input(unsigned char input);
482f29dbc25Smrg    int gfx_set_decoder_brightness(unsigned char brightness);
483f29dbc25Smrg    int gfx_set_decoder_contrast(unsigned char contrast);
484f29dbc25Smrg    int gfx_set_decoder_hue(char hue);
485f29dbc25Smrg    int gfx_set_decoder_saturation(unsigned char saturation);
486f29dbc25Smrg    int gfx_set_decoder_input_offset(unsigned short x, unsigned short y);
487f29dbc25Smrg    int gfx_set_decoder_input_size(unsigned short width,
488f29dbc25Smrg        unsigned short height);
489f29dbc25Smrg    int gfx_set_decoder_output_size(unsigned short width,
490f29dbc25Smrg        unsigned short height);
491f29dbc25Smrg    int gfx_set_decoder_scale(unsigned short srcw, unsigned short srch,
492f29dbc25Smrg        unsigned short dstw, unsigned short dsth);
493f29dbc25Smrg    int gfx_set_decoder_vbi_format(int start, int end, int format);
494f29dbc25Smrg    int gfx_set_decoder_vbi_enable(int enable);
495f29dbc25Smrg    int gfx_set_decoder_vbi_upscale(void);
496f29dbc25Smrg    int gfx_set_decoder_TV_standard(TVStandardType TVStandard);
497f29dbc25Smrg    int gfx_set_decoder_luminance_filter(unsigned char lufi);
498f29dbc25Smrg    int gfx_decoder_software_reset(void);
499f29dbc25Smrg    int gfx_decoder_detect_macrovision(void);
500f29dbc25Smrg    int gfx_decoder_detect_video(void);
501f29dbc25Smrg
502f29dbc25Smrg/* READ ROUTINES IN GFX_DCDR.C */
503f29dbc25Smrg
504f29dbc25Smrg    unsigned char gfx_get_decoder_brightness(void);
505f29dbc25Smrg    unsigned char gfx_get_decoder_contrast(void);
506f29dbc25Smrg    char gfx_get_decoder_hue(void);
507f29dbc25Smrg    unsigned char gfx_get_decoder_saturation(void);
508f29dbc25Smrg    unsigned long gfx_get_decoder_input_offset(void);
509f29dbc25Smrg    unsigned long gfx_get_decoder_input_size(void);
510f29dbc25Smrg    unsigned long gfx_get_decoder_output_size(void);
511f29dbc25Smrg    int gfx_get_decoder_vbi_format(int line);
512f29dbc25Smrg
513f29dbc25Smrg/* ROUTINES IN GFX_I2C.C */
514f29dbc25Smrg
515f29dbc25Smrg    int gfx_i2c_reset(unsigned char busnum, short adr, char freq);
516f29dbc25Smrg    int gfx_i2c_write(unsigned char busnum, unsigned char chipadr,
517f29dbc25Smrg        unsigned char subadr, unsigned char bytes, unsigned char *data);
518f29dbc25Smrg    int gfx_i2c_read(unsigned char busnum, unsigned char chipadr,
519f29dbc25Smrg        unsigned char subadr, unsigned char bytes, unsigned char *data);
520f29dbc25Smrg    int gfx_i2c_select_gpio(int clock, int data);
521f29dbc25Smrg    int gfx_i2c_init(void);
522f29dbc25Smrg    void gfx_i2c_cleanup(void);
523f29dbc25Smrg
524f29dbc25Smrg/* ROUTINES IN GFX_TV.C */
525f29dbc25Smrg
526f29dbc25Smrg    int gfx_set_tv_format(TVStandardType format, GfxOnTVType resolution);
527f29dbc25Smrg    int gfx_set_tv_output(int output);
528f29dbc25Smrg    int gfx_set_tv_enable(int enable);
529f29dbc25Smrg    int gfx_set_tv_flicker_filter(int ff);
530f29dbc25Smrg    int gfx_set_tv_sub_carrier_reset(int screset);
531f29dbc25Smrg    int gfx_set_tv_vphase(int vphase);
532f29dbc25Smrg    int gfx_set_tv_YC_delay(int delay);
533f29dbc25Smrg    int gfx_set_tvenc_reset_interval(int interval);
534f29dbc25Smrg    int gfx_set_tv_cc_enable(int enable);
535f29dbc25Smrg    int gfx_set_tv_cc_data(unsigned char data1, unsigned char data2);
536f29dbc25Smrg    int gfx_set_tv_display(int width, int height);
537f29dbc25Smrg    int gfx_test_tvout_odd_field(void);
538f29dbc25Smrg    int gfx_test_tvenc_odd_field(void);
539f29dbc25Smrg    int gfx_set_tv_field_status_invert(int enable);
540f29dbc25Smrg    int gfx_get_tv_vphase(void);
541f29dbc25Smrg    int gfx_get_tv_enable(unsigned int *p_on);
542f29dbc25Smrg    int gfx_get_tv_output(void);
543f29dbc25Smrg    int gfx_get_tv_mode_count(TVStandardType format);
544f29dbc25Smrg    int gfx_get_tv_display_mode(int *width, int *height, int *bpp, int *hz);
545f29dbc25Smrg    int gfx_get_tv_display_mode_frequency(unsigned short width,
546f29dbc25Smrg        unsigned short height, TVStandardType format, int *frequency);
547f29dbc25Smrg    int gfx_is_tv_display_mode_supported(unsigned short width,
548f29dbc25Smrg        unsigned short height, TVStandardType format);
549f29dbc25Smrg
550f29dbc25Smrg    int gfx_get_tv_standard(unsigned long *p_standard);
551f29dbc25Smrg    int gfx_get_available_tv_standards(unsigned long *p_standards);
552f29dbc25Smrg    int gfx_set_tv_standard(unsigned long standard);
553f29dbc25Smrg    int gfx_get_tv_vga_mode(unsigned long *p_vga_mode);
554f29dbc25Smrg    int gfx_get_available_tv_vga_modes(unsigned long *p_vga_modes);
555f29dbc25Smrg    int gfx_set_tv_vga_mode(unsigned long vga_mode);
556f29dbc25Smrg    int gfx_get_tvout_mode(unsigned long *p_tvout_mode);
557f29dbc25Smrg    int gfx_set_tvout_mode(unsigned long tvout_mode);
558f29dbc25Smrg    int gfx_get_sharpness(int *p_sharpness);
559f29dbc25Smrg    int gfx_set_sharpness(int sharpness);
560f29dbc25Smrg    int gfx_get_flicker_filter(int *p_flicker);
561f29dbc25Smrg    int gfx_set_flicker_filter(int flicker);
562f29dbc25Smrg    int gfx_get_overscan(int *p_x, int *p_y);
563f29dbc25Smrg    int gfx_set_overscan(int x, int y);
564f29dbc25Smrg    int gfx_get_position(int *p_x, int *p_y);
565f29dbc25Smrg    int gfx_set_position(int x, int y);
566f29dbc25Smrg    int gfx_get_color(int *p_color);
567f29dbc25Smrg    int gfx_set_color(int color);
568f29dbc25Smrg    int gfx_get_brightness(int *p_brightness);
569f29dbc25Smrg    int gfx_set_brightness(int brightness);
570f29dbc25Smrg    int gfx_get_contrast(int *p_contrast);
571f29dbc25Smrg    int gfx_set_contrast(int constrast);
572f29dbc25Smrg    int gfx_get_yc_filter(unsigned int *p_yc_filter);
573f29dbc25Smrg    int gfx_set_yc_filter(unsigned int yc_filter);
574f29dbc25Smrg    int gfx_get_aps_trigger_bits(unsigned int *p_trigger_bits);
575f29dbc25Smrg    int gfx_set_aps_trigger_bits(unsigned int trigger_bits);
576f29dbc25Smrg
577f29dbc25Smrg/* ROUTINES IN GFX_VGA.C */
578f29dbc25Smrg
579f29dbc25Smrg    int gfx_get_softvga_active(void);
580f29dbc25Smrg    int gfx_vga_test_pci(void);
581f29dbc25Smrg    unsigned char gfx_vga_get_pci_command(void);
582f29dbc25Smrg    int gfx_vga_set_pci_command(unsigned char command);
583f29dbc25Smrg    int gfx_vga_seq_reset(int reset);
584f29dbc25Smrg    int gfx_vga_set_graphics_bits(void);
585f29dbc25Smrg    int gfx_vga_mode(gfx_vga_struct * vga, int xres, int yres, int bpp,
586f29dbc25Smrg        int hz);
587f29dbc25Smrg    int gfx_vga_pitch(gfx_vga_struct * vga, unsigned short pitch);
588f29dbc25Smrg    int gfx_vga_save(gfx_vga_struct * vga, int flags);
589f29dbc25Smrg    int gfx_vga_restore(gfx_vga_struct * vga, int flags);
590f29dbc25Smrg    int gfx_vga_mode_switch(int active);
591f29dbc25Smrg    void gfx_vga_clear_extended(void);
592f29dbc25Smrg
593f29dbc25Smrg/* CLOSE BRACKET FOR C++ COMPLILATION */
594f29dbc25Smrg
595f29dbc25Smrg#ifdef __cplusplus
596f29dbc25Smrg}
597f29dbc25Smrg#endif
598f29dbc25Smrg
599f29dbc25Smrg#endif                                 /* !_gfx_rtns_h */
600f29dbc25Smrg
601f29dbc25Smrg/* END OF FILE */
602