summaryrefslogtreecommitdiff
path: root/Source/DirectFB/gfxdrivers/nsc/include/nsc_galproto.h
blob: 67266cc541cfade600683ece738503c1baf396e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
/*
 * $Workfile: nsc_galproto.h $
 * $Revision: 1.3 $
 *
 * File Contents: This file contains the main functions of the Geode 
 *                frame buffer device drivers GAL function prototypes and  
 *                data structures.
 *
 * Project:       Geode Frame buffer device driver
 *
 */

/* NSC_LIC_ALTERNATIVE_PREAMBLE
 *
 * Revision 1.0
 *
 * National Semiconductor Alternative GPL-BSD License
 *
 * National Semiconductor Corporation licenses this software 
 * ("Software"):
 *
 * National Xfree frame buffer driver
 *
 * under one of the two following licenses, depending on how the 
 * Software is received by the Licensee.
 * 
 * If this Software is received as part of the Linux Framebuffer or
 * other GPL licensed software, then the GPL license designated 
 * NSC_LIC_GPL applies to this Software; in all other circumstances 
 * then the BSD-style license designated NSC_LIC_BSD shall apply.
 *
 * END_NSC_LIC_ALTERNATIVE_PREAMBLE */

/* NSC_LIC_BSD
 *
 * National Semiconductor Corporation Open Source License for 
 *
 * National Xfree frame buffer driver
 *
 * (BSD License with Export Notice)
 *
 * Copyright (c) 1999-2001
 * National Semiconductor Corporation.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met: 
 *
 *   * Redistributions of source code must retain the above copyright 
 *     notice, this list of conditions and the following disclaimer. 
 *
 *   * Redistributions in binary form must reproduce the above 
 *     copyright notice, this list of conditions and the following 
 *     disclaimer in the documentation and/or other materials provided 
 *     with the distribution. 
 *
 *   * Neither the name of the National Semiconductor Corporation nor 
 *     the names of its contributors may be used to endorse or promote 
 *     products derived from this software without specific prior 
 *     written permission. 
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
 * OF SUCH DAMAGE.
 *
 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 
 * YOUR JURISDICTION. It is licensee's responsibility to comply with 
 * any export regulations applicable in licensee's jurisdiction. Under 
 * CURRENT (2001) U.S. export regulations this software 
 * is eligible for export from the U.S. and can be downloaded by or 
 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 
 * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 
 * Syria, Sudan, Afghanistan and any other country to which the U.S. 
 * has embargoed goods and services. 
 *
 * END_NSC_LIC_BSD */

/* NSC_LIC_GPL
 *
 * National Semiconductor Corporation Gnu General Public License for 
 *
 * National Xfree frame buffer driver
 *
 * (GPL License with Export Notice)
 *
 * Copyright (c) 1999-2001
 * National Semiconductor Corporation.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted under the terms of the GNU General 
 * Public License as published by the Free Software Foundation; either 
 * version 2 of the License, or (at your option) any later version  
 *
 * In addition to the terms of the GNU General Public License, neither 
 * the name of the National Semiconductor Corporation nor the names of 
 * its contributors may be used to endorse or promote products derived 
 * from this software without specific prior written permission. 
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 
 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
 * OF SUCH DAMAGE. See the GNU General Public License for more details. 
 *
 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 
 * YOUR JURISDICTION. It is licensee's responsibility to comply with 
 * any export regulations applicable in licensee's jurisdiction. Under 
 * CURRENT (2001) U.S. export regulations this software 
 * is eligible for export from the U.S. and can be downloaded by or 
 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 
 * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 
 * Syria, Sudan, Afghanistan and any other country to which the U.S. 
 * has embargoed goods and services. 
 *
 * You should have received a copy of the GNU General Public License 
 * along with this file; if not, write to the Free Software Foundation, 
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
 *
 * END_NSC_LIC_GPL */

#ifndef __GALPROTO_SEP_20_2000
#define __GALPROTO_SEP_20_2000

/* durango reg definitions and type's */
#include <gfx_type.h>
#include <gfx_regs.h>

/* Panel related definition */
#include <pnl_defs.h>

typedef int SWORD;
typedef unsigned int DWORD;
typedef unsigned short WORD;
typedef unsigned char CHAR;
typedef unsigned char BOOLEAN;
typedef unsigned int *PDWORD;

/***************************************/
/* Applications/User mode drivers use this ioctl to
 * send a graphics device request to the frame buffer
 * driver
 */
#define FBIOGAL_API      0x4700

/*
 * Applications must sign the I/O packet with this value
 */

#define FBGAL_SIGNATURE 0xC0C0BABE

/*
 * Version is a 16:16 fixed value
 * Current version is 1.0000
 */

#define FBGAL_VERSION 0x10000

/*
 * Definitions for Graphics Subfunctions
 *
 */

