xref: /rk3399_rockchip-uboot/include/video_fb.h (revision c609719b8d1b2dca590e0ed499016d041203e403)
1*c609719bSwdenk                                                                                     /*
2*c609719bSwdenk  * (C) Copyright 1997-2002 ELTEC Elektronik AG
3*c609719bSwdenk  * Frank Gottschling <fgottschling@eltec.de>
4*c609719bSwdenk  *
5*c609719bSwdenk  * See file CREDITS for list of people who contributed to this
6*c609719bSwdenk  * project.
7*c609719bSwdenk  *
8*c609719bSwdenk  * This program is free software; you can redistribute it and/or
9*c609719bSwdenk  * modify it under the terms of the GNU General Public License as
10*c609719bSwdenk  * published by the Free Software Foundation; either version 2 of
11*c609719bSwdenk  * the License, or (at your option) any later version.
12*c609719bSwdenk  *
13*c609719bSwdenk  * This program is distributed in the hope that it will be useful,
14*c609719bSwdenk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*c609719bSwdenk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*c609719bSwdenk  * GNU General Public License for more details.
17*c609719bSwdenk  *
18*c609719bSwdenk  * You should have received a copy of the GNU General Public License
19*c609719bSwdenk  * along with this program; if not, write to the Free Software
20*c609719bSwdenk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21*c609719bSwdenk  * MA 02111-1307 USA
22*c609719bSwdenk  */
23*c609719bSwdenk 
24*c609719bSwdenk /*
25*c609719bSwdenk  * smiLynxEM.h
26*c609719bSwdenk  * Silicon Motion graphic interface for sm810/sm710/sm712 accelerator
27*c609719bSwdenk  *
28*c609719bSwdenk  *
29*c609719bSwdenk  *  modification history
30*c609719bSwdenk  *  --------------------
31*c609719bSwdenk  *  04-18-2002 Rewritten for U-Boot <fgottschling@eltec.de>.
32*c609719bSwdenk  */
33*c609719bSwdenk 
34*c609719bSwdenk #ifndef _VIDEO_FB_H_
35*c609719bSwdenk #define _VIDEO_FB_H_
36*c609719bSwdenk 
37*c609719bSwdenk #define CONSOLE_BG_COL            0x00
38*c609719bSwdenk #define CONSOLE_FG_COL            0xa0
39*c609719bSwdenk 
40*c609719bSwdenk /*
41*c609719bSwdenk  * Graphic Data Format (GDF) bits for VIDEO_DATA_FORMAT
42*c609719bSwdenk  */
43*c609719bSwdenk #define GDF__8BIT_INDEX         0
44*c609719bSwdenk #define GDF_15BIT_555RGB        1
45*c609719bSwdenk #define GDF_16BIT_565RGB        2
46*c609719bSwdenk #define GDF_32BIT_X888RGB       3
47*c609719bSwdenk #define GDF_24BIT_888RGB        4
48*c609719bSwdenk #define GDF__8BIT_332RGB        5
49*c609719bSwdenk 
50*c609719bSwdenk /******************************************************************************/
51*c609719bSwdenk /* Export Graphic Driver Control                                              */
52*c609719bSwdenk /******************************************************************************/
53*c609719bSwdenk 
54*c609719bSwdenk typedef struct {
55*c609719bSwdenk     unsigned int isaBase;
56*c609719bSwdenk     unsigned int pciBase;
57*c609719bSwdenk     unsigned int dprBase;
58*c609719bSwdenk     unsigned int vprBase;
59*c609719bSwdenk     unsigned int cprBase;
60*c609719bSwdenk     unsigned int frameAdrs;
61*c609719bSwdenk     unsigned int memSize;
62*c609719bSwdenk     unsigned int mode;
63*c609719bSwdenk     unsigned int gdfIndex;
64*c609719bSwdenk     unsigned int gdfBytesPP;
65*c609719bSwdenk     unsigned int fg;
66*c609719bSwdenk     unsigned int bg;
67*c609719bSwdenk     unsigned int plnSizeX;
68*c609719bSwdenk     unsigned int plnSizeY;
69*c609719bSwdenk     unsigned int winSizeX;
70*c609719bSwdenk     unsigned int winSizeY;
71*c609719bSwdenk     char modeIdent[80];
72*c609719bSwdenk } GraphicDevice;
73*c609719bSwdenk 
74*c609719bSwdenk 
75*c609719bSwdenk /******************************************************************************/
76*c609719bSwdenk /* Export Graphic Functions                                                   */
77*c609719bSwdenk /******************************************************************************/
78*c609719bSwdenk 
79*c609719bSwdenk void *video_hw_init (void);       /* returns GraphicDevice struct or NULL */
80*c609719bSwdenk 
81*c609719bSwdenk #ifdef VIDEO_HW_BITBLT
82*c609719bSwdenk void video_hw_bitblt (
83*c609719bSwdenk     unsigned int bpp,             /* bytes per pixel */
84*c609719bSwdenk     unsigned int src_x,           /* source pos x */
85*c609719bSwdenk     unsigned int src_y,           /* source pos y */
86*c609719bSwdenk     unsigned int dst_x,           /* dest pos x */
87*c609719bSwdenk     unsigned int dst_y,           /* dest pos y */
88*c609719bSwdenk     unsigned int dim_x,           /* frame width */
89*c609719bSwdenk     unsigned int dim_y            /* frame height */
90*c609719bSwdenk     );
91*c609719bSwdenk #endif
92*c609719bSwdenk 
93*c609719bSwdenk #ifdef VIDEO_HW_RECTFILL
94*c609719bSwdenk void video_hw_rectfill (
95*c609719bSwdenk     unsigned int bpp,             /* bytes per pixel */
96*c609719bSwdenk     unsigned int dst_x,           /* dest pos x */
97*c609719bSwdenk     unsigned int dst_y,           /* dest pos y */
98*c609719bSwdenk     unsigned int dim_x,           /* frame width */
99*c609719bSwdenk     unsigned int dim_y,           /* frame height */
100*c609719bSwdenk     unsigned int color            /* fill color */
101*c609719bSwdenk      );
102*c609719bSwdenk #endif
103*c609719bSwdenk 
104*c609719bSwdenk void video_set_lut (
105*c609719bSwdenk     unsigned int index,           /* color number */
106*c609719bSwdenk     unsigned char r,              /* red */
107*c609719bSwdenk     unsigned char g,              /* green */
108*c609719bSwdenk     unsigned char b               /* blue */
109*c609719bSwdenk     );
110*c609719bSwdenk #ifdef CONFIG_VIDEO_HW_CURSOR
111*c609719bSwdenk void video_set_hw_cursor(int x, int y); /* x y in pixel */
112*c609719bSwdenk void video_init_hw_cursor(int font_width, int font_height);
113*c609719bSwdenk #endif
114*c609719bSwdenk 
115*c609719bSwdenk #endif /*_VIDEO_FB_H_ */
116