viafb: reduce viafb_set_iga_path usage
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Tue, 10 Aug 2010 00:45:06 +0000 (00:45 +0000)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Fri, 24 Sep 2010 02:14:48 +0000 (02:14 +0000)
The result of viafb_set_iga_path can change after init only in the
hotplug ioctl. So we can move it there rather than doing it always
when a new mode is set. The setup during init is done via a call
from the init chip funtion.
This change enables a stable mapping between the old device scheme
and a new more powerfull one.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
drivers/video/via/hw.c
drivers/video/via/ioctl.c

index 4407943fa7d7d46590743d94b33f636a7e280fab..638cf96c87397a1e92fb480ea5c8e848155fe8a9 100644 (file)
@@ -2313,7 +2313,6 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
                via_write_reg(VIASR, i, VPIT.SR[i - 1]);
 
        viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2);
-       viafb_set_iga_path();
 
        /* Write CRTC */
        viafb_fill_crtc_timing(crt_timing, vmode_tbl, video_bpp / 8, IGA1);
index 4d553d0b8d7a450b9337a9b4375856c5b304217c..ea1c51428823e3bdc14e73bfaefa42dac283b0af 100644 (file)
@@ -94,6 +94,7 @@ int viafb_ioctl_hotplug(int hres, int vres, int bpp)
                                viafb_CRT_ON = 0;
                                viafb_LCD_ON = 0;
                                viafb_DeviceStatus = DVI_Device;
+                               viafb_set_iga_path();
                                return viafb_DeviceStatus;
                        }
                        status = 1;
@@ -107,6 +108,7 @@ int viafb_ioctl_hotplug(int hres, int vres, int bpp)
                viafb_LCD_ON = 0;
 
                viafb_DeviceStatus = CRT_Device;
+               viafb_set_iga_path();
                return viafb_DeviceStatus;
        }