Since I have been having no luck with getting the Framebuffer 
option to work on my system, I have come to the conclusion 
that I have a VESA 1.2 BIOS (I do have a S3Virge). So I did some 
searching and found this internet site with the following info.

---------------------------------------------------------------------   


    Framebuffer HOWTO
  Alex Buell, [EMAIL PROTECTED]
  v1.1, 22 July 1999


  Alternatively, you may be able to download kernel patches to allow
  your VESA 1.2 card to work with the VESA framebuffer driver. For
  example, there are patches for use with older S3 boards (such as S3
  Trio, S3 Virge) that supports VESA 1.2. For these cards, you can pick
  up patches from
  ftp://ccssu.crimea.ua/pub/linux/kernel/v2.2/unofficial/s3new.diff.gz)


----------------------------------------------------------------------

I downloaded the file and tried to do the patch but am having no luck.
I am posting it here for others to look at that may have a better
understanding of how the patching process works. I read the man page but
I am still not really sure as to how this is done. It appears that there
are 3 files patched by this file??? Is this correct and can someone tell
me if I am on a wild goose chase or not.  (:

Please forgive me for this long post and taking up so much band width.

-----------------------------------------------------------------------
THE patch file....



--- linux/arch/i386/boot/video.S.orig   Sun Oct 25 13:46:40 1998
+++ linux/arch/i386/boot/video.S        Sat Feb 13 18:01:49 1999
@@ -554,13 +554,22 @@
        cmp     al,#0x09
        jz      setvesa         ! this is a text mode
 
+#ifdef CONFIG_FB_S3CARD
+!
+! removed the check for linear frame buffer as
+! we're going to try and turn it on ourselves
+!
+#else
        mov     al,(di)         ! Check capabilities.
        and     al,#0x99
        cmp     al,#0x99
        jnz     _setbad         ! to bad, no linear frame buffer
+#endif
 
        sub     bh,#VIDEO_FIRST_VESA>>8
+#ifndef CONFIG_FB_S3CARD
        or      bx,#0x4000      ! want use linear frame buffer  
+#endif
        mov     ax,#0x4f02      ! VESA BIOS mode set call
        int     0x10
        cmp     ax,#0x004f      ! AL=4f if implemented, AH=0 if OK
--- linux/drivers/video/Config.in.orig  Fri Jan 22 21:56:07 1999
+++ linux/drivers/video/Config.in       Sat Feb 13 18:09:51 1999
@@ -64,6 +64,11 @@
     bool 'VESA VGA graphics console' CONFIG_FB_VESA
     define_bool CONFIG_VIDEO_SELECT y
   fi
+  if [ "$CONFIG_FB_VESA" = "y" ]; then
+    if [ "$CONFIG_PCI" != "n" ]; then
+      bool 'S3 display support' CONFIG_FB_S3CARD
+    fi
+  fi
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
     if [ "$CONFIG_PCI" != "n" ]; then
       tristate 'Matrox acceleration' CONFIG_FB_MATROX
--- linux/drivers/video/vesafb.c.orig   Fri Nov 27 20:24:31 1998
+++ linux/drivers/video/vesafb.c        Sat Feb 13 18:05:20 1999
@@ -21,6 +21,7 @@
 #include <linux/selection.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
+#include <linux/pci.h>
 #include <linux/config.h>
 
 #include <asm/io.h>
@@ -32,8 +33,12 @@
 #include <video/fbcon-cfb24.h>
 #include <video/fbcon-cfb32.h>
 
-#define dac_reg        (0x3c8)
-#define dac_val        (0x3c9)
+#define dac_reg                (0x3c8)
+#define dac_val                (0x3c9)
+#ifdef CONFIG_FB_S3CARD
+#define crtc_adr       (0x3d4)
+#define crtc_val       (0x3d5)
+#endif
 
 /* --------------------------------------------------------------------- */
 
@@ -521,6 +526,82 @@
 
        if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
                return;
+#ifdef CONFIG_FB_S3CARD
+       do
+       {
+               // ----------------------------------------------
+               // try and enable linear frame buffer on S3 cards
+               // ----------------------------------------------
+
+               struct pci_dev *dev;
+               u8 tmp;
+               
+               // find S3 on PCI bus
+
+               for(dev = pci_devices; dev && (dev->vendor != PCI_VENDOR_ID_S3 ||
+                                       dev->class >> 8 != PCI_CLASS_DISPLAY_VGA); dev 
+= dev->next);
+               if(!dev)
+               {
+                       break;
+               }
+               
+               // unlock S3 registers
+               
+               outb_p(0x38, crtc_adr); outb_p(0x48, crtc_val);
+               outb_p(0x39, crtc_adr); outb_p(0xa5, crtc_val);
+               
+               // check that CR47 is read/write
+               
+               outb_p(0x47, crtc_adr); outb_p(0xff, crtc_val);
+               tmp = inb_p(crtc_val);
+               outb_p(0x00, crtc_val);
+               if(tmp != 0xff || inb_p(crtc_val))
+               {
+                       // lock S3 registers
+
+                       outb_p(0x39, crtc_adr); outb_p(0x5a, crtc_val);
+                       outb_p(0x38, crtc_adr); outb_p(0x00, crtc_val);
+                       
+                       break;
+               }
+
+               printk("vesafb: enabling S3 linear frame buffer\n");
+
+               // enable enhanced register access
+               
+               outb_p(0x40, crtc_adr); outb_p(inb_p(crtc_val) | 1, crtc_val);
+               
+               // enable enhanced functions
+               
+               outb_p(inb_p(0x4ae8) | 1, 0x4ae8);
+               
+               // enable enhanced mode memory mapping
+               
+               outb_p(0x31, crtc_adr); outb_p(inb_p(crtc_val) | 8, crtc_val);
+               
+               // enable linear frame buffer and set address window to max
+               
+               outb_p(0x58, crtc_adr); outb_p(inb_p(crtc_val) | 0x13, crtc_val);
+
+               // disabled enhanced register access
+
+               outb_p(0x40, crtc_adr); outb_p(inb_p(crtc_val) & ~1, crtc_val);
+
+               // lock S3 registers
+
+               outb_p(0x39, crtc_adr); outb_p(0x5a, crtc_val);
+               outb_p(0x38, crtc_adr); outb_p(0x00, crtc_val);
+
+               // save base address
+               
+               screen_info.lfb_base = dev->base_address[0] & 
+PCI_BASE_ADDRESS_MEM_MASK;
+
+               // disable fancy stuff
+
+               screen_info.vesapm_seg = 0;
+       }
+       while(0);
+#endif
 
        video_base          = (char*)screen_info.lfb_base;
        video_bpp           = screen_info.lfb_depth;



Reply via email to