7 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10 #include <linux/module.h>
21 #define Index_CR_GPIO_Reg1 0x48
22 #define Index_CR_GPIO_Reg3 0x4a
24 #define GPIOG_EN (1<<6)
25 #define GPIOG_READ (1<<1)
27 static char *forcecrt2type;
30 static unsigned int refresh_rate;
35 static void dumpVGAReg(
void)
41 for (i = 0; i < 0x4f; i++) {
47 for (i = 0; i < 0xF0; i++) {
54 static inline void dumpVGAReg(
void)
61 static int XGIfb_mode_rate_to_dclock(
struct vb_device_info *XGI_Pr,
63 unsigned char modeno,
unsigned char rateindex)
65 unsigned short ModeNo = modeno;
66 unsigned short ModeIdIndex = 0, ClockIndex = 0;
67 unsigned short RefreshRateTableIndex = 0;
76 ClockIndex = XGI_Pr->
RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
78 Clock = XGI_Pr->
VCLKData[ClockIndex].CLOCK * 1000;
85 unsigned char modeno,
unsigned char rateindex,
86 u32 *left_margin,
u32 *right_margin,
u32 *upper_margin,
90 unsigned short ModeNo = modeno;
91 unsigned short ModeIdIndex,
index = 0;
92 unsigned short RefreshRateTableIndex = 0;
94 unsigned short VRE,
VBE, VRS, VBS,
VDE,
VT;
95 unsigned short HRE,
HBE, HRS, HBS,
HDE,
HT;
96 unsigned char sr_data, cr_data, cr_data2;
97 unsigned long cr_data3;
103 ModeIdIndex, XGI_Pr);
104 index = XGI_Pr->
RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
111 HT = (cr_data & 0xff) | ((
unsigned short) (sr_data & 0x03) << 8);
114 HDE = (XGI_Pr->
RefIndex[RefreshRateTableIndex].XRes >> 3) - 1;
120 HRS = (cr_data & 0xff) | ((
unsigned short) (sr_data & 0xC0) << 2);
126 HBS = (cr_data & 0xff) | ((
unsigned short) (sr_data & 0x30) << 4);
135 HBE = (cr_data & 0x1f) | ((
unsigned short) (cr_data2 & 0x80) >> 2)
136 | ((
unsigned short) (sr_data & 0x03) << 6);
139 HRE = (cr_data2 & 0x1f) | ((sr_data & 0x04) << 3);
141 temp = HBE - ((E - 1) & 255);
142 B = (temp > 0) ? temp : (temp + 256);
144 temp = HRE - ((E + F + 3) & 63);
145 C = (temp > 0) ? temp : (temp + 64);
149 *left_margin = D * 8;
150 *right_margin = F * 8;
160 VT = (cr_data & 0xFF) | ((
unsigned short) (cr_data2 & 0x01) << 8)
161 | ((
unsigned short) (cr_data2 & 0x20) << 4)
162 | ((
unsigned short) (sr_data & 0x01) << 10);
165 VDE = XGI_Pr->
RefIndex[RefreshRateTableIndex].YRes - 1;
171 VRS = (cr_data & 0xff) | ((
unsigned short) (cr_data2 & 0x04) << 6)
172 | ((
unsigned short) (cr_data2 & 0x80) << 2)
173 | ((
unsigned short) (sr_data & 0x08) << 7);
181 VBS = (cr_data & 0xff) | ((
unsigned short) (cr_data2 & 0x08) << 5)
182 | ((
unsigned short) (cr_data3 & 0x20) << 4)
183 | ((
unsigned short) (sr_data & 0x04) << 8);
188 VBE = (cr_data & 0xff) | ((
unsigned short) (sr_data & 0x10) << 4);
189 temp = VBE - ((E - 1) & 511);
190 B = (temp > 0) ? temp : (temp + 512);
195 VRE = (cr_data & 0x0f) | ((sr_data & 0x20) >> 1);
196 temp = VRE - ((E + F - 1) & 31);
197 C = (temp > 0) ? temp : (temp + 32);
205 if (XGI_Pr->
RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x8000)
210 if (XGI_Pr->
RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x4000)
216 if (XGI_Pr->
RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x0080)
222 XGI_Pr->
RefIndex[RefreshRateTableIndex].ModeID) {
236 static void XGIRegInit(
struct vb_device_info *XGI_Pr,
unsigned long BaseAddr)
238 XGI_Pr->
P3c4 = BaseAddr + 0x14;
239 XGI_Pr->
P3d4 = BaseAddr + 0x24;
240 XGI_Pr->
P3c0 = BaseAddr + 0x10;
241 XGI_Pr->
P3ce = BaseAddr + 0x1e;
242 XGI_Pr->
P3c2 = BaseAddr + 0x12;
243 XGI_Pr->
P3ca = BaseAddr + 0x1a;
244 XGI_Pr->
P3c6 = BaseAddr + 0x16;
245 XGI_Pr->
P3c7 = BaseAddr + 0x17;
246 XGI_Pr->
P3c8 = BaseAddr + 0x18;
247 XGI_Pr->
P3c9 = BaseAddr + 0x19;
248 XGI_Pr->
P3da = BaseAddr + 0x2A;
258 XGI_Pr->
Part5Port = BaseAddr + SIS_CRT2_PORT_14 + 2;
264 static int XGIfb_GetXG21DefaultLVDSModeIdx(
struct xgifb_video_info *xgifb_info)
268 while ((XGIbios_mode[i].mode_no != 0)
269 && (XGIbios_mode[i].xres <= xgifb_info->lvds_data.LVDSHDE)) {
270 if ((XGIbios_mode[i].xres == xgifb_info->
lvds_data.LVDSHDE)
271 && (XGIbios_mode[i].yres == xgifb_info->
lvds_data.LVDSVDE)
272 && (XGIbios_mode[i].bpp == 8)) {
289 if (
sscanf(name,
"%ux%ux%u", &xres, &yres, &bpp) != 3)
295 for (i = 0; XGIbios_mode[
i].mode_no != 0; i++)
296 if (XGIbios_mode[i].xres == xres &&
297 XGIbios_mode[i].yres == yres &&
298 XGIbios_mode[i].bpp == bpp) {
303 pr_info(
"Invalid mode '%s'\n", name);
307 unsigned int vesamode)
316 while (XGIbios_mode[i].mode_no != 0) {
317 if ((XGIbios_mode[i].vesa_mode_no_1 == vesamode) ||
318 (XGIbios_mode[i].vesa_mode_no_2 == vesamode)) {
326 pr_info(
"Invalid VESA mode 0x%x'\n", vesamode);
329 static int XGIfb_validate_mode(
struct xgifb_video_info *xgifb_info,
int myindex)
333 unsigned long required_mem;
339 if (XGIbios_mode[myindex].xres > xres)
341 if (XGIbios_mode[myindex].yres > yres)
343 if ((XGIbios_mode[myindex].xres < xres) &&
344 (XGIbios_mode[myindex].yres < yres)) {
345 if (XGIbios_mode[myindex].bpp > 8)
409 if (XGIbios_mode[myindex].xres > xres)
411 if (XGIbios_mode[myindex].yres > yres)
415 switch (XGIbios_mode[myindex].xres) {
417 if (XGIbios_mode[myindex].yres != 512)
423 if ((XGIbios_mode[myindex].yres != 400)
424 && (XGIbios_mode[myindex].yres
429 if (XGIbios_mode[myindex].yres != 600)
433 if ((XGIbios_mode[myindex].yres != 600) &&
434 (XGIbios_mode[myindex].yres != 768))
436 if ((XGIbios_mode[myindex].yres == 600) &&
441 if ((XGIbios_mode[myindex].yres) != 768)
447 if ((XGIbios_mode[myindex].yres != 768) &&
448 (XGIbios_mode[myindex].yres != 1024))
450 if ((XGIbios_mode[myindex].yres == 768) &&
455 if (XGIbios_mode[myindex].yres != 1050)
459 if (XGIbios_mode[myindex].yres != 1200)
466 switch (XGIbios_mode[myindex].xres) {
468 if (XGIbios_mode[myindex].yres != 512)
472 if ((XGIbios_mode[myindex].yres != 400) &&
473 (XGIbios_mode[myindex].yres != 480))
477 if (XGIbios_mode[myindex].yres != 600)
481 if (XGIbios_mode[myindex].yres != 768)
485 if ((XGIbios_mode[myindex].yres != 960) &&
486 (XGIbios_mode[myindex].yres != 1024))
488 if (XGIbios_mode[myindex].yres == 960) {
495 if (XGIbios_mode[myindex].yres != 1050)
499 if (XGIbios_mode[myindex].yres != 1200)
508 switch (XGIbios_mode[myindex].xres) {
515 if (XGIbios_mode[myindex].yres != 480)
518 if (XGIbios_mode[myindex].yres != 576)
529 if (XGIbios_mode[myindex].bpp == 32)
538 if (XGIbios_mode[myindex].xres > 1280)
546 required_mem = XGIbios_mode[myindex].xres * XGIbios_mode[myindex].yres *
547 XGIbios_mode[myindex].bpp / 8;
554 static void XGIfb_search_crt2type(
const char *name)
561 while (XGI_crt2type[i].type_no != -1) {
562 if (!
strcmp(name, XGI_crt2type[i].name)) {
563 XGIfb_crt2type = XGI_crt2type[
i].type_no;
564 XGIfb_tvplug = XGI_crt2type[
i].tvplug_no;
569 if (XGIfb_crt2type < 0)
570 pr_info(
"Invalid CRT2 type: %s\n", name);
579 xres = XGIbios_mode[xgifb_info->
mode_idx].xres;
580 yres = XGIbios_mode[xgifb_info->
mode_idx].yres;
583 while ((XGIfb_vrate[i].
idx != 0) && (XGIfb_vrate[i].xres <= xres)) {
584 if ((XGIfb_vrate[i].xres == xres) &&
585 (XGIfb_vrate[i].yres == yres)) {
586 if (XGIfb_vrate[i].refresh == rate) {
587 xgifb_info->
rate_idx = XGIfb_vrate[
i].idx;
589 }
else if (XGIfb_vrate[i].refresh > rate) {
590 if ((XGIfb_vrate[i].refresh - rate) <= 3) {
591 pr_debug(
"Adjusting rate from %d up to %d\n",
592 rate, XGIfb_vrate[i].refresh);
596 XGIfb_vrate[
i].refresh;
597 }
else if (((rate - XGIfb_vrate[i - 1].refresh)
598 <= 2) && (XGIfb_vrate[i].
idx
600 pr_debug(
"Adjusting rate from %d down to %d\n",
602 XGIfb_vrate[i-1].refresh);
604 XGIfb_vrate[i - 1].idx;
606 XGIfb_vrate[i - 1].refresh;
609 }
else if ((rate - XGIfb_vrate[i].refresh) <= 2) {
610 pr_debug(
"Adjusting rate from %d down to %d\n",
611 rate, XGIfb_vrate[i].refresh);
612 xgifb_info->
rate_idx = XGIfb_vrate[
i].idx;
621 pr_info(
"Unsupported rate %d for %dx%d\n",
627 static void XGIfb_search_tvstd(
const char *name)
634 while (XGI_tvtype[i].type_no != -1) {
635 if (!
strcmp(name, XGI_tvtype[i].name)) {
636 XGIfb_tvmode = XGI_tvtype[
i].type_no;
650 var->
red.offset = var->
green.offset = var->
blue.offset = 0;
651 var->
red.length = var->
green.length = var->
blue.length = 6;
655 var->
red.offset = 11;
657 var->
green.offset = 5;
658 var->
green.length = 6;
659 var->
blue.offset = 0;
660 var->
blue.length = 5;
666 var->
red.offset = 16;
668 var->
green.offset = 8;
669 var->
green.length = 8;
670 var->
blue.offset = 0;
671 var->
blue.length = 8;
683 u8 cr30 = 0, cr31 = 0;
731 unsigned char doit = 1;
754 if ((reg & 0x50) == 0x10)
762 if ((XGIfb_crt1off) && (doit))
780 filter_tb = (xgifb_info->
TV_type ==
784 filter_tb = (xgifb_info->
TV_type ==
788 filter_tb = (xgifb_info->
TV_type ==
792 filter_tb = (xgifb_info->
TV_type ==
924 pr_debug(
"FilterTable[%d]-%d: %*ph\n",
926 4, XGI_TV_filter[filter_tb].
931 (XGI_TV_filter[filter_tb].
936 (XGI_TV_filter[filter_tb].
941 (XGI_TV_filter[filter_tb].
946 (XGI_TV_filter[filter_tb].
962 #if defined(__powerpc__)
965 unsigned int drate = 0, hrate = 0;
978 if (!htotal || !vtotal) {
979 pr_debug(
"Invalid 'var' information\n");
981 }
pr_debug(
"var->pixclock=%d, htotal=%d, vtotal=%d\n",
984 if (var->
pixclock && htotal && vtotal) {
986 hrate = (drate * 1000) / htotal;
993 pr_debug(
"Change mode to %dx%dx%d-%dHz\n",
1002 while ((XGIbios_mode[xgifb_info->
mode_idx].mode_no != 0) &&
1003 (XGIbios_mode[xgifb_info->
mode_idx].xres <= var->
xres)) {
1004 if ((XGIbios_mode[xgifb_info->
mode_idx].xres == var->
xres) &&
1005 (XGIbios_mode[xgifb_info->
mode_idx].yres == var->
yres) &&
1006 (XGIbios_mode[xgifb_info->
mode_idx].bpp
1015 xgifb_info->
mode_idx = XGIfb_validate_mode(xgifb_info,
1021 pr_err(
"Mode %dx%dx%d not supported\n",
1027 if (XGIfb_search_refresh_rate(xgifb_info,
1035 XGIfb_pre_setmode(xgifb_info);
1037 XGIbios_mode[xgifb_info->
mode_idx].mode_no)
1039 pr_err(
"Setting mode[0x%x] failed\n",
1040 XGIbios_mode[xgifb_info->
mode_idx].mode_no);
1043 info->
fix.line_length = ((info->
var.xres_virtual
1044 * info->
var.bits_per_pixel) >> 6);
1051 (info->
fix.line_length & 0xff00) >> 8);
1053 XGIfb_post_setmode(xgifb_info);
1055 pr_debug(
"Set new mode: %dx%dx%d-%d\n",
1056 XGIbios_mode[xgifb_info->
mode_idx].xres,
1057 XGIbios_mode[xgifb_info->
mode_idx].yres,
1058 XGIbios_mode[xgifb_info->
mode_idx].bpp,
1064 XGIbios_mode[xgifb_info->
mode_idx].xres;
1067 XGIbios_mode[xgifb_info->
mode_idx].yres;
1076 #if defined(__powerpc__)
1084 #if defined(__powerpc__)
1094 #if defined(__powerpc__)
1101 pr_err(
"Unsupported depth %d\n",
1106 XGIfb_bpp_to_var(xgifb_info, var);
1120 switch (info->
var.bits_per_pixel) {
1148 ((base >> 24) & 0x01) << 7);
1153 static int XGIfb_open(
struct fb_info *info,
int user)
1158 static int XGIfb_release(
struct fb_info *info,
int user)
1181 static int XGIfb_setcolreg(
unsigned regno,
unsigned red,
unsigned green,
1186 if (regno >= XGIfb_get_cmap_len(&info->
var))
1189 switch (info->
var.bits_per_pixel) {
1204 | ((green & 0xfc00) >> 5) | ((blue & 0xf800)
1258 static int XGIfb_set_par(
struct fb_info *info)
1262 err = XGIfb_do_set_var(&info->
var, 1, info);
1265 XGIfb_get_fix(&info->
fix, -1, info);
1274 unsigned int vtotal = 0;
1275 unsigned int drate = 0, hrate = 0;
1294 if (!(htotal) || !(vtotal)) {
1295 pr_debug(
"No valid timing data\n");
1299 if (var->
pixclock && htotal && vtotal) {
1300 drate = 1000000000 / var->
pixclock;
1301 hrate = (drate * 1000) / htotal;
1303 (
unsigned int) (hrate * 2 / vtotal);
1305 "%s: pixclock = %d ,htotal=%d, vtotal=%d\n"
1306 "%s: drate=%d, hrate=%d, refresh_rate=%d\n",
1307 __func__, var->
pixclock, htotal, vtotal,
1314 if ((var->
xres == 1024) && (var->
yres == 600))
1318 while ((XGIbios_mode[search_idx].mode_no != 0) &&
1319 (XGIbios_mode[search_idx].xres <= var->xres)) {
1320 if ((XGIbios_mode[search_idx].xres == var->
xres) &&
1321 (XGIbios_mode[search_idx].yres == var->
yres) &&
1323 if (XGIfb_validate_mode(xgifb_info, search_idx) > 0) {
1333 pr_err(
"%dx%dx%d is no valid mode\n",
1336 while (XGIbios_mode[search_idx].mode_no != 0) {
1337 if ((var->
xres <= XGIbios_mode[search_idx].xres) &&
1338 (var->
yres <= XGIbios_mode[search_idx].yres) &&
1340 XGIbios_mode[search_idx].bpp)) {
1341 if (XGIfb_validate_mode(xgifb_info,
1350 var->
xres = XGIbios_mode[search_idx].xres;
1351 var->
yres = XGIbios_mode[search_idx].yres;
1352 pr_debug(
"Adapted to mode %dx%dx%d\n",
1356 pr_err(
"Failed to find similar mode to %dx%dx%d\n",
1363 XGIfb_bpp_to_var(xgifb_info, var);
1386 var->
red.msb_right =
1387 var->
green.msb_right =
1388 var->
blue.msb_right =
1399 if (var->
xoffset > (info->
var.xres_virtual - info->
var.xres))
1401 if (var->
yoffset > (info->
var.yres_virtual - info->
var.yres))
1408 }
else if (var->
xoffset + info->
var.xres > info->
var.xres_virtual
1410 > info->
var.yres_virtual) {
1413 err = XGIfb_pan_var(var, info);
1427 static int XGIfb_blank(
int blank,
struct fb_info *info)
1445 static struct fb_ops XGIfb_ops = {
1447 .fb_open = XGIfb_open,
1448 .fb_release = XGIfb_release,
1449 .fb_check_var = XGIfb_check_var,
1450 .fb_set_par = XGIfb_set_par,
1451 .fb_setcolreg = XGIfb_setcolreg,
1452 .fb_pan_display = XGIfb_pan_display,
1453 .fb_blank = XGIfb_blank,
1509 tmp = (reg & 0x0c) >> 2;
1510 switch (xgifb_info->
chip) {
1537 pr_info(
"SR14=%x DramSzie %x ChannelNum %x\n",
1552 if ((cr32 &
SIS_CRT1) && !XGIfb_crt1off)
1572 if (XGIfb_tvplug != -1)
1574 xgifb_info->
TV_plug = XGIfb_tvplug;
1585 if (xgifb_info->
TV_type == 0) {
1594 if (XGIfb_forcecrt1 != -1) {
1595 if (XGIfb_forcecrt1)
1607 switch (vb_chipid) {
1625 if (!XGIfb_has_VB(xgifb_info)) {
1640 static int __init xgifb_optval(
char *fullopt,
int validx)
1644 if (kstrtoul(fullopt + validx, 0, &lres) < 0 || lres >
INT_MAX) {
1645 pr_err(
"Invalid value for option: %s\n", fullopt);
1655 if (!options || !*options)
1658 pr_info(
"Options: %s\n", options);
1660 while ((this_opt =
strsep(&options,
",")) !=
NULL) {
1665 if (!
strncmp(this_opt,
"mode:", 5)) {
1666 mode = this_opt + 5;
1667 }
else if (!
strncmp(this_opt,
"vesa:", 5)) {
1668 vesa = xgifb_optval(this_opt, 5);
1669 }
else if (!
strncmp(this_opt,
"vrate:", 6)) {
1670 refresh_rate = xgifb_optval(this_opt, 6);
1671 }
else if (!
strncmp(this_opt,
"rate:", 5)) {
1672 refresh_rate = xgifb_optval(this_opt, 5);
1673 }
else if (!
strncmp(this_opt,
"crt1off", 7)) {
1675 }
else if (!
strncmp(this_opt,
"filter:", 7)) {
1676 filter = xgifb_optval(this_opt, 7);
1677 }
else if (!
strncmp(this_opt,
"forcecrt2type:", 14)) {
1678 XGIfb_search_crt2type(this_opt + 14);
1679 }
else if (!
strncmp(this_opt,
"forcecrt1:", 10)) {
1680 XGIfb_forcecrt1 = xgifb_optval(this_opt, 10);
1681 }
else if (!
strncmp(this_opt,
"tvmode:", 7)) {
1682 XGIfb_search_tvstd(this_opt + 7);
1683 }
else if (!
strncmp(this_opt,
"tvstandard:", 11)) {
1684 XGIfb_search_tvstd(this_opt + 7);
1685 }
else if (!
strncmp(this_opt,
"dstn", 4)) {
1689 }
else if (!
strncmp(this_opt,
"noypan", 6)) {
1707 unsigned long video_size_max;
1713 xgifb_info = fb_info->
par;
1714 hw_info = &xgifb_info->
hw_info;
1717 pci_read_config_byte(pdev,
1733 dev_info(&pdev->
dev,
"Relocate IO address: %Lx [%08lx]\n",
1742 if (XGIfb_crt2type != -1) {
1743 xgifb_info->
display2 = XGIfb_crt2type;
1758 switch (xgifb_info->
chip_id) {
1784 if (XGIfb_get_dram_size(xgifb_info)) {
1787 }
else if (xgifb_info->
video_size > video_size_max) {
1803 dev_err(&pdev->
dev,
"Unable request memory size %x\n",
1806 "Fatal error: Unable to reserve frame buffer memory. "
1807 "Is there another framebuffer driver active?\n");
1816 "Fatal error: Unable to reserve MMIO region\n");
1827 "Framebuffer at 0x%Lx, mapped to 0x%p, size %dk\n",
1833 "MMIO at 0x%Lx, mapped to 0x%p, size %ldk\n",
1837 pci_set_drvdata(pdev, xgifb_info);
1839 dev_err(&pdev->
dev,
"XGIInitNew() failed!\n");
1841 xgifb_info->
mtrr = (
unsigned int) 0;
1847 }
else if (xgifb_info->
chip ==
XG21) {
1849 if ((CR38&0xE0) == 0xC0)
1851 else if ((CR38&0xE0) == 0x60)
1856 XGIfb_get_VB_type(xgifb_info);
1863 switch (xgifb_info->
hasVB) {
1869 "XGI302LV bridge detected (revision 0x%02x)\n",
1871 }
else if (reg >= 0xD0) {
1874 "XGI301LV bridge detected (revision 0x%02x)\n",
1886 "XGI302LV bridge detected (revision 0x%02x)\n",
1888 }
else if (reg >= 0xD0) {
1891 "XGI302LV bridge detected (revision 0x%02x)\n",
1893 }
else if (reg >= 0xB0) {
1905 dev_info(&pdev->
dev,
"LVDS transmitter detected\n");
1909 dev_info(&pdev->
dev,
"Trumpion Zurac LVDS scaler detected\n");
1913 dev_info(&pdev->
dev,
"Chrontel TV encoder detected\n");
1918 "LVDS transmitter and Chrontel TV encoder detected\n");
1921 dev_info(&pdev->
dev,
"No or unknown bridge type detected\n");
1926 XGIfb_detect_VB(xgifb_info);
1941 XGIfb_search_mode(xgifb_info,
mode);
1942 else if (vesa != -1)
1943 XGIfb_search_vesamode(xgifb_info, vesa);
1947 XGIfb_validate_mode(xgifb_info, xgifb_info->
mode_idx);
1953 XGIfb_GetXG21DefaultLVDSModeIdx(xgifb_info);
1959 dev_err(&pdev->
dev,
"No supported video mode found\n");
1967 if (XGIfb_search_refresh_rate(xgifb_info,
1976 XGIbios_mode[xgifb_info->
mode_idx].xres;
1979 XGIbios_mode[xgifb_info->
mode_idx].yres;
2002 pr_info(
"Unsupported depth %d\n",
2007 pr_info(
"Default mode is %dx%dx%d (%dHz)\n",
2013 fb_info->
var.red.length = 8;
2014 fb_info->
var.green.length = 8;
2015 fb_info->
var.blue.length = 8;
2017 fb_info->
var.height = -1;
2018 fb_info->
var.width = -1;
2026 XGIfb_bpp_to_var(xgifb_info, &fb_info->
var);
2028 fb_info->
var.pixclock = (
u32) (1000000000 /
2029 XGIfb_mode_rate_to_dclock(&xgifb_info->
dev_info,
2031 XGIbios_mode[xgifb_info->
mode_idx].mode_no,
2034 if (XGIfb_mode_rate_to_ddata(&xgifb_info->
dev_info, hw_info,
2035 XGIbios_mode[xgifb_info->
mode_idx].mode_no,
2037 &fb_info->
var.left_margin,
2038 &fb_info->
var.right_margin,
2039 &fb_info->
var.upper_margin,
2040 &fb_info->
var.lower_margin,
2041 &fb_info->
var.hsync_len,
2042 &fb_info->
var.vsync_len,
2044 &fb_info->
var.vmode)) {
2048 fb_info->
var.yres <<= 1;
2049 fb_info->
var.yres_virtual <<= 1;
2052 fb_info->
var.pixclock >>= 1;
2053 fb_info->
var.yres >>= 1;
2054 fb_info->
var.yres_virtual >>= 1;
2061 fb_info->
fbops = &XGIfb_ops;
2062 XGIfb_get_fix(&fb_info->
fix, -1, fb_info);
2070 if (xgifb_info->
mtrr >= 0)
2085 if (xgifb_info->
mtrr >= 0)
2109 struct fb_info *fb_info = xgifb_info->
fb_info;
2113 if (xgifb_info->
mtrr >= 0)
2123 pci_set_drvdata(pdev,
NULL);
2128 .id_table = xgifb_pci_table,
2129 .probe = xgifb_probe,
2141 "Selects the desired default display mode in the format XxYxDepth "
2142 "(eg. 1024x768x16).");
2146 "Force the second display output type. Possible values are NONE, "
2147 "LCD, TV, VGA, SVIDEO or COMPOSITE.");
2151 "Selects the desired default display mode by VESA mode number "
2156 "Selects TV flicker filter type (only for systems with a SiS301 video bridge). "
2157 "Possible values 0-7. Default: [no filter]).");
2159 static int __init xgifb_init(
void)
2163 if (forcecrt2type !=
NULL)
2164 XGIfb_search_crt2type(forcecrt2type);
2167 XGIfb_setup(option);
2169 return pci_register_driver(&xgifb_driver);
2172 static void __exit xgifb_remove_module(
void)