typedef enum GALFN_CODES
{
/* General Adapter level functions */
   GALFN_GETADAPTERINFO = 0,
   GALFN_SETSOFTVGASTATE,
   GALFN_GETSOFTVGASTATE,
   GALFN_WAITUNTILIDLE,
   GALFN_WAITVERTICALBLANK,
   GALFN_SETCRTENABLE,
   GALFN_WRITEREG,
   GALFN_READREG,

/* Change/Get Display hardware state */

   GALFN_ISDISPLAYMODESUPPORTED,
   GALFN_SETDISPLAYMODE,
   GALFN_GETDISPLAYMODE,
   GALFN_SETBPP,
   GALFN_SETDISPLAYBPP,
   GALFN_GETDISPLAYBPP,
   GALFN_SETDISPLAYPITCH,
   GALFN_GETDISPLAYPITCH,
   GALFN_SETDISPLAYOFFSET,
   GALFN_GETDISPLAYOFFSET,
   GALFN_DOTCLKTOREFRESH,
   GALFN_GETDISPLAYTIMINGS,
   GALFN_SETDISPLAYTIMINGS,
   GALFN_SETPALETTE,
   GALFN_GETPALETTE,
   GALFN_SETPALETTE_ENTRY,
   GALFN_GETPALETTE_ENTRY,
   GALFN_SETFIXEDTIMINGS,

/* Hardware cursor funtions */

   GALFN_SETCURSORENABLE,
   GALFN_GETCURSORENABLE,
   GALFN_SETCURSORPOSITION,
   GALFN_GETCURSORPOSITION,
   GALFN_SETCURSORCOLORS,
   GALFN_GETCURSORCOLORS,
   GALFN_SETCURSORSHAPE,
   GALFN_SETCURSORSHAPE_RCLD,

/* grafix rendering funtions */
   GALFN_SETSOLIDPATTERN,
   GALFN_SETRASTEROPERATION,
   GALFN_SETSOLIDSOURCE,
   GALFN_PATTERNFILL,
   GALFN_SETMONOSOURCE,
   GALFN_SETMONOPATTERN,
   GALFN_SCREENTOSCREENBLT,
   GALFN_SCREENTOSCREENXBLT,
   GALFN_BRESENHAMLINE,
   GALFN_COLOR_PATTERNFILL,
   GALFN_COLOR_BITMAP_TO_SCREEN_BLT,
   GALFN_COLOR_BITMAP_TO_SCREEN_XBLT,
   GALFN_MONO_BITMAP_TO_SCREEN_BLT,
   GALFN_TEXT_BLT,

/* VGA Support functions */

   GALFN_VGAMODESWITCH,
   GALFN_VGACLEARCRTEXT,
   GALFN_VGASETPITCH,
   GALFN_VGARESTORE,
   GALFN_VGASAVE,
   GALFN_VGASETMODE,

/* Compression functions */
   GALFN_SETCOMPRESSIONSTATE,
   GALFN_GETCOMPRESSIONSTATE,
   GALFN_SETCOMPRESSIONPARAMS,
   GALFN_GETCOMPRESSIONPARAMS,

/* Panel Support functions */

   GALFN_PNLSETPARAMS,
   GALFN_PNLGETPARAMS,
   GALFN_PNLINITPANEL,
   GALFN_PNLSAVESTATE,
   GALFN_PNLRESTORESTATE,
   GALFN_PNLPOWERUP,
   GALFN_PNLPOWERDOWN,
   GALFN_PNLBIOSENABLE,
   GALFN_PNLBIOSINFO,
   GALFN_ENABLEPANNING,

/* TV Support functions */

   GALFN_SETTVPARAMS,
   GALFN_GETTVPARAMS,
   GALFN_SETTVTIMING,
   GALFN_GETTVTIMING,
   GALFN_SETENABLE,
   GALFN_GETENABLE,
   GALFN_ISTVMODESUPPORTED,

/* Video Support functions */

   GALFN_SETVIDEOENABLE,
   GALFN_SETVIDEOFORMAT,
   GALFN_SETVIDEOSIZE,
   GALFN_SETVIDEOOFFSET,
   GALFN_SETVIDEOWINDOW,
   GALFN_SETVIDEOSCALE,
   GALFN_SETVIDEOFILTER,
   GALFN_SETVIDEOCOLORKEY,
   GALFN_SETVIDEODOWNSCALEENABLE,
   GALFN_SETVIDEODOWNSCALECONFIG,
   GALFN_SETVIDEODOWNSCALECOEFF,
   GALFN_SETVIDEOSOURCE,
   GALFN_SETVIDEOINTERLACED,
   GALFN_SETVIDEOCURSOR,
   GALFN_SETVIDEOREQUEST,
   GALFN_SETALPHAENABLE,
   GALFN_SETALPHAWINDOW,
   GALFN_SETALPHAVALUE,
   GALFN_SETALPHAPRIORITY,
   GALFN_SETALPHACOLOR,
   GALFN_SETALPHAREGION,
   GALFN_SETVIDEOOUTSIDEALPHA,
   GALFN_SETVIDEOPALETTE,
   GALFN_GETVIDEOINFO,
   GALFN_SETVIDEOCOLORSPACE,

/* VIP Supported functions */

   GALFN_SETVIPENABLE,
   GALFN_SETVIPCAPTURERUNMODE,
   GALFN_SETVIPBASE,
   GALFN_SETVIPPITCH,
   GALFN_SETVIPMODE,
   GALFN_SETVIPBRTH,
   GALFN_SETVIPLASTLINE,
   GALFN_TESTVIPODDFIELD,
   GALFN_TESTVIPBASESUPDATED,
   GALFN_SETVBIENABLE,
   GALFN_SETVBIMODE,
   GALFN_SETVBIBASE,
   GALFN_SETVBIPITCH,
   GALFN_SETVBIDIRECT,
   GALFN_SETVBIINTERRUPT,
   GALFN_SETGENLOCKENABLE,
   GALFN_SETTOPLINEINODD,
   GALFN_SETGENLOCKDELAY,
   GALFN_SETMACROVISIONENABLE,

   GALFN_GETVIPENABLE,
   GALFN_GETVIPBASE,
   GALFN_GETVIPPITCH,
   GALFN_GETVIPMODE,
   GALFN_GETVIPBRTH,
   GALFN_GETVIPLINE,
   GALFN_GETVBIENABLE,
   GALFN_GETVBIBASE,
   GALFN_GETVBIPITCH,
   GALFN_GETVBIMODE,
   GALFN_GETVBIDIRECT,
   GALFN_GETVBIINTERRUPT,
   GALFN_TESTVIPFIFOOVERFLOW,

/* Second generation rendering routines */

   GALFN_SETICONENABLE,
   GALFN_SETICONCOLORS,
   GALFN_SETICONPOSITION,
   GALFN_SETICONSHAPE64,

   GALFN_SETSOURCESTRIDE,
   GALFN_SETDESTINATIONSTRIDE,
   GALFN_SETSOURCETRANSPARENCY,
   GALFN_SETPATTERNORIGIN,
   GALFN_GFX2SETALPHAMODE,
   GALFN_GFX2SETALPHAVALUE,
   GALFN_GFX2PATTERNFILL,
   GALFN_GFX2COLORPATTERNFILL,
   GALFN_GFX2SCREENTOSCREENBLT,
   GALFN_GFX2MONOEXPANDBLT,
   GALFN_GFX2COLORBMPTOSCRBLT,
   GALFN_GFX2MONOBMPTOSCRBLT,
   GALFN_GFX2TEXTBLT,
   GALFN_GFX2BRESENHAMLINE,
   GALFN_GFX2SYNCTOVBLANK,

/* Change/Get Video routines */

   GALFN_SETCOLORSPACEYUV,
   GALFN_SETVIDEOYUVPITCH,
   GALFN_SETVIDEOYUVOFFSETS,
   GALFN_SETVIDEOLEFTCROP,
   GALFN_SETVIDEOVERTICALDOWNSCALE,
   GALFN_SETVBISOURCE,
   GALFN_SETVBILINES,
   GALFN_SETVBITOTAL,
   GALFN_SETVSCALEROFFSET,

   GALFN_GETVBISOURCE,
   GALFN_GETVBILINES,
   GALFN_GETVBITOTAL,
   GALFN_GETVSCALEROFFSET,
   GALFN_GETVIDEOINTERLACED,
   GALFN_GETCOLORSPACEYUV,
   GALFN_GETGENLOCKENABLE,
   GALFN_GETGENLOCKDELAY,
   GALFN_GETVIDEOCURSOR,
   GALFN_READCRC,
   GALFN_READWINDOWCRC,
   GALFN_GETMACROVISIONENABLE,
   GALFN_GETALPHAENABLE,
   GALFN_GETALPHASIZE,
   GALFN_GETALPHAVALUE,
   GALFN_GETALPHAPRIORITY,
   GALFN_GETALPHACOLOR,
   GALFN_GETVIDEOYUVPITCH,
   GALFN_GETVIDEOYUVOFFSETS,

/* Additional VGA Support functions */

   GALFN_VGATESTPCI,
   GALFN_VGAGETPCICOMMAND,
   GALFN_VGASEQRESET,
   GALFN_VGASETGRAPHICSBITS,

/* This is last function supported.
 * If you want to define ioctl function. 
 * You should define before this function.
 * Update that the lastfunction supported to new value.
 */
   GALFN_LASTFUNCTION_SUPPORTED
}
GALFN_CODES;

/* end of GAL function list */

#define GAL_HEADER\
        DWORD  dwSignature;    /* Sign all structs with FBGAL_SIGNATURE    */\
        DWORD  dwSize;         /* Size of struct for that subfunction      */\
        DWORD  dwVersion;      /* Current version of the API               */\
        DWORD  dwSubfunction;  /* GAL subfunction                          */\
        DWORD  dwReturnValue;           /* Return value from subfunction */

/*
 * #define GALFN_PNLPOWERUP
 * #define GALFN_PNLPOWERDOWN
 */
typedef struct __GAL_BASE
{
GAL_HEADER}
GAL_BASE, *PGAL_BASE;

/*
 * #define GALFN_GETADAPTERINFO
 */
typedef struct __GAL_GETADAPTERINFO
{
   GAL_HEADER DWORD dwCPUVersion;
   DWORD dwCPUType;
   DWORD dwFrameBufferBase;
   DWORD dwFrameBufferSize;
   DWORD dwGfxRegisterBase;
   DWORD dwGpsRegisterBase;
   DWORD dwVidRegisterBase;
   DWORD dwVipRegisterBase;
   DWORD dwVideoVersion;
   DWORD dwMaxSupportedPixelClock;

}
GAL_ADAPTERINFO, *PGAL_ADAPTERINFO;

#define GAL_SOFTVGASTATE_ENABLE   1
#define GAL_SOFTVGASTATE_DISABLE  0
/*
 * #define GALFN_SOFTVGASTATE
 */
typedef struct __GAL_SOFTVGASTATE
{
   GAL_HEADER BOOLEAN bSoftVgaEnable;

}
GAL_SOFTVGASTATE, *PGAL_SOFTVGASTATE;

/*
 * #define GALFN_WAITUNTILIDLE
 */
typedef struct __GAL_WAITUNTILIDLE
{
GAL_HEADER}
GAL_WAITUNTILIDLE, *PGAL_WAITUNTILIDLE;

/*
 * #define GALFN_WAITVERTICALBLANK
 */
typedef struct __GAL_WAITVERTICALBLANK
{
GAL_HEADER}
GAL_WAITVERTICALBLANK, *PGAL_WAITVERTICALBLANK;

#define GAL_REG 0x1
#define GAL_VID 0x2
#define GAL_VIP 0x4
/*
 * #define GALFN_WRITEREG
 * #define GALFN_READREG
 */
typedef struct __GAL_HWACCESS
{
   GAL_HEADER DWORD dwType;
   DWORD dwOffset;
   DWORD dwValue;
   DWORD dwByteCount;

}
GAL_HWACCESS, *PGAL_HWACCESS;

/*
 * #define GALFN_ISDISPLAYMODESUPPORTED
 * #define GALFN_SETDISPLAYMODE
 * #define GALFN_GETDISPLAYMODE
 */
typedef struct __GAL_DISPLAYMODE
{
   GAL_HEADER WORD wXres;
   WORD wYres;
   WORD wBpp;
   WORD wRefresh;
   DWORD dwSupported;

}
GAL_DISPLAYMODE, *PGAL_DISPLAYMODE;

