Re: bootsplash
Le 11 Septembre 2005 04:50, mess-mate a écrit :
> Hi,
> i've installed bootsplash on a machine without any problem.
> But can't do the same on a second machine :
> -233 k6 with a S3Virge graphic car.
> Seems 'mode' (vga) isn't right when booting and have to select an
> other mode like for example 80x30.
> Setted the grub vga=788 (800x600 16bit) and configured bootsplash to
> 640/480,800/600,1024/728 with of course the appropriate boosplash
> image.
> What did i wrong ?
I have encountered this problem with S3 Virge cards.
I found a patch for 2.4 kernels (tested on 2.4.21 and 2.4.24) which side-steps
the problem, by setting video modes through VESA.
Let me know if it works.
--- linux/arch/i386/boot/video.S.orig Fri Mar 15 13:33:50 2002
+++ linux/arch/i386/boot/video.S Fri Mar 15 13:50:02 2002
@@ -543,13 +543,22 @@
cmpb $0x09, %al
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
movb (%di), %al # Check capabilities.
andb $0x99, %al
cmpb $0x99, %al
jnz _setbad # Doh! No linear frame buffer.
+#endif
subb $VIDEO_FIRST_VESA>>8, %bh
+#ifndef CONFIG_FB_S3CARD
orw $0x4000, %bx # Use linear frame buffer
+#endif
movw $0x4f02, %ax # VESA BIOS mode set call
int $0x10
cmpw $0x004f, %ax # AL=4f if implemented
--- linux/drivers/video/Config.in.orig Fri Mar 15 13:49:33 2002
+++ linux/drivers/video/Config.in Fri Mar 15 13:50:02 2002
@@ -89,6 +89,11 @@
fi
if [ "$CONFIG_X86" = "y" ]; then
tristate ' VESA VGA graphics console' CONFIG_FB_VESA
+ if [ "$CONFIG_FB_VESA" = "y" ]; then
+ if [ "$CONFIG_PCI" != "n" ]; then
+ bool 'S3 display support' CONFIG_FB_S3CARD
+ fi
+ fi
tristate ' VGA 16-color graphics console' CONFIG_FB_VGA16
tristate ' Hercules mono graphics console (EXPERIMENTAL)' CONFIG_FB_HGA
define_bool CONFIG_VIDEO_SELECT y
--- linux/drivers/video/vesafb.c.orig Fri Mar 15 13:49:27 2002
+++ linux/drivers/video/vesafb.c Fri Mar 15 14:36:54 2002
@@ -21,6 +21,7 @@
#include <linux/selection.h>
#include <linux/ioport.h>
#include <linux/init.h>
+#include <linux/pci.h>
#include <asm/io.h>
#include <asm/mtrr.h>
@@ -34,6 +35,10 @@
#define dac_reg (0x3c8)
#define dac_val (0x3c9)
+#ifdef CONFIG_FB_S3CARD
+#define crtc_adr (0x3d4)
+#define crtc_val (0x3d5)
+#endif
/* --------------------------------------------------------------------- */
@@ -507,6 +512,81 @@
if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
return -ENXIO;
+#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_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices) && (dev->vendor != PCI_VENDOR_ID_S3 || dev->class >> 8 != PCI_CLASS_DISPLAY_VGA); dev = pci_dev_g(dev->global_list.next));
+ if(dev == pci_dev_g(&pci_devices) && (dev->vendor != PCI_VENDOR_ID_S3 || dev->class >> 8 != PCI_CLASS_DISPLAY_VGA))
+ {
+ 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->resource[0].start;
+
+ // disable fancy stuff
+
+ screen_info.vesapm_seg = 0;
+ }
+ while(0);
+#endif
video_base = screen_info.lfb_base;
video_bpp = screen_info.lfb_depth;
Reply to: