summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgraffam <mgraffam@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-28 19:58:45 +0000
committermgraffam <mgraffam@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-28 19:58:45 +0000
commiteffaab2cf269cde8fca13b82db3c3c81ca10c609 (patch)
treeda6f5a6db2e9a3c89314d6488b856d189a0113ef
parent4680a1cbed5baa03f40ba79f97a41747c6c988b5 (diff)
downloadmpv-effaab2cf269cde8fca13b82db3c3c81ca10c609.tar.bz2
mpv-effaab2cf269cde8fca13b82db3c3c81ca10c609.tar.xz
Changes to configure to autodetect DGA 2.0 functionality, and to only use
DGA video mode switching when DGA 2.0 is present git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@234 b3059339-0415-0410-9bf9-f77b7e298cf2
-rwxr-xr-xconfigure30
-rw-r--r--libvo/vo_dga.c26
2 files changed, 48 insertions, 8 deletions
diff --git a/configure b/configure
index e7bb6340aa..d6b564c927 100755
--- a/configure
+++ b/configure
@@ -167,6 +167,7 @@ _mlib=no
_mpg123=no
_xmga=no
_dga=no
+_dga2=no
_fbdev=no
_lirc=no
@@ -393,6 +394,18 @@ $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXx
# ---
+# Check if DGA is 2.0 or greater
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/extensions/xf86dga.h>
+int main (void) { XDGAMode mode; XDGADevice device; return 0;}
+EOF
+
+_dga2=no
+$_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm &> /dev/null && _dga2=yes
+
+
cat > $TMPC << EOF
#include <GL/gl.h>
int main( void ) { return 0; }
@@ -443,7 +456,10 @@ do
;;
--enable-dga)
_dga=yes
- ;;
+ ;;
+ --enable-dga2)
+ _dga2=yes
+ ;;
--enable-xv)
_xv=yes
;;
@@ -513,6 +529,9 @@ do
--disable-dga)
_dga=no
;;
+ --disable-dga2)
+ _dga2=no
+ ;;
--disable-fbdev)
_fbdev=no
;;
@@ -555,6 +574,7 @@ echo "Checking for OpenGL ... $_gl"
echo "Checking for Xv ... $_xv"
echo "Checking for X11 ... $_x11"
echo "Checking for DGA ... $_dga"
+echo "Checking for DGA 2.0 .. $_dga2"
echo "Checking for Xf86VM ... $_vm"
echo "Checking for FBDev ... $_fbdev"
# write conf files.
@@ -727,6 +747,13 @@ else
_dga='#undef HAVE_DGA'
fi
+if [ $_dga2 = yes ]; then
+ _dga2='#define HAVE_DGA2'
+ _vosrc=$_vosrc' vo_dga.c vo_fsdga.c'
+else
+ _dga2='#undef HAVE_DGA2'
+fi
+
if [ $_fbdev = yes ]; then
_fbdev='#define HAVE_FBDEV'
_vosrc=$_vosrc' vo_fbdev.c'
@@ -807,6 +834,7 @@ $_xv
$_vm
$_gl
$_dga
+$_dga2
$_sdldef
$_3dfx
$_mga
diff --git a/libvo/vo_dga.c b/libvo/vo_dga.c
index c7aa9e8ecb..e1fa382f78 100644
--- a/libvo/vo_dga.c
+++ b/libvo/vo_dga.c
@@ -241,10 +241,13 @@ static uint32_t init( uint32_t width, uint32_t height,
int bank, ram;
int x_off, y_off;
+#ifdef HAVE_DGA2
// needed to change DGA video mode
- int modecount,mX, mY, X, Y, i,j;
+ int modecount,mX, mY, i,j;
+ int X,Y;
XDGAMode *modelines=NULL;
XDGADevice *dgadevice;
+#endif
if( vo_dga_is_running )return -1;
@@ -259,6 +262,7 @@ static uint32_t init( uint32_t width, uint32_t height,
return 1;
}
+#ifdef HAVE_DGA2
// Code to change the video mode added by Michael Graffam
// mgraffam@idsi.net
if (modelines==NULL)
@@ -285,6 +289,7 @@ static uint32_t init( uint32_t width, uint32_t height,
}
X=(modelines[j].imageWidth-mX)/2;
Y=(modelines[j].imageHeight-mY)/2;
+ printf("vo_dga: Using DGA 2.0 mode changing support\n");
printf("vo_dga: Selected video mode %dx%d for image size %dx%d.\n", mX, mY,width, height);
XF86DGASetViewPort (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), X,Y);
@@ -293,15 +298,22 @@ static uint32_t init( uint32_t width, uint32_t height,
XFree(modelines);
XFree(dgadevice);
+ // end mode change code
+#else
+printf("vo_dga: DGA 1.0 compatibility code\n");
+#endif
-// end mode change code
+XF86DGAGetViewPortSize(vo_dga_dpy,XDefaultScreen(vo_dga_dpy),
+ &vo_dga_vp_width,
+ &vo_dga_vp_height);
- XF86DGAGetVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
- (char **)&vo_dga_base, &vo_dga_width, &bank, &ram);
+XF86DGAGetVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
+ (char **)&vo_dga_base, &vo_dga_width, &bank, &ram);
+
+#ifndef HAVE_DGA2
+XF86DGASetViewPort (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0, 0);
+#endif
- vo_dga_vp_width=modelines[j].viewportWidth;
- vo_dga_vp_height=modelines[j].viewportHeight;
-
// do some more checkings here ...
if( format==IMGFMT_YV12 )
yuv2rgb_init( vo_depthonscreen, MODE_RGB );