staging: xgifb: enable forcecrt2type on XG21
Make "forcecrt2type" to apply also for XG21. The patch enables user to switch LVDS LCD ON/OFF without the need to update the video BIOS. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
776091018b
commit
25aa75f142
@ -1744,17 +1744,16 @@ static void XGIfb_detect_VB(struct xgifb_video_info *xgifb_info)
|
|||||||
XGIfb_crt1off = 0;
|
XGIfb_crt1off = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XGIfb_crt2type != -1)
|
if (!xgifb_info->display2_force) {
|
||||||
/* TW: Override with option */
|
if (cr32 & XGI_VB_TV)
|
||||||
xgifb_info->display2 = XGIfb_crt2type;
|
xgifb_info->display2 = XGIFB_DISP_TV;
|
||||||
else if (cr32 & XGI_VB_TV)
|
else if (cr32 & XGI_VB_LCD)
|
||||||
xgifb_info->display2 = XGIFB_DISP_TV;
|
xgifb_info->display2 = XGIFB_DISP_LCD;
|
||||||
else if (cr32 & XGI_VB_LCD)
|
else if (cr32 & XGI_VB_CRT2)
|
||||||
xgifb_info->display2 = XGIFB_DISP_LCD;
|
xgifb_info->display2 = XGIFB_DISP_CRT;
|
||||||
else if (cr32 & XGI_VB_CRT2)
|
else
|
||||||
xgifb_info->display2 = XGIFB_DISP_CRT;
|
xgifb_info->display2 = XGIFB_DISP_NONE;
|
||||||
else
|
}
|
||||||
xgifb_info->display2 = XGIFB_DISP_NONE;
|
|
||||||
|
|
||||||
if (XGIfb_tvplug != -1)
|
if (XGIfb_tvplug != -1)
|
||||||
/* PR/TW: Override with option */
|
/* PR/TW: Override with option */
|
||||||
@ -1926,6 +1925,11 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (XGIfb_crt2type != -1) {
|
||||||
|
xgifb_info->display2 = XGIfb_crt2type;
|
||||||
|
xgifb_info->display2_force = true;
|
||||||
|
}
|
||||||
|
|
||||||
XGIRegInit(&xgifb_info->dev_info, (unsigned long)hw_info->pjIOAddress);
|
XGIRegInit(&xgifb_info->dev_info, (unsigned long)hw_info->pjIOAddress);
|
||||||
|
|
||||||
xgifb_reg_set(XGISR, IND_XGI_PASSWORD, XGI_PASSWORD);
|
xgifb_reg_set(XGISR, IND_XGI_PASSWORD, XGI_PASSWORD);
|
||||||
@ -2104,6 +2108,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
|
|||||||
|
|
||||||
if (xgifb_info->hasVB != HASVB_NONE)
|
if (xgifb_info->hasVB != HASVB_NONE)
|
||||||
XGIfb_detect_VB(xgifb_info);
|
XGIfb_detect_VB(xgifb_info);
|
||||||
|
else if (xgifb_info->chip != XG21)
|
||||||
|
xgifb_info->display2 = XGIFB_DISP_NONE;
|
||||||
|
|
||||||
if (xgifb_info->display2 == XGIFB_DISP_LCD) {
|
if (xgifb_info->display2 == XGIFB_DISP_LCD) {
|
||||||
if (!enable_dstn) {
|
if (!enable_dstn) {
|
||||||
|
@ -86,6 +86,7 @@ struct xgifb_video_info {
|
|||||||
unsigned int refresh_rate;
|
unsigned int refresh_rate;
|
||||||
|
|
||||||
enum xgifb_display_type display2; /* the second display output type */
|
enum xgifb_display_type display2; /* the second display output type */
|
||||||
|
bool display2_force;
|
||||||
unsigned char hasVB;
|
unsigned char hasVB;
|
||||||
unsigned char TV_type;
|
unsigned char TV_type;
|
||||||
unsigned char TV_plug;
|
unsigned char TV_plug;
|
||||||
|
@ -1136,7 +1136,13 @@ static void xgifb_read_vbios(struct pci_dev *pdev,
|
|||||||
}
|
}
|
||||||
if (vbios_size <= 0x65)
|
if (vbios_size <= 0x65)
|
||||||
goto error;
|
goto error;
|
||||||
if (!(vbios[0x65] & 0x1)) {
|
/*
|
||||||
|
* The user can ignore the LVDS bit in the BIOS and force the display
|
||||||
|
* type.
|
||||||
|
*/
|
||||||
|
if (!(vbios[0x65] & 0x1) &&
|
||||||
|
(!xgifb_info->display2_force ||
|
||||||
|
xgifb_info->display2 != XGIFB_DISP_LCD)) {
|
||||||
vfree(vbios);
|
vfree(vbios);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user