blob: ea2d71ef8f3f3d76bf8464fc2b2369fa71eda4e0
1 | /* |
2 | * (C) Copyright 1997-2002 ELTEC Elektronik AG |
3 | * Frank Gottschling <fgottschling@eltec.de> |
4 | * |
5 | * SPDX-License-Identifier: GPL-2.0+ |
6 | */ |
7 | |
8 | /* |
9 | * smiLynxEM.h |
10 | * Silicon Motion graphic interface for sm810/sm710/sm712 accelerator |
11 | * |
12 | * |
13 | * modification history |
14 | * -------------------- |
15 | * 04-18-2002 Rewritten for U-Boot <fgottschling@eltec.de>. |
16 | */ |
17 | |
18 | #ifndef _VIDEO_FB_H_ |
19 | #define _VIDEO_FB_H_ |
20 | |
21 | #if defined(CONFIG_SYS_CONSOLE_FG_COL) && defined(CONFIG_SYS_CONSOLE_BG_COL) |
22 | #define CONSOLE_BG_COL CONFIG_SYS_CONSOLE_BG_COL |
23 | #define CONSOLE_FG_COL CONFIG_SYS_CONSOLE_FG_COL |
24 | #else |
25 | #define CONSOLE_BG_COL 0x00 |
26 | #define CONSOLE_FG_COL 0xa0 |
27 | #endif |
28 | |
29 | /* |
30 | * Graphic Data Format (GDF) bits for VIDEO_DATA_FORMAT |
31 | */ |
32 | #define GDF__8BIT_INDEX 0 |
33 | #define GDF_15BIT_555RGB 1 |
34 | #define GDF_16BIT_565RGB 2 |
35 | #define GDF_32BIT_X888RGB 3 |
36 | #define GDF_24BIT_888RGB 4 |
37 | #define GDF__8BIT_332RGB 5 |
38 | |
39 | /******************************************************************************/ |
40 | /* Export Graphic Driver Control */ |
41 | /******************************************************************************/ |
42 | |
43 | typedef struct graphic_device { |
44 | unsigned int isaBase; |
45 | unsigned int pciBase; |
46 | unsigned int dprBase; |
47 | unsigned int vprBase; |
48 | unsigned int cprBase; |
49 | unsigned int frameAdrs; |
50 | unsigned int memSize; |
51 | unsigned int fb_width; |
52 | unsigned int fb_height; |
53 | unsigned int mode; |
54 | unsigned int gdfIndex; |
55 | unsigned int gdfBytesPP; |
56 | unsigned int fg; |
57 | unsigned int bg; |
58 | unsigned int plnSizeX; |
59 | unsigned int plnSizeY; |
60 | unsigned int winSizeX; |
61 | unsigned int winSizeY; |
62 | char modeIdent[80]; |
63 | } GraphicDevice; |
64 | |
65 | |
66 | /******************************************************************************/ |
67 | /* Export Graphic Functions */ |
68 | /******************************************************************************/ |
69 | |
70 | void *video_hw_init (int display_mode); /* returns GraphicDevice struct or NULL */ |
71 | int get_osd_layer(void); |
72 | |
73 | #ifdef VIDEO_HW_BITBLT |
74 | void video_hw_bitblt ( |
75 | unsigned int bpp, /* bytes per pixel */ |
76 | unsigned int src_x, /* source pos x */ |
77 | unsigned int src_y, /* source pos y */ |
78 | unsigned int dst_x, /* dest pos x */ |
79 | unsigned int dst_y, /* dest pos y */ |
80 | unsigned int dim_x, /* frame width */ |
81 | unsigned int dim_y /* frame height */ |
82 | ); |
83 | #endif |
84 | |
85 | #ifdef VIDEO_HW_RECTFILL |
86 | void video_hw_rectfill ( |
87 | unsigned int bpp, /* bytes per pixel */ |
88 | unsigned int dst_x, /* dest pos x */ |
89 | unsigned int dst_y, /* dest pos y */ |
90 | unsigned int dim_x, /* frame width */ |
91 | unsigned int dim_y, /* frame height */ |
92 | unsigned int color /* fill color */ |
93 | ); |
94 | #endif |
95 | |
96 | void video_set_lut ( |
97 | unsigned int index, /* color number */ |
98 | unsigned char r, /* red */ |
99 | unsigned char g, /* green */ |
100 | unsigned char b /* blue */ |
101 | ); |
102 | #ifdef CONFIG_VIDEO_HW_CURSOR |
103 | void video_set_hw_cursor(int x, int y); /* x y in pixel */ |
104 | void video_init_hw_cursor(int font_width, int font_height); |
105 | #endif |
106 | |
107 | enum display_mode_e { |
108 | MIDDLE_MODE, |
109 | RECT_MODE, |
110 | FULL_SCREEN_MODE, |
111 | }; |
112 | |
113 | enum pci_type_e { |
114 | BMP_PIC, |
115 | RAW_PIC, |
116 | }; |
117 | |
118 | typedef struct { |
119 | int width; |
120 | int height; |
121 | int row_bytes; |
122 | int pixel_bytes; |
123 | unsigned char* data; |
124 | } GRSurface; |
125 | |
126 | typedef struct { |
127 | GRSurface* texture; |
128 | int char_width; |
129 | int char_height; |
130 | } GRFont; |
131 | |
132 | #endif /*_VIDEO_FB_H_ */ |
133 |