/*
 * #define GALFN_SETBPP
 * #define GALFN_GETBPP
 * #define GALFN_SETPITCH                  
 * #define GALFN_GETPITCH                  
 * #define GALFN_SETOFFSET                 
 * #define GALFN_GETOFFSET                 
 */
typedef struct __GAL_DISPLAYPARAMS
{
   GAL_HEADER DWORD dwOffset;
   WORD wBpp;
   WORD wPitch;

}
GAL_DISPLAYPARAMS, *PGAL_DISPLAYPARAMS;

/*
 * #define GALFN_DOTCLKTOREFRESH
 */
typedef struct __GAL_DOTCLKTOREFRESH
{
   GAL_HEADER DWORD dwDotClock;
   WORD wXres;
   WORD wYres;
   WORD wBpp;
   WORD wRefreshRate;

}
GAL_DOTCLKTOREFRESH, *PGAL_DOTCLKTOREFRESH;

/*
 * #define GALFN_GETDISPLAYTIMINGS
 * #define GALFN_SETDISPLAYTIMINGS
 */
typedef struct __GAL_DISPLAYTIMING
{
   GAL_HEADER DWORD dwDotClock;
   WORD wPitch;
   WORD wBpp;
   WORD wHTotal;
   WORD wHActive;
   WORD wHSyncStart;
   WORD wHSyncEnd;
   WORD wHBlankStart;
   WORD wHBlankEnd;
   WORD wVTotal;
   WORD wVActive;
   WORD wVSyncStart;
   WORD wVSyncEnd;
   WORD wVBlankStart;
   WORD wVBlankEnd;
   WORD wPolarity;

}
GAL_DISPLAYTIMING, *PGAL_DISPLAYTIMING;

/*
 * #define GALFN_SETPALETTE_ENTRY
 * #define GALFN_GETPALETTE_ENTRY
 */
typedef struct __GAL_PALETTE_ENTRY
{
   GAL_HEADER DWORD dwIndex;
   DWORD dwPalette;
}
GAL_PALETTE_ENTRY, *PGAL_PALETTE_ENTRY;

/*
 * #define GALFN_SETPALETTE
 * #define GALFN_GETPALETTE
 */
typedef struct __GAL_PALETTE
{
   GAL_HEADER DWORD dwColors[256];
}
GAL_PALETTE, *PGAL_PALETTE;

/*
 * #define GALFN_COMPRESSIONSTATE  
 */
typedef struct __GAL_COMPRESSIONSTATE
{
   GAL_HEADER BOOLEAN bCompressionState;
}
GAL_COMPRESSIONSTATE, *PGAL_COMPRESSIONSTATE;

#define GAL_COMPRESSION_ENABLE   1
#define GAL_COMPRESSION_DISABLE  0

#define GAL_COMPRESSION_OFFSET  1
#define GAL_COMPRESSION_PITCH   2
#define GAL_COMPRESSION_SIZE    4
#define GAL_COMPRESSION_ALL     7

/*
 * #define GALFN_COMPRESSIONPARAMS
 */
typedef struct __GAL_COMPRESSIONPARAMS
{
   GAL_HEADER DWORD dwFlags;
   DWORD dwCompOffset;
   WORD dwCompPitch;
   WORD dwCompSize;
}
GAL_COMPRESSIONPARAMS, *PGAL_COMPRESSIONPARAMS;

#define GAL_SETCURSORENABLE_ENABLE    1
#define GAL_SETCURSORENABLE_DISABLE   0
/*
 * #define GALFN_CURSORENABLE
 */
typedef struct __GAL_CURSORENABLE
{
   GAL_HEADER BOOLEAN bCursorEnable;
}
GAL_CURSORENABLE, *PGAL_CURSORENABLE;

/*
 * #define GALFN_CURSORPOSITION
 */
typedef struct __GAL_CURSORPOSITION
{
   GAL_HEADER DWORD dwMemOffset;
   WORD wXPos;
   WORD wYPos;
   WORD wXHot;
   WORD wYHot;
}
GAL_CURSORPOSITION, *PGAL_CURSORPOSITION;

/*
 * #define GALFN_SETCURSORSHAPE
 */
typedef struct __GAL_SETCURSORSHAPE
{
   GAL_HEADER DWORD dwMemOffset;
   DWORD dwAndMask[32];                 /* Most gfx hardware support only 32x32 */
   DWORD dwXorMask[32];
}
GAL_SETCURSORSHAPE, *PGAL_SETCURSORSHAPE;

/*
 * #define GALFN_SETCURSORCOLORS
 */
typedef struct __GAL_CURSORCOLORS
{
   GAL_HEADER DWORD dwBgColor;
   DWORD dwFgColor;
}
GAL_CURSORCOLORS, *PGAL_CURSORCOLORS;

/*
 * #define GALFN_SETSOLIDPATTERN
 */
typedef struct __GAL_SETSOLIDPATTERN
{
   GAL_HEADER DWORD dwColor;
}
GAL_SETSOLIDPATTERN, *PGAL_SETSOLIDPATTERN;

/*
 * #define GALFN_SETRASTEROPERATION
 */
typedef struct __GAL_SETRASTEROPERATION
{
   GAL_HEADER CHAR cRop;
}
GAL_RASTEROPERATION, *PGAL_RASTEROPERATION;

/*
 * #define GALFN_SETSOLIDSOURCE
 */
typedef struct __GAL_SETSOLIDSOURCE
{
   GAL_HEADER DWORD dwColor;
}
GAL_SETSOLIDSOURCE, *PGAL_SETSOLIDSOURCE;

/*
 * #define GALFN_PATTERNFILL
 */
typedef struct __GAL_PATTERNFILL
{
   GAL_HEADER WORD wXPos;
   WORD wYPos;
   WORD wWidth;
   WORD wHeight;
}
GAL_PATTERNFILL, *PGAL_PATTERNFILL;

/*
 * #define GALFN_SETMONOSOURCE
 */
typedef struct __GAL_SETMONOSOURCE
{
   GAL_HEADER DWORD dwBgColor;
   DWORD dwFgColor;
   CHAR cTransparency;
}
GAL_SETMONOSOURCE, *PGAL_SETMONOSOURCE;

/*
 * #define GALFN_SETMONOPATTERN
 */
typedef struct __GAL_SETMONOPATTERN
{
   GAL_HEADER DWORD dwBgColor;
   DWORD dwFgColor;
   DWORD dwData0;
   DWORD dwData1;
   CHAR cTransparency;
}
GAL_SETMONOPATTERN, *PGAL_SETMONOPATTERN;

/*
 * #define GALFN_SCREENTOSCREENBLT
 */
typedef struct __GAL_SCREENTOSCREENBLT
{
   GAL_HEADER WORD wXStart;
   WORD wYStart;
   WORD wXEnd;
   WORD wYEnd;
   WORD wWidth;
   WORD wHeight;
}
GAL_SCREENTOSCREENBLT, *PGAL_SCREENTOSCREENBLT;

/*
 * #define GALFN_SCREENTOSCREENXBLT
 */
typedef struct __GAL_SCREENTOSCREENXBLT
{
   GAL_HEADER WORD wXStart;
   WORD wYStart;
   WORD wXEnd;
   WORD wYEnd;
   WORD wWidth;
   WORD wHeight;
   DWORD dwColor;
}
GAL_SCREENTOSCREENXBLT, *PGAL_SCREENTOSCREENXBLT;

/*
 * #define GALFN_BRESENHAMLINE
 */
typedef struct __GAL_BRESENHAMLINE
{
   GAL_HEADER WORD wX1;
   WORD wY1;
   WORD wLength;
   WORD wErr;
   WORD wE1;
   WORD wE2;
   WORD wFlags;
}
GAL_BRESENHAMLINE, *PGAL_BRESENHAMLINE;

/*
 * #define GALFN_COLOR_PATTERNFILL
 */
typedef struct __GAL_COLOR_PATTERNFILL
{
   GAL_HEADER WORD wDsty;
   WORD wDstx;
   WORD wWidth;
   WORD wHeight;
   DWORD dwPattern;
}
GAL_COLOR_PATTERNFILL, *PGAL_COLOR_PATTERNFILL;

/*
 * #define GALFN_COLOR_BITMAP_TO_SCREEN_BLT
 */
typedef struct __GAL_COLOR_BITMAP_TO_SCREEN_BLT
{
   GAL_HEADER WORD wSrcx;
   WORD wSrcy;
   WORD wDstx;
   WORD wDsty;
   WORD wWidth;
   WORD wHeight;
   DWORD dwData;
   WORD wPitch;
}
GAL_COLOR_BITMAP_TO_SCREEN_BLT, *PGAL_COLOR_BITMAP_TO_SCREEN_BLT;

/*
 * #define GALFN_COLOR_BITMAP_TO_SCREEN_XBLT
 */
