Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 051ff1bb authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman
Browse files

staging: xgifb: XGIfb_mode_rate_to_ddata: initialize ModeIdIndex properly



Initialize ModeIdIndex according to the selected video mode. Currently
index 0 is always used and wrong video mode data may be used.

Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3a05de33
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -190,7 +190,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
		u32 *vmode)
		u32 *vmode)
{
{
	unsigned short ModeNo = modeno;
	unsigned short ModeNo = modeno;
	unsigned short ModeIdIndex = 0, index = 0;
	unsigned short ModeIdIndex, index = 0;
	unsigned short RefreshRateTableIndex = 0;
	unsigned short RefreshRateTableIndex = 0;


	unsigned short VRE, VBE, VRS, VBS, VDE, VT;
	unsigned short VRE, VBE, VRS, VBS, VDE, VT;
@@ -199,6 +199,8 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
	unsigned long cr_data3;
	unsigned long cr_data3;
	int A, B, C, D, E, F, temp, j;
	int A, B, C, D, E, F, temp, j;
	InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
	InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
	if (!XGI_SearchModeID(ModeNo, &ModeIdIndex, XGI_Pr))
		return 0;
	RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo,
	RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo,
			ModeIdIndex, XGI_Pr);
			ModeIdIndex, XGI_Pr);
	index = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
	index = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;