From 5a473a4ffcae319ea5ab0c2ce28060ce856e683f Mon Sep 17 00:00:00 2001 From: arpi Date: Sun, 27 Oct 2002 03:15:48 +0000 Subject: [PATCH] mode detection && vo_init() moved to preinit() NOTE: this driver needs some cleanup, and should use mDisplay/mScreen git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7931 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dga.c | 148 ++++++++++++++++++++++--------------------------- 1 file changed, 67 insertions(+), 81 deletions(-) diff --git a/libvo/vo_dga.c b/libvo/vo_dga.c index b86b070336..75b4beb3b1 100644 --- a/libvo/vo_dga.c +++ b/libvo/vo_dga.c @@ -470,82 +470,6 @@ static const vo_info_t* get_info( void ) static uint32_t query_format( uint32_t format ) { -#ifdef HAVE_DGA2 - XDGAMode *modelines; - int modecount; -#endif - Display *qdisp; - - int i; - static int dga_depths_init = 0; - - if(dga_depths_init == 0){ - - if((qdisp = XOpenDisplay(0))==NULL){ - mp_msg(MSGT_VO, MSGL_ERR, "vo_dga: Can't open display!\n"); - return 0; - } - if( !vo_init() ){ - mp_msg(MSGT_VO, MSGL_ERR, "vo_dga: vo_init() failed!\n"); - return 0; - } - vo_dga_XServer_mode = vd_ValidateMode(vo_depthonscreen); - - if(vo_dga_XServer_mode ==0){ -#ifndef HAVE_DGA2 - mp_msg(MSGT_VO, MSGL_ERR, "vo_dga: Your X-Server is not running in a "); - mp_msg(MSGT_VO, MSGL_ERR, "resolution supported by DGA driver!\n"); -#endif - }//else{ - // mp_msg(MSGT_VO, MSGL_INFO, "vo_dga: X running at: %s\n", - // vd_GetModeString(vo_dga_XServer_mode)); - //} - -#ifdef HAVE_DGA2 - modelines=XDGAQueryModes(qdisp, XDefaultScreen(qdisp),&modecount); - if(modelines){ - for(i=0; i< modecount; i++){ - mp_msg(MSGT_VO, MSGL_V, "vo_dga: (%03d) depth=%d, bpp=%d, r=%08x, g=%08x, b=%08x, %d x %d\n", - i, - modelines[i].depth, - modelines[i].bitsPerPixel, - modelines[i].redMask, - modelines[i].greenMask, - modelines[i].blueMask, - modelines[i].viewportWidth, - modelines[i].viewportHeight); - vd_EnableMode( - modelines[i].depth, - modelines[i].bitsPerPixel, - modelines[i].redMask, - modelines[i].greenMask, - modelines[i].blueMask); - } - XFree(modelines); - - } -#endif - dga_depths_init = 1; - XCloseDisplay(qdisp); - - if( !vo_dga_modes[1].vdm_supported && vo_dga_modes[2].vdm_supported ){ - vo_dga_modes[1].vdm_supported = 1; - } - - if( !vo_dga_modes[3].vdm_supported && vo_dga_modes[4].vdm_supported ){ - vo_dga_modes[3].vdm_supported = 1; - } - - for(i=1; i