typedef struct __GAL_COLOR_BITMAP_TO_SCREEN_XBLT
{
   GAL_HEADER WORD wSrcx;
   WORD wSrcy;
   WORD wDstx;
   WORD wDsty;
   WORD wWidth;
   WORD wHeight;
   DWORD dwData;
   WORD wPitch;
   DWORD dwColor;
}
GAL_COLOR_BITMAP_TO_SCREEN_XBLT, *PGAL_COLOR_BITMAP_TO_SCREEN_XBLT;

/*
 * #define GALFN_MONO_BITMAP_TO_SCREEN_BLT
 */
typedef struct __GAL_MONO_BITMAP_TO_SCREEN_BLT
{
   GAL_HEADER WORD wSrcx;
   WORD wSrcy;
   WORD wDstx;
   WORD wDsty;
   WORD wWidth;
   WORD wHeight;
   DWORD dwData;
   WORD wPitch;
}
GAL_MONO_BITMAP_TO_SCREEN_BLT, *PGAL_MONO_BITMAP_TO_SCREEN_BLT;

/*
 * #define GALFN_TEXT_BLT
 */
typedef struct __GAL_TEXT_BLT
{
   GAL_HEADER WORD wDstx;
   WORD wDsty;
   WORD wWidth;
   WORD wHeight;
   DWORD dwData;
}
GAL_TEXT_BLT, *PGAL_TEXT_BLT;

 /*
  * * #define GALFN_VGAMODESWITCH 
  * * #define GALFN_VGACLEARCRTEXT
  * * #define GALFN_VGASETPITCH   
  * * #define GALFN_VGARESTORE
  * * #define GALFN_VGASAVE   
  * * #define GALFN_VGASETMODE
  */

typedef struct __GAL_VGAREGS
{
   int xsize;
   int ysize;
   int hz;
   int clock;
   unsigned char miscOutput;
   unsigned char stdCRTCregs[GFX_STD_CRTC_REGS];
   unsigned char extCRTCregs[GFX_EXT_CRTC_REGS];
}
GAL_VGAREGS, *PGAL_VGAREGS;

typedef struct __GAL_VGAMODEDATA
{
   GAL_HEADER DWORD dwFlags;            /* Flags for this subfunction */
   GAL_VGAREGS sVgaRegs;                /* CRT+SEQ+SEQ register data block */
   WORD wXres;
   WORD wYres;
   WORD wBpp;
   WORD wRefresh;
}
GAL_VGAMODEDATA, *PGAL_VGAMODEDATA;

typedef struct __GAL_VGATESTPCI
{
   GAL_HEADER SWORD softvga;
}
GAL_VGATESTPCI, *PGAL_VGATESTPCI;

typedef struct __GAL_VGAGETPCICOMMAND
{
   GAL_HEADER unsigned char value;
}
GAL_VGAGETPCICOMMAND, *PGAL_VGAGETPCICOMMAND;

typedef struct __GAL_VGASEQRESET
{
   GAL_HEADER SWORD reset;
   SWORD statusok;
}
GAL_VGASEQRESET, *PGAL_VGASEQRESET;

typedef struct __GAL_VGASETGRAPHICSBITS
{
   GAL_HEADER SWORD statusok;
}
GAL_VGASETGRAPHICSBITS, *PGAL_VGASETGRAPHICSBITS;

/******** Panel Support functions *********************/
/*
* #define GALFN_PNLSETPARAMS
* #define GALFN_PNLGETPARAMS
* #define GALFN_PNLINITPANEL
* #define GALFN_PNLSAVESTATE
* #define GALFN_PNLRESTORESTATE
*/
typedef struct __GAL_PNLPARAMS
{
   GAL_HEADER Pnl_PanelParams PanelParams;
}
GAL_PNLPARAMS, *PGAL_PNLPARAMS;

/*
* #define GALFN_PNLBIOSENABLE
* #define GALFN_PNLBIOSINFO
*/
typedef struct __GAL_PNLBIOS
{
   GAL_HEADER int state;
   int XRes;
   int YRes;
   int Bpp;
   int Freq;
}
GAL_PNLBIOS, *PGAL_PNLBIOS;

typedef struct __GAL_ENABLEPANNING
{
   GAL_HEADER int x;
   int y;
}
GAL_ENABLEPANNING, *PGAL_ENABLEPANNING;

/*
 * #define GALFN_SETCRTENABLE
 * #define GALFN_GETCRTENABLE
 */
typedef struct __GAL_CRTENABLE
{
   GAL_HEADER WORD wCrtEnable;
}
GAL_CRTENABLE, *PGAL_CRTENABLE;

#define GAL_TVSTATE       0x01
#define GAL_TVOUTPUT      0x02
#define GAL_TVFORMAT      0x04
#define GAL_TVRESOLUTION  0x08
#define GAL_TVALL         0x0F
/*
 * #define GALFN_SETTVPARAMS
 * #define GALFN_GETTVPARAMS
 * #define GALFN_SETENABLE
 * #define GALFN_GETENABLE
 * #define GALFN_ISTVMODESUPPORTED
 */
typedef struct __GAL_TVPARAMS
{
   GAL_HEADER DWORD dwFlags;
   WORD wWidth;
   WORD wHeight;
   WORD wStandard;
   WORD wType;
   WORD wOutput;
   WORD wResolution;
   BOOLEAN bState;

}
GAL_TVPARAMS, *PGAL_TVPARAMS;

/*
 * #define GALFN_SETTVTIMING
 * #define GALFN_GETTVTIMING
 */
typedef struct __GAL_TVTIMING
{
   GAL_HEADER DWORD dwFlags;            /* not used currently */
   unsigned long HorzTim;
   unsigned long HorzSync;
   unsigned long VertSync;
   unsigned long LineEnd;
   unsigned long VertDownscale;
   unsigned long HorzScaling;
   unsigned long TimCtrl1;
   unsigned long TimCtrl2;
   unsigned long Subfreq;
   unsigned long DispPos;
   unsigned long DispSize;
   unsigned long Debug;
   unsigned long DacCtrl;
   unsigned long DotClock;
}
GAL_TVTIMING, *PGAL_TVTIMING;

/******** Video Support functions *********************/

typedef struct __GAL_SETVIDEOENABLE
{
   GAL_HEADER BOOLEAN enable;
}
GAL_VIDEOENABLE, *PGAL_VIDEOENABLE;

typedef struct __GAL_SETVIDEOFORMAT
{
   GAL_HEADER int format;
}
GAL_VIDEOFORMAT, *PGAL_VIDEOFORMAT;

typedef struct __GAL_SETVIDEOSIZE
{
   GAL_HEADER unsigned short width;
   unsigned short height;
}
GAL_VIDEOSIZE, *PGAL_VIDEOSIZE;

typedef struct __GAL_SETVIDEOOFFSET
{
   GAL_HEADER unsigned long offset;
}
GAL_VIDEOOFFSET, *PGAL_VIDEOOFFSET;

typedef struct __GAL_SETVIDEOWINDOW
{
   GAL_HEADER short x;
   short y;
   short w;
   short h;
}
GAL_VIDEOWINDOW, *PGAL_VIDEOWINDOW;

typedef struct __GAL_SETVIDEOSCALE
{
   GAL_HEADER unsigned short srcw;
   unsigned short srch;
   unsigned short dstw;
   unsigned short dsth;
}
GAL_VIDEOSCALE, *PGAL_VIDEOSCALE;

typedef struct __GAL_SETVIDEOFILTER
{
   GAL_HEADER int xfilter;
   int yfilter;
}
GAL_VIDEOFILTER, *PGAL_VIDEOFILTER;

typedef struct __GAL_SETVIDEOCOLORKEY
{
   GAL_HEADER unsigned long key;
   unsigned long mask;
   int bluescreen;
}
GAL_VIDEOCOLORKEY, *PGAL_VIDEOCOLORKEY;

typedef struct __GAL_SETVIDEODOWNSCALEENABLE
{
   GAL_HEADER int enable;
}
GAL_VIDEODOWNSCALEENABLE, *PGAL_VIDEODOWNSCALEENABLE;

typedef struct __GAL_SETVIDEODOWNSCALECONFIG
{
   GAL_HEADER unsigned short type;
   unsigned short m;
}
GAL_VIDEODOWNSCALECONFIG, *PGAL_VIDEODOWNSCALECONFIG;

typedef struct __GAL_SETVIDEODOWNSCALECOEFF
{
   GAL_HEADER unsigned short coef1;
   unsigned short coef2;
   unsigned short coef3;
   unsigned short coef4;
}
GAL_VIDEODOWNSCALECOEFF, *PGAL_VIDEODOWNSCALECOEFF;

