]> git.karo-electronics.de Git - linux-beck.git/commitdiff
viafb: add X server compatibility mode
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sat, 23 Apr 2011 23:52:45 +0000 (23:52 +0000)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sat, 23 Apr 2011 23:52:45 +0000 (23:52 +0000)
This patch adds a config option to be compatible with X servers like
OpenChrome. This is required as for example the X server does not
handle things like disabled IGAs/PLLs resulting in a potential
freeze on X startup. With this option disabled we can provide some
nice features like power management and not reinitializing the
hardware on every mode switch (taking long time, causing flickering).

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/Kconfig
drivers/video/via/hw.c

index 6bafb51bb43738a415ba09547a49bef21809f9a1..4923b5ec02014deea5625187c78ecaee8dd576a9 100644 (file)
@@ -1607,6 +1607,17 @@ config FB_VIA_DIRECT_PROCFS
          correct output device configuration.
          Its use is strongly discouraged.
 
+config FB_VIA_X_COMPATIBILITY
+       bool "X server compatibility"
+       depends on FB_VIA
+       default n
+       help
+         This option reduces the functionality (power saving, ...) of the
+         framebuffer to avoid negative impact on the OpenChrome X server.
+         If you use any X server other than fbdev you should enable this
+         otherwise it should be safe to disable it and allow using all
+         features.
+
 endif
 
 config FB_NEOMAGIC
index e5311474219f367b39157986f1dcb757efd7022f..104f3e16010fcc1de08bfa4b5c28354fc721756a 100644 (file)
@@ -2293,6 +2293,12 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
        clock.set_primary_clock_source(VIA_CLKSRC_X1, true);
        clock.set_secondary_clock_source(VIA_CLKSRC_X1, true);
 
+#ifdef CONFIG_FB_VIA_X_COMPATIBILITY
+       clock.set_primary_pll_state(VIA_STATE_ON);
+       clock.set_primary_clock_state(VIA_STATE_ON);
+       clock.set_secondary_pll_state(VIA_STATE_ON);
+       clock.set_secondary_clock_state(VIA_STATE_ON);
+#else
        if (viaparinfo->shared->iga1_devices) {
                clock.set_primary_pll_state(VIA_STATE_ON);
                clock.set_primary_clock_state(VIA_STATE_ON);
@@ -2308,6 +2314,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
                clock.set_secondary_pll_state(VIA_STATE_OFF);
                clock.set_secondary_clock_state(VIA_STATE_OFF);
        }
+#endif /*CONFIG_FB_VIA_X_COMPATIBILITY*/
 
        via_set_state(devices, VIA_STATE_ON);
        device_screen_on();