staging: xgifb: XGIfb_mode_rate_to_dclock: initialize ModeIdIndex properly
authorAaro Koskinen <aaro.koskinen@iki.fi>
Fri, 6 Apr 2012 22:13:50 +0000 (01:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Apr 2012 16:55:09 +0000 (09:55 -0700)
Initialize ModeIdIndex according to the selected video mode. Currently
index 0 is always used and wrong clock data may be used.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/XGI_main_26.c

index 50f5b9e..055acb3 100644 (file)
@@ -159,6 +159,8 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr,
        int Clock;
        InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
 
+       XGI_SearchModeID(ModeNo, &ModeIdIndex, XGI_Pr);
+
        RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo,
                        ModeIdIndex, XGI_Pr);