#define GAL_VIDEO_SOURCE_MEMORY 0x0
#define GAL_VIDEO_SOURCE_DVIP   0x1
typedef struct __GAL_SETVIDEOSOURCE
{
   GAL_HEADER int source;
}
GAL_VIDEOSOURCE, *PGAL_VIDEOSOURCE;

typedef struct __GAL_SETVIDEOINTERLACED
{
   GAL_HEADER int enable;
}
GAL_SETVIDEOINTERLACED, *PGAL_SETVIDEOINTERLACED;

typedef struct __GAL_GETVIDEOINTERLACED
{
   GAL_HEADER int interlaced;
}
GAL_GETVIDEOINTERLACED, *PGAL_GETVIDEOINTERLACED;

typedef struct __GAL_COLORSPACEYUV
{
   GAL_HEADER int colorspace;
}
GAL_COLORSPACEYUV, *PGAL_COLORSPACEYUV;

typedef struct __GAL_SETGENLOCKENABLE
{
   GAL_HEADER int enable;
}
GAL_GENLOCKENABLE, *PGAL_GENLOCKENABLE;

typedef struct __GAL_SETGENLOCKDELAY
{
   GAL_HEADER int delay;
}
GAL_GENLOCKDELAY, *PGAL_GENLOCKDELAY;

typedef struct __GAL_SETTOPLINEINODD
{
   GAL_HEADER int enable;
}
GAL_TOPLINEINODD, *PGAL_TOPLINEINODD;

typedef struct __GAL_SETVIDEOCURSOR
{
   GAL_HEADER unsigned long key;
   unsigned long mask;
   unsigned short select_color2;
   unsigned long color1;
   unsigned long color2;
}
GAL_VIDEOCURSOR, *PGAL_VIDEOCURSOR;

typedef struct __GAL_READCRC
{
   GAL_HEADER DWORD crc;
}
GAL_READCRC, *PGAL_READCRC;

typedef struct __GAL_READWINDOWCRC
{
   GAL_HEADER SWORD source;
   WORD x;
   WORD y;
   WORD width;
   WORD height;
   SWORD crc32;
   DWORD crc;
}
GAL_READWINDOWCRC, *PGAL_READWINDOWCRC;

typedef struct __GAL_GETALPHASIZE
{
   GAL_HEADER WORD * x;
   WORD *y;
   WORD *width;
   WORD *height;
}
GAL_ALPHASIZE, *PGAL_ALPHASIZE;

typedef struct __GAL_SETMACROVISIONENABLE
{
   GAL_HEADER SWORD enable;
}
GAL_MACROVISIONENABLE, *PGAL_MACROVISIONENABLE;

typedef struct __GAL_SETVIDEOREQUEST
{
   GAL_HEADER short x;
   short y;
}
GAL_VIDEOREQUEST, *PGAL_VIDEOREQUEST;

typedef struct __GAL_ALPHAENABLE
{
   GAL_HEADER int enable;
}
GAL_ALPHAENABLE, *PGAL_ALPHAENABLE;

typedef struct __GAL_SETALPHAWINDOW
{
   GAL_HEADER short x;
   short y;
   unsigned short width;
   unsigned short height;
}
GAL_ALPHAWINDOW, *PGAL_ALPHAWINDOW;

typedef struct __GAL_ALPHAVALUE
{
   GAL_HEADER unsigned char alpha;
   char delta;
}
GAL_ALPHAVALUE, *PGAL_ALPHAVALUE;

typedef struct __GAL_ALPHAPRIORITY
{
   GAL_HEADER int priority;
}
GAL_ALPHAPRIORITY, *PGAL_ALPHAPRIORITY;

typedef struct __GAL_ALPHACOLOR
{
   GAL_HEADER unsigned long color;
}
GAL_ALPHACOLOR, *PGAL_ALPHACOLOR;

typedef struct __GAL_SETALPHAREGION
{
   GAL_HEADER int region;
}
GAL_ALPHAREGION, *PGAL_ALPHAREGION;

typedef struct __GAL_SETVIDEOOUTSIDEALPHA
{
   GAL_HEADER int enable;
}
GAL_VIDEOOUTSIDEALPHA, *PGAL_VIDEOOUTSIDEALPHA;

typedef struct __GAL_SETVIDEOPALETTE
{
   GAL_HEADER int identity;
   unsigned long palette[256];
}
GAL_VIDEOPALETTE, *PGAL_VIDEOPALETTE;

typedef struct __GAL_VIDEOINFO
{
   GAL_HEADER int enable;
   int format;
   int filter;

   unsigned long src_size;
   unsigned long dst_size;
   unsigned long line_size;
   unsigned long xclip;
   unsigned long offset;
   unsigned long scale;
   unsigned long position;

   int color_key_src;
   unsigned long color_key;
   unsigned long color_key_mask;

   int downscale_enable;

   unsigned short downscale_type;

   unsigned short downscale_mask;
   unsigned short downscale_coef1;
   unsigned short downscale_coef2;
   unsigned short downscale_coef3;
   unsigned short downscale_coef4;
}
GAL_VIDEOINFO, *PGAL_VIDEOINFO;

/* ICON related data strucures */
typedef struct __GAL_SETICONENABLE
{
   GAL_HEADER SWORD enable;
}
GAL_ICONENABLE, *PGAL_ICONENABLE;

typedef struct __GAL_SETICONCOLORS
{
   GAL_HEADER DWORD color0;
   DWORD color1;
   DWORD color2;
}
GAL_ICONCOLORS, *PGAL_ICONCOLORS;

typedef struct __GAL_SETICONPOSITION
{
   GAL_HEADER DWORD memoffset;
   WORD xpos;
}
GAL_ICONPOSITION, *PGAL_ICONPOSITION;

typedef struct __GAL_SETICONSHAPE64
{
   GAL_HEADER DWORD memoffset;
   DWORD *andmask;
   DWORD *xormask;
   DWORD lines;
}
GAL_ICONSHAPE64, *PGAL_ICONSHAPE64;

/* VIP related data strucures */

typedef struct __GAL_SETVIPENABLE
{
   GAL_HEADER SWORD enable;
}
GAL_VIPENABLE, *PGAL_VIPENABLE;

typedef struct __GAL_SETVIPCAPTURERUNMODE
{
   GAL_HEADER SWORD mode;
}
GAL_VIPCAPTURERUNMODE, *PGAL_VIPCAPTURERUNMODE;

typedef struct __GAL_SETVIPBASE
{
   GAL_HEADER DWORD even;
   DWORD odd;
   DWORD address;
}
GAL_VIPBASE, *PGAL_VIPBASE;

typedef struct __GAL_SETVIPPITCH
{
   GAL_HEADER DWORD pitch;
}
GAL_VIPPITCH, *PGAL_VIPPITCH;

typedef struct __GAL_SETVIPMODE
{
   GAL_HEADER SWORD mode;
}
GAL_VIPMODE, *PGAL_VIPMODE;

typedef struct __GAL_SETVIPBUS_RTH
{
   GAL_HEADER SWORD enable;
}
GAL_VIPBUS_RTH, *PGAL_VIPBUS_RTH;

typedef struct __GAL_SETVIPLASTLINE
{
   GAL_HEADER SWORD last_line;
}
GAL_VIPLASTLINE, *PGAL_VIPLASTLINE;

typedef struct __GAL_TESTVIPODDFIELD
{
   GAL_HEADER SWORD status;
}
GAL_TESTVIPODDFIELD, *PGAL_TESTVIPODDFIELD;

typedef struct __GAL_TESTVIPBASESUPDATED
{
   GAL_HEADER SWORD status;
}
GAL_TESTVIPBASESUPDATED, *PGAL_TESTVIPBASESUPDATED;

typedef struct __GAL_TESTVIPFIFOOVERFLOW
{
   GAL_HEADER SWORD status;
}
GAL_TESTVIPOVERFLOW, *PGAL_TESTVIPOVERFLOW;

typedef struct __GAL_GETVIPLINE
{
   GAL_HEADER SWORD status;
}
GAL_VIPLINE, *PGAL_VIPLINE;

/* VBI related data strucures */

typedef struct __GAL_VBIENABLE
{
   GAL_HEADER SWORD enable;
}
GAL_VBIENABLE, *PGAL_VBIENABLE;

typedef struct __GAL_VBIBASE
{
   GAL_HEADER DWORD even;
   DWORD odd;
   DWORD address;
}
GAL_VBIBASE, *PGAL_VBIBASE;

typedef struct __GAL_VBIPITCH
{
   GAL_HEADER DWORD pitch;
}
GAL_VBIPITCH, *PGAL_VBIPITCH;

