From 1addcfe22be3f388ef1fcabb2940b106a25f641f Mon Sep 17 00:00:00 2001 From: faust3 Date: Wed, 6 Oct 2004 08:42:13 +0000 Subject: =?UTF-8?q?Currently=20vbeGetProtModeInfo=20call=20the=200x4f0a=20?= =?UTF-8?q?function=20of=20int=2010h=20the=20get=20a=20simple=2032=20bits?= =?UTF-8?q?=20protected=20mode=20interface=20to=20some=20VESA=20functions.?= =?UTF-8?q?=20This=20protected=20mode=20interface=20is=20interesting=20bec?= =?UTF-8?q?ause=20it's=20quicker=20than=20the=20raw=20int=2010h=20interfac?= =?UTF-8?q?e.=20Unfortunatly,=20begining=20with=20VBE=203.0,=20the=200x4f0?= =?UTF-8?q?a=20function=20is=20optional,=20and=20some=20video=20cards=20do?= =?UTF-8?q?n't=20implement=20it=20(3dfx,=20intel=20845/855/865...).=20This?= =?UTF-8?q?=20protected=20mode=20interface=20is=20then=20only=20used=20in?= =?UTF-8?q?=20vbeSetWindow=20and=20vbeSetDisplayStart=20:=20=C2=A0-=20vbeS?= =?UTF-8?q?etWindow=20already=20implement=20an=20alternative=20methode=20i?= =?UTF-8?q?f=20protected=20mode=20interface=20is=20not=20available.=20?= =?UTF-8?q?=C2=A0-=20vbeSetDisplayStart=20also=20contain=20an=20alternativ?= =?UTF-8?q?e=20implementation,=20but=20this=20one=20is=20disabled=20with?= =?UTF-8?q?=20a=20#if=200.=20I=20don't=20exactly=20know=20why=20because=20?= =?UTF-8?q?it=20works=20well=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13569 b3059339-0415-0410-9bf9-f77b7e298cf2 --- osdep/vbelib.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'osdep') diff --git a/osdep/vbelib.c b/osdep/vbelib.c index 9eebcef352..d4cb8c5c46 100644 --- a/osdep/vbelib.c +++ b/osdep/vbelib.c @@ -128,7 +128,6 @@ int vbeInit( void ) { 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 @@ int vbeInit( void ) 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 @@ int vbeSetMode(unsigned mode,struct VesaCRTCInfoBlock *data) 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 @@ int vbeSetDisplayStart(unsigned long offset, int vsync) } 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 @@ int vbeSetDisplayStart(unsigned long offset, int vsync) 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; } -- cgit v1.2.3