changeset 13568:1cb0e1833515

Currently vbeGetProtModeInfo call the 0x4f0a function of int 10h the get a simple 32 bits protected mode interface to some VESA functions. This protected mode interface is interesting because it's quicker than the raw int 10h interface. Unfortunatly, begining with VBE 3.0, the 0x4f0a function is optional, and some video cards don't implement it (3dfx, intel 845/855/865...). This protected mode interface is then only used in vbeSetWindow and vbeSetDisplayStart : ?- vbeSetWindow already implement an alternative methode if protected mode interface is not available. ?- vbeSetDisplayStart also contain an alternative implementation, but this one is disabled with a #if 0. I don't exactly know why because it works well ! So currently, cards which don't have the 0x4f0a function are not supported. This patch correct this. ?- vbeGetProtModeInfo failure is not fatal. ?- vbeSetDisplayStart has it's alternative implementation reenabled. ? ?it's used only with cards which don't have the 0x4f0a function ? ?so this won't make any difference for cards which were already ? ?working. This patch also make the failure of vbeGetModeInfo not fatal. The VBE 3.0 standard state that GetModeInfo can fail with some mode which are listed as supported if the mode can't be used in the current situation (not enough video memory for example). So a failure of vbeGetModeInfo don't mean that other modes won't work and should really not be fatal. patch by Aurelien Jacobs <aurel@gnuage.org>
author faust3
date Wed, 06 Oct 2004 08:42:13 +0000
parents 8f75b26e847c
children 9dabcdf189e0
files libvo/vo_vesa.c osdep/vbelib.c
diffstat 2 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_vesa.c	Tue Oct 05 20:35:34 2004 +0000
+++ b/libvo/vo_vesa.c	Wed Oct 06 08:42:13 2004 +0000
@@ -739,7 +739,7 @@
 		if((err=vbeGetModeInfo(mode_ptr[i],&vmib)) != VBE_OK)
 		{
 			PRINT_VBE_ERR("vbeGetModeInfo",err);
-			return -1;
+			continue;
 		}
 		if(vmib.XResolution >= w &&
 		   vmib.YResolution >= h &&
--- a/osdep/vbelib.c	Tue Oct 05 20:35:34 2004 +0000
+++ b/osdep/vbelib.c	Wed Oct 06 08:42:13 2004 +0000
@@ -128,7 +128,6 @@
 {
    unsigned short iopl_port;
    size_t i;
-   int retval;
    if(!LRMI_init()) return VBE_VM86_FAIL;
    if(!(controller_info = LRMI_alloc_real(sizeof(struct VbeInfoBlock)))) return VBE_OUT_OF_DOS_MEM;
    /*
@@ -141,8 +140,7 @@
    ioperm(0, 1024, 1);
    iopl(3);
    memset(&vbe_pm_info,0,sizeof(struct VesaProtModeInterface));
-   retval = vbeGetProtModeInfo(&vbe_pm_info);
-   if(retval != VBE_OK) return retval;
+   vbeGetProtModeInfo(&vbe_pm_info);
    i = 0;
    if(vbe_pm_info.iopl_ports) /* Can be NULL !!!*/
    while((iopl_port=vbe_pm_info.iopl_ports[i]) != 0xFFFF
@@ -399,7 +397,7 @@
   if(retval == 0x4f)
   {
     /* Just info for internal use (currently in SetDiplayStart func). */
-    vbeGetModeInfo(mode&0x1f,&curr_mode_info);
+    vbeGetModeInfo(mode,&curr_mode_info);
     retval = VBE_OK;
   }
   return retval;
@@ -639,8 +637,6 @@
   }
   else
   {
-#if 0
-    /* Something wrong here */
     struct LRMI_regs r;
     unsigned long pixel_num;
     memset(&r,0,sizeof(struct LRMI_regs));
@@ -653,8 +649,7 @@
     if(!VBE_LRMI_int(0x10,&r)) return VBE_VM86_FAIL;
     retval = r.eax & 0xffff;
     if(retval == 0x4f) retval = VBE_OK;
-#endif
-    retval = VBE_BROKEN_BIOS;
+    else retval = VBE_BROKEN_BIOS;
   }
   return retval;
 }