typedef struct __GAL_VBIMODE
{
   GAL_HEADER SWORD mode;
}
GAL_VBIMODE, *PGAL_VBIMODE;

typedef struct __GAL_SETVBIDIRECT
{
   GAL_HEADER DWORD even_lines;
   DWORD odd_lines;
}
GAL_SETVBIDIRECT, *PGAL_SETVBIDIRECT;

typedef struct __GAL_GETVBIDIRECT
{
   GAL_HEADER SWORD odd;
   DWORD direct_lines;
}
GAL_GETVBIDIRECT, *PGAL_GETVBIDIRECT;

typedef struct __GAL_VBIINTERRUPT
{
   GAL_HEADER SWORD enable;
}
GAL_VBIINTERRUPT, *PGAL_VBIINTERRUPT;

/* Second generation rendering routines data structures */

typedef struct __GAL_SETSTRIDE
{
   GAL_HEADER WORD stride;
}
GAL_STRIDE, *PGAL_STRIDE;

typedef struct __GAL_SETPATTERNORIGIN
{
   GAL_HEADER int x;
   int y;
}
GAL_PATTERNORIGIN, *PGAL_PATTERNORIGIN;

typedef struct __GAL_SETSOURCETRANSPARENCY
{
   GAL_HEADER DWORD color;
   DWORD mask;
}
GAL_SOURCETRANSPARENCY, *PGAL_SOURCETRANSPARENCY;

typedef struct __GAL_GFX2SETALPHAMODE
{
   GAL_HEADER SWORD mode;
}
GAL_GFX2ALPHAMODE, *PGAL_GFX2ALPHAMODE;

typedef struct __GAL_GFX2SETALPHAVALUE
{
   GAL_HEADER CHAR value;
}
GAL_GFX2ALPHAVALUE, *PGAL_GFX2ALPHAVALUE;

typedef struct __GAL_GFX2PATTERNFILL
{
   GAL_HEADER DWORD dstoffset;
   WORD width;
   WORD height;
}
GAL_GFX2PATTERNFILL, *PGAL_GFX2PATTERNFILL;

typedef struct __GAL_GFX2COLORPATTERNFILL
{
   GAL_HEADER DWORD dstoffset;
   WORD width;
   WORD height;
   DWORD pattern;
}
GAL_GFX2COLORPATTERNFILL, *PGAL_GFX2COLORPATTERNFILL;

typedef struct __GAL_GFX2SCREENTOSCREENBLT
{
   GAL_HEADER DWORD srcoffset;
   DWORD dstoffset;
   WORD width;
   WORD height;
   SWORD flags;
}
GAL_GFX2SCREENTOSCREENBLT, *PGAL_GFX2SCREENTOSCREENBLT;

typedef struct __GAL_GFX2MONOEXPANDBLT
{
   GAL_HEADER unsigned long srcbase;
   WORD srcx;
   WORD srcy;
   DWORD dstoffset;
   WORD width;
   WORD height;
   WORD byte_packed;
}
GAL_GFX2MONOEXPANDBLT, *PGAL_GFX2MONOEXPANDBLT;

typedef struct __GAL_GFX2COLORBMPTOSCRBLT
{
   GAL_HEADER WORD srcx;
   WORD srcy;
   DWORD dstoffset;
   WORD width;
   WORD height;
   DWORD data;
   WORD pitch;
}
GAL_GFX2COLORBMPTOSCRBLT, *PGAL_GFX2COLORBMPTOSCRBLT;

typedef struct __GAL_GFX2MONOBMPTOSCRBLT
{
   GAL_HEADER WORD srcbase;
   WORD srcx;
   WORD srcy;
   DWORD dstoffset;
   WORD width;
   WORD height;
   DWORD data;
   WORD pitch;
}
GAL_GFX2MONOBMPTOSCRBLT, *PGAL_GFX2MONOBMPTOSCRBLT;

typedef struct __GAL_GFX2TEXTBLT
{
   GAL_HEADER DWORD dstoffset;
   WORD width;
   WORD height;
   DWORD data;
}
GAL_GFX2TEXTBLT, *PGAL_GFX2TEXTBLT;

typedef struct __GAL_GFX2BRESENHAMLINE
{
   GAL_HEADER DWORD dstoffset;
   WORD length;
   WORD initerr;
   WORD axialerr;
   WORD diagerr;
   WORD flags;
}
GAL_GFX2BRESENHAMLINE, *PGAL_GFX2BRESENHAMLINE;

typedef struct __GAL_GFX2SYNCTOVBLANK
{
GAL_HEADER}
GAL_GFX2SYNCTOVBLANK, *PGAL_GFX2SYNCTOVBLANK;

/*
 GALFN_SETVIDEOYUVPITCH
 */
typedef struct _GAL_SETVIDEOYUVPITCH
{
   GAL_HEADER unsigned long y_pitch;
   unsigned long uv_pitch;
}
GAL_VIDEOYUVPITCH, *PGAL_VIDEOYUVPITCH;

/*
  GALFN_SETVIDEOYUVOFFSETS
*/
typedef struct _GAL_VIDEOYUVOFFSETS
{
   GAL_HEADER unsigned long dwYoffset;
   unsigned long dwUoffset;
   unsigned long dwVoffset;
}
GAL_VIDEOYUVOFFSETS, *PGAL_VIDEOYUVOFFSETS;

typedef struct __GAL_SETVIDEOLEFTCROP
{
   GAL_HEADER WORD x;
   SWORD status;
}
GAL_VIDEOLEFTCROP, *PGAL_VIDEOLEFTCROP;

typedef struct __GAL_SETVIDEOVERTICALDOWNSCALE
{
   GAL_HEADER WORD srch;
   WORD dsth;
   SWORD status;
}
GAL_VIDEOVERTICALDOWNSCALE, *PGAL_VIDEOVERTICALDOWNSCALE;

typedef struct __GAL_VBISOURCE
{
   GAL_HEADER VideoSourceType source;
   SWORD status;
}
GAL_VBISOURCE, *PGAL_VBISOURCE;

typedef struct __GAL_VBILINES
{
   GAL_HEADER DWORD even;
   DWORD odd;
   SWORD status;
   DWORD lines;
}
GAL_VBILINES, *PGAL_VBILINES;

typedef struct __GAL_VBITOTAL
{
   GAL_HEADER DWORD even;
   DWORD odd;
   SWORD status;
   DWORD total;
}
GAL_VBITOTAL, *PGAL_VBITOTAL;

typedef struct __GAL_VSCALEROFFSET
{
   GAL_HEADER char offset;
   SWORD status;
}
GAL_VSCALEROFFSET, *PGAL_VSCALEROFFSET;

/* MSR  data strucures */

typedef struct __GAL_IDMSRDEVICE
{
   GAL_HEADER MSR * pDev;
   DWORD address;
   DEV_STATUS dev_status;
}
GAL_IDMSRDEVICE, *PGAL_IDMSRDEVICE;

typedef struct __GAL_GETMSRDEVADDRESS
{
   GAL_HEADER WORD device;
   unsigned long address;
   DEV_STATUS dev_status;
}
GAL_GETMSRDEVADDRESS, *PGAL_GETMSRDEVADDRESS;

typedef struct __GAL_GETMBUSIDATADDRESS
{
   GAL_HEADER unsigned int device;
   unsigned long address;
   DEV_STATUS dev_status;
}
GAL_GETMBUSIDATADDRESS, *PGAL_GETMBUSIDATADDRESS;

/* Gal device function's prototye declarations */

/** Init **********************************************************/
BOOLEAN Gal_initialize_interface(void);
BOOLEAN Gal_cleanup_interface(void);
BOOLEAN Gal_get_adapter_info(PGAL_ADAPTERINFO pAdapterInfo);
BOOLEAN Gal_set_softvga_state(BOOLEAN);
BOOLEAN Gal_get_softvga_state(int *bState);
BOOLEAN Gal_set_crt_enable(int);
BOOLEAN Gal_wait_until_idle(void);
BOOLEAN Gal_wait_vertical_blank(void);
BOOLEAN Gal_write_register(int type, unsigned long offset,
                           unsigned long value, int size);

BOOLEAN Gal_read_register(int type, unsigned long offset,
                          unsigned long *value, int size);
/** Display Engine ******************************************************/
BOOLEAN Gal_is_display_mode_supported(int xres, int yres, int bpp, int hz,
                                      int *supported);
BOOLEAN Gal_set_display_mode(int xres, int yres, int bpp, int hz);
BOOLEAN Gal_get_display_mode(int *xres, int *yres, int *bpp, int *hz);
BOOLEAN Gal_set_bpp(unsigned short bpp);
BOOLEAN Gal_set_display_bpp(unsigned short bpp);
BOOLEAN Gal_get_display_bpp(unsigned short *bpp);
BOOLEAN Gal_set_display_pitch(unsigned short pitch);
BOOLEAN Gal_get_display_pitch(unsigned short *pitch);
BOOLEAN Gal_set_display_offset(unsigned long offset);
BOOLEAN Gal_get_display_offset(unsigned long *offset);
BOOLEAN Gal_get_refreshrate_from_dotclock(int xres, int yres, int bpp,
                                          int *hz, unsigned long frequency);
BOOLEAN Gal_get_display_timing(PGAL_DISPLAYTIMING pDisplayTiming);
BOOLEAN Gal_set_display_timing(PGAL_DISPLAYTIMING pDisplayTiming);
BOOLEAN Gal_set_fixed_timings(int pnlXres, int pnlYres, int totXres,
                              int totYres, int bpp);
BOOLEAN Gal_set_display_palette_entry(unsigned long index,
                                      unsigned long palette);
BOOLEAN Gal_get_display_palette_entry(unsigned long index,
                                      unsigned long *palette);
BOOLEAN Gal_set_display_palette(PGAL_PALETTE);
BOOLEAN Gal_get_display_palette(PGAL_PALETTE);
BOOLEAN Gal_set_cursor_enable(int enable);
BOOLEAN Gal_get_cursor_enable(int *enable);
BOOLEAN Gal_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor);
BOOLEAN Gal_get_cursor_colors(unsigned long *bkcolor, unsigned long *fgcolor);
BOOLEAN Gal_set_cursor_position(unsigned long memoffset,
                                unsigned short xpos, unsigned short ypos,
                                unsigned short xhotspot,
                                unsigned short yhotspot);
BOOLEAN Gal_get_cursor_position(unsigned long *memoffset,
                                unsigned short *xpos, unsigned short *ypos,
                                unsigned short *xhotspot,
                                unsigned short *yhotspot);
BOOLEAN Gal_set_cursor_shape32(unsigned long memoffset,
                               unsigned long *andmask,
                               unsigned long *xormask);

BOOLEAN Gal_set_cursor_shape64(unsigned long memoffset,
                               unsigned long *andmask,
                               unsigned long *xormask);

/** Render ********************************************************/
BOOLEAN Gal_set_solid_pattern(unsigned long color);

BOOLEAN Gal_set_mono_source(unsigned long bgcolor, unsigned long fgcolor,
                            unsigned char transparency);
BOOLEAN Gal_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor,
                             unsigned long data0, unsigned long data1,
                             unsigned char transparency);

BOOLEAN Gal_set_raster_operation(unsigned char rop);

BOOLEAN Gal_pattern_fill(unsigned short x, unsigned short y,
                         unsigned short width, unsigned short height);

BOOLEAN Gal_set_solid_source(unsigned long color);

BOOLEAN Gal_screen_to_screen_blt(unsigned short srcx, unsigned short srcy,
                                 unsigned short dstx, unsigned short dsty,
                                 unsigned short width, unsigned short height);

BOOLEAN Gal_screen_to_screen_xblt(unsigned short srcx,
                                  unsigned short srcy,
                                  unsigned short dstx,
                                  unsigned short dsty,
                                  unsigned short width,
                                  unsigned short height, unsigned long color);

BOOLEAN Gal_bresenham_line(unsigned short x, unsigned short y,
                           unsigned short length, unsigned short initerr,
                           unsigned short axialerr, unsigned short diagerr,
                           unsigned short flags);

BOOLEAN Gal_color_pattern_fill(unsigned short x, unsigned short y,
                               unsigned short width, unsigned short height,
                               unsigned long pattern);

BOOLEAN Gal_color_bitmap_to_screen_blt(unsigned short srcx,
                                       unsigned short srcy,
                                       unsigned short dstx,
                                       unsigned short dsty,
                                       unsigned short width,
                                       unsigned short height,
                                       unsigned long data, long pitch);

BOOLEAN Gal_color_bitmap_to_screen_xblt(unsigned short srcx,
                                        unsigned short srcy,
                                        unsigned short dstx,
                                        unsigned short dsty,
                                        unsigned short width,
                                        unsigned short height,
                                        unsigned long data, long pitch,
                                        unsigned long color);

BOOLEAN Gal_mono_bitmap_to_screen_blt(unsigned short srcx,
                                      unsigned short srcy,
                                      unsigned short dstx,
                                      unsigned short dsty,
                                      unsigned short width,
                                      unsigned short height,
                                      unsigned long data, short pitch);

BOOLEAN Gal_text_blt(unsigned short dstx, unsigned short dsty,
                     unsigned short width, unsigned short height,
                     unsigned long data);

/** Compression*******************************************************/
BOOLEAN Gal_set_compression_enable(BOOLEAN);
BOOLEAN Gal_get_compression_enable(int *flag);
BOOLEAN Gal_set_compression_parameters(unsigned long flags,
                                       unsigned long offset,
                                       unsigned short pitch,
                                       unsigned short size);
BOOLEAN Gal_get_compression_parameters(unsigned long flags,
                                       unsigned long *offset,
                                       unsigned short *pitch,
                                       unsigned short *size);

/** VGA **********************************************************/
BOOLEAN Gal_vga_mode_switch(int active);
BOOLEAN Gal_vga_clear_extended(void);
BOOLEAN Gal_vga_pitch(PGAL_VGAMODEDATA pvregs, unsigned short pitch);
BOOLEAN Gal_vga_restore(PGAL_VGAMODEDATA pvregs);
BOOLEAN Gal_vga_save(PGAL_VGAMODEDATA pvregs);
BOOLEAN Gal_vga_mode(PGAL_VGAMODEDATA pvregs);
BOOLEAN Gal_vga_test_pci(int *softvga);
BOOLEAN Gal_vga_get_pci_command(unsigned char *value);
BOOLEAN Gal_vga_seq_reset(int reset);
BOOLEAN Gal_vga_set_graphics_bits(void);

/** Panel **********************************************************/
BOOLEAN Gal_pnl_set_params(unsigned long flags, PPnl_PanelParams pParam);
BOOLEAN Gal_pnl_get_params(unsigned long flags, PPnl_PanelParams pParam);
BOOLEAN Gal_pnl_init(PPnl_PanelParams pParam);
BOOLEAN Gal_pnl_save(void);
BOOLEAN Gal_pnl_restore(void);
BOOLEAN Gal_pnl_powerup(void);
BOOLEAN Gal_pnl_powerdown(void);
BOOLEAN Gal_enable_panning(int x, int y);
BOOLEAN Gal_pnl_enabled_in_bios(int *state);
BOOLEAN Gal_pnl_info_from_bios(int *xres, int *yres, int *bpp, int *hz);

/** TV **********************************************************/
BOOLEAN Gal_tv_set_params(unsigned long flags, PGAL_TVPARAMS pTV);
BOOLEAN Gal_tv_get_params(unsigned long flags, PGAL_TVPARAMS pTV);
BOOLEAN Gal_tv_set_timings(unsigned long flags, PGAL_TVTIMING pTV);
BOOLEAN Gal_tv_get_timings(unsigned long flags, PGAL_TVTIMING pTV);
BOOLEAN Gal_set_tv_enable(int bState);
BOOLEAN Gal_get_tv_enable(unsigned int *bState);
BOOLEAN Gal_is_tv_mode_supported(unsigned long flags, PGAL_TVPARAMS pTV,
                                 int *bState);

/** Video **********************************************************/
BOOLEAN Gal_set_video_enable(int enable);
BOOLEAN Gal_set_video_format(int format);
BOOLEAN Gal_set_video_size(unsigned short width, unsigned short height);
BOOLEAN Gal_set_video_offset(unsigned long offset);
BOOLEAN Gal_set_video_yuv_offsets(unsigned long yoffset,
                                  unsigned long uoffset,
                                  unsigned long voffset);
BOOLEAN Gal_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch);

BOOLEAN Gal_set_video_window(short x, short y, short w, short h);
BOOLEAN Gal_set_video_scale(unsigned short srcw, unsigned short srch,
                            unsigned short dstw, unsigned short dsth);
BOOLEAN Gal_set_video_filter(int xfilter, int yfilter);
BOOLEAN Gal_set_video_color_key(unsigned long key,
                                unsigned long mask, int bluescreen);
BOOLEAN Gal_set_video_downscale_enable(int enable);
BOOLEAN Gal_set_video_downscale_config(unsigned short type, unsigned short m);
BOOLEAN Gal_set_video_downscale_coefficients(unsigned short coef1,
                                             unsigned short coef2,
                                             unsigned short coef3,
                                             unsigned short coef4);
BOOLEAN Gal_set_video_source(int source);
BOOLEAN Gal_set_video_interlaced(int enable);
BOOLEAN Gal_get_video_interlaced(int *interlaced);
BOOLEAN Gal_set_color_space_YUV(int enable);
BOOLEAN Gal_get_color_space_YUV(int *colorspace);
BOOLEAN Gal_set_video_cursor(unsigned long key,
                             unsigned long mask,
                             unsigned short select_color2,
                             unsigned long color1, unsigned long color2);
BOOLEAN Gal_get_video_cursor(unsigned long *key,
                             unsigned long *mask,
                             unsigned short *select_color2,
                             unsigned long *color1, unsigned long *color2);
BOOLEAN Gal_set_video_request(short x, short y);
BOOLEAN Gal_set_alpha_enable(int enable);
BOOLEAN Gal_get_alpha_enable(int *enable);
BOOLEAN Gal_get_alpha_size(unsigned short *x, unsigned short *y,
                           unsigned short *width, unsigned short *height);

BOOLEAN Gal_set_video_request(short x, short y);
BOOLEAN Gal_set_alpha_window(short x, short y,
                             unsigned short width, unsigned short height);
BOOLEAN Gal_set_alpha_value(unsigned char alpha, char delta);
BOOLEAN Gal_get_alpha_value(unsigned char *alpha, char *delta);
BOOLEAN Gal_set_alpha_priority(int priority);
BOOLEAN Gal_get_alpha_priority(int *priority);
BOOLEAN Gal_set_alpha_color(unsigned long color);
BOOLEAN Gal_get_alpha_color(unsigned long *color);
BOOLEAN Gal_select_alpha_region(int region);
BOOLEAN Gal_set_video_outside_alpha(int enable);
BOOLEAN Gal_set_video_palette(unsigned long *palette);

/* Icon related prototypes */

BOOLEAN Gal_set_icon_enable(int enable);
BOOLEAN Gal_set_icon_colors(unsigned long color0, unsigned long color1,
                            unsigned long color2);

BOOLEAN Gal_set_icon_position(unsigned long memoffset, unsigned short xpos);
BOOLEAN Gal_set_icon_shape64(unsigned long memoffset, unsigned long *andmask,
                             unsigned long *xormask, unsigned int lines);

/* Icon related prototypes */

BOOLEAN Gal_set_vip_enable(int enable);
BOOLEAN Gal_get_vip_enable(int *enable);
BOOLEAN Gal_set_vip_capture_run_mode(int mode);
BOOLEAN Gal_set_vip_base(unsigned long even, unsigned long odd);
BOOLEAN Gal_get_vip_base(unsigned long *address, int odd);
BOOLEAN Gal_set_vip_pitch(unsigned long pitch);
BOOLEAN Gal_get_vip_pitch(unsigned long *pitch);
BOOLEAN Gal_set_vip_mode(int mode);
BOOLEAN Gal_get_vip_mode(int *mode);
BOOLEAN Gal_set_vbi_enable(int enable);
BOOLEAN Gal_get_vbi_enable(int *enable);
BOOLEAN Gal_set_vbi_mode(int mode);
BOOLEAN Gal_get_vbi_mode(int *mode);
BOOLEAN Gal_set_vbi_base(unsigned long even, unsigned long odd);
BOOLEAN Gal_get_vbi_base(unsigned long *address, int odd);
BOOLEAN Gal_set_vbi_pitch(unsigned long pitch);
BOOLEAN Gal_get_vbi_pitch(unsigned long *pitch);
BOOLEAN Gal_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines);
BOOLEAN Gal_get_vbi_direct(int odd, unsigned long *vbi_direct);
BOOLEAN Gal_set_vbi_interrupt(int enable);
BOOLEAN Gal_get_vbi_interrupt(int *enable);
BOOLEAN Gal_set_vip_bus_request_threshold_high(int enable);
BOOLEAN Gal_get_vip_bus_request_threshold_high(int *enable);
BOOLEAN Gal_set_vip_last_line(int last_line);
BOOLEAN Gal_test_vip_odd_field(int *status);
BOOLEAN Gal_test_vip_bases_updated(int *status);
BOOLEAN Gal_test_vip_fifo_overflow(int *status);
BOOLEAN Gal_get_vip_line(int *status);

/* Second generation rendering routines  */

BOOLEAN Gal_set_source_stride(unsigned short stride);
BOOLEAN Gal_set_destination_stride(unsigned short stride);
BOOLEAN Gal_set_source_transparency(unsigned long color, unsigned long mask);
BOOLEAN Gal2_set_source_transparency(unsigned long color, unsigned long mask);
BOOLEAN Gal2_set_source_stride(unsigned short stride);
BOOLEAN Gal2_set_destination_stride(unsigned short stride);
BOOLEAN Gal2_set_pattern_origin(int x, int y);
BOOLEAN Gal2_set_alpha_mode(int mode);
BOOLEAN Gal2_set_alpha_value(unsigned char value);
BOOLEAN Gal2_pattern_fill(unsigned long dstoffset, unsigned short width,
                          unsigned short height);
BOOLEAN Gal2_color_pattern_fill(unsigned long dstoffset, unsigned short width,
                                unsigned short height, unsigned long pattern);
BOOLEAN Gal2_screen_to_screen_blt(unsigned long srcoffset,
                                  unsigned long dstoffset,
                                  unsigned short width, unsigned short height,
                                  int flags);

BOOLEAN Gal2_mono_expand_blt(unsigned long srcbase, unsigned short srcx,
                             unsigned short srcy, unsigned long dstoffset,
                             unsigned short width, unsigned short height,
                             int byte_packed);

BOOLEAN Gal2_color_bitmap_to_screen_blt(unsigned short srcx,
                                        unsigned short srcy,
                                        unsigned long dstoffset,
                                        unsigned short width,
                                        unsigned short height,
                                        unsigned char *data,
                                        unsigned short pitch);
BOOLEAN Gal2_mono_bitmap_to_screen_blt(unsigned short srcx,
                                       unsigned short srcy,
                                       unsigned long dstoffset,
                                       unsigned short width,
                                       unsigned short height,
                                       unsigned char *data,
                                       unsigned short pitch);

BOOLEAN Gal2_text_blt(unsigned long dstoffset,
                      unsigned short width,
                      unsigned short height, unsigned long data);
BOOLEAN Gal2_bresenham_line(unsigned long dstoffset,
                            unsigned short length, unsigned short initerr,
                            unsigned short axialerr, unsigned short diagerr,
                            unsigned short flags);
BOOLEAN Gal2_sync_to_vblank(void);

/* Video routines */

BOOLEAN Gal_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch);
BOOLEAN Gal_get_video_yuv_pitch(unsigned long *ypitch,
                                unsigned long *uvpitch);

BOOLEAN Gal_set_video_yuv_offsets(unsigned long yoffset,
                                  unsigned long uoffset,
                                  unsigned long voffset);
BOOLEAN Gal_get_video_yuv_offsets(unsigned long *yoffset,
                                  unsigned long *uoffset,
                                  unsigned long *voffset);

BOOLEAN Gal_set_video_left_crop(unsigned short x);
BOOLEAN Gal_set_video_vertical_downscale(unsigned short srch,
                                         unsigned short dsth);

BOOLEAN Gal_set_vbi_source(VbiSourceType source);
BOOLEAN Gal_get_vbi_source(VbiSourceType * source);

BOOLEAN Gal_set_vbi_lines(unsigned long even, unsigned long odd);
BOOLEAN Gal_get_vbi_lines(int odd, unsigned long *lines);

BOOLEAN Gal_set_vbi_total(unsigned long even, unsigned long odd);
BOOLEAN Gal_get_vbi_total(int odd, unsigned long *total);

BOOLEAN Gal_set_vertical_scaler_offset(char offset);
BOOLEAN Gal_get_vertical_scaler_offset(char *offset);
BOOLEAN Gal_get_genlock_enable(int *enable);
BOOLEAN Gal_set_genlock_enable(int flags);
BOOLEAN Gal_get_genlock_delay(unsigned long *delay);
BOOLEAN Gal_set_genlock_delay(unsigned long delay);
BOOLEAN Gal_set_top_line_in_odd(int enable);

BOOLEAN Gal_read_crc(unsigned long *crc);
BOOLEAN Gal_read_window_crc(int source, unsigned short x, unsigned short y,
                            unsigned short width, unsigned short height,
                            int crc32, unsigned long *crc);

BOOLEAN Gal_set_macrovision_enable(int enable);
BOOLEAN Gal_get_macrovision_enable(int *enable);

/* MSR routines */

BOOLEAN Gal_id_msr_dev_address(MSR * pDev, unsigned long address);
BOOLEAN Gal_get_msr_dev_address(unsigned int device, unsigned long *address);

#endif