From owner-freebsd-multimedia Sun Jun 13 15:40:52 1999 Delivered-To: freebsd-multimedia@freebsd.org Received: from pluto.ipass.net (pluto.ipass.net [198.79.53.5]) by hub.freebsd.org (Postfix) with ESMTP id 0AD1514F65 for ; Sun, 13 Jun 1999 15:40:48 -0700 (PDT) (envelope-from rhh@ipass.net) Received: from stealth.ipass.net. (ppp-5-182.dialup.rdu.ipass.net [209.170.134.182]) by pluto.ipass.net (8.9.3/8.9.3) with ESMTP id SAA13161; Sun, 13 Jun 1999 18:40:42 -0400 (EDT) Received: (from rhh@localhost) by stealth.ipass.net. (8.9.3/8.8.8) id SAA03915; Sun, 13 Jun 1999 18:42:18 -0400 (EDT) (envelope-from rhh) Date: Sun, 13 Jun 1999 18:42:18 -0400 From: Randall Hopper To: just matt Cc: multimedia@FreeBSD.ORG Subject: Re: one more fxtv question (really fxtv this time) Message-ID: <19990613184218.A3850@ipass.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=fdj2RfSjLxBAspz7 X-Mailer: Mutt 0.95.1i In-Reply-To: ; from just matt on Sun, Jun 13, 1999 at 03:15:04PM -0700 Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii just matt: |Now that I got fxtv up and running I was wondering if there is any way to |run the thing full screen. I tried recompiling with different x/y |defaults for zoom mode but I only get a black screen when zoomed. Am I |missing something simple? Thanks, Hmmmm. Check that you have 640x480 mode configured correctly. Let's make sure this is the case and your DGA extension isn't confused first. Compile the attached C program using: cc -I/usr/X11R6/include -L/usr/X11R6/lib -o xsetvmode xsetvmode.c \ -lX11 -lXext -lXxf86vm and then run: xsetvmode -q # Should print your current video mode xsetvmode 640 480 # Should switch down to 640x480 xsetvmode -q # If successful, should print 640 480 Randall --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xsetvmode.c" /* * xsetvmode.c * * Simple utility to change video modes under XFree. The version of XFree * being run must support the vidmode extension. Also note that only * the video mode will be changed. The desktop size will remain the * same. * * Written by: Randall Hopper (5/24/97) * */ #include #include #include #include #include /*#define VMODE_SWITCHTOMODE_API_IS_BUSTED ...Unfortunately*/ #define ERRPRINT(str) fprintf( stderr, str ) /**@BEGINFUNC************************************************************** Prototype : static INT32 SGetCurVidMode( Display *display, int screen, XF86VidModeModeInfo **vm_list, int vm_list_len ) Purpose : Returns the index of the current video mode in the vm_list video mode list. NOTE: Assumes the vidmode extension is supported. Programmer : 13-Apr-97 Randall Hopper Parameters : display - I: X display to query screen - I: screen on X display to query vm_list - I: list of video mode structs vm_list_len - I: length of vm_list Returns : index of current mode in list Globals : None. **@ENDFUNC*****************************************************************/ static INT32 SGetCurVidMode( Display *display, int screen, XF86VidModeModeInfo **vm_list, int vm_list_len ) { int dot_clock, vm; XF86VidModeModeLine vm_info; if ( !XF86VidModeGetModeLine( display, screen, &dot_clock, &vm_info ) ) { ERRPRINT( "XF86VidModeGetModeLine() failed\n" ); exit(1); } for ( vm = 0; vm < vm_list_len; vm++ ) if (( vm_info.hdisplay == vm_list[vm]->hdisplay ) && ( vm_info.hsyncstart == vm_list[vm]->hsyncstart ) && ( vm_info.hsyncend == vm_list[vm]->hsyncend ) && ( vm_info.htotal == vm_list[vm]->htotal ) && ( vm_info.vdisplay == vm_list[vm]->vdisplay ) && ( vm_info.vsyncstart == vm_list[vm]->vsyncstart ) && ( vm_info.vsyncend == vm_list[vm]->vsyncend ) && ( vm_info.vtotal == vm_list[vm]->vtotal )) break; if ( vm >= vm_list_len ) { ERRPRINT( "SGetCurVidMode: Couldn't find cur mode in list\n" ); exit(1); } return vm; } int main( int argc, char *argv[] ) { Display *display; int screen, vmode_majv, vmode_minv, vm_list_len, vm_startup; XF86VidModeModeInfo **vm_list; /* Connect to the default XServer ($DISPLAY) */ if ( (display = XOpenDisplay( NULL )) == NULL ) { ERRPRINT( "Can't open X display\n" ); exit(1); } screen = DefaultScreen( display ); /* First determine if the vidmode extension is supported on this server */ if ( !XF86VidModeQueryVersion( display, &vmode_majv, &vmode_minv ) ) { ERRPRINT( "XF86VidModeQueryVersion() failed\n" ); exit(1); } /* Get a list of all video modes supported by the server */ if ( !XF86VidModeGetAllModeLines( display, screen, &vm_list_len, &vm_list ) ) { ERRPRINT( "XF86VidModeGetAllModeLines() failed\n" ); exit(1); } /* Get the current video mode */ vm_startup = SGetCurVidMode( display, screen, vm_list, vm_list_len ); /* Now, deal with user request. */ /* If user just wanted to know res of current mode, print it */ if (( argc == 2 ) && ( strcmp( argv[1], "-q" ) == 0 )) printf( "%d %d\n", vm_list[ vm_startup ]->hdisplay, vm_list[ vm_startup ]->vdisplay ); /* Or if user wanted to change res to that specified, try to do that */ else if (( argc == 3 ) && ( strspn( argv[1], "0123456789" ) == strlen( argv[1] ) ) && ( strspn( argv[2], "0123456789" ) == strlen( argv[2] ) )) { int xres = atoi( argv[1] ), yres = atoi( argv[2] ), i; for ( i = 0; i < vm_list_len; i++ ) if (( xres == vm_list[i]->hdisplay ) && ( yres == vm_list[i]->vdisplay )) break; if ( i >= vm_list_len ) { fprintf( stderr, "Resolution %dx%d not supported by XServer\n", xres, yres ); exit(1); } #ifdef VMODE_SWITCHTOMODE_API_IS_BUSTED { int j; for ( j = vm_startup; j != i; j += (i-vm_startup>0) ? 1 : -1 ) if ( !XF86VidModeSwitchMode( display, screen, (i-j) > 0 ? 1 : 0 ) ) { ERRPRINT( "XF86VidModeSwitchMode() failed\n" ); exit(1); } } #else if ( !XF86VidModeSwitchToMode( display, screen, vm_list[i] ) ) { ERRPRINT( "XF86VidModeSwitchToMode() failed\n" ); exit(1); } #endif XSync( display, False ); } /* Bad options. Print help */ else { char *p = strrchr( argv[0], '/' ); if ( p == NULL ) p = argv[0]; printf( "%s -- XFree Video Mode Query/Switch Utility\n\n" "\tParameters: [ -q | ]\n\n" "\tUse '%s -q' to query the current video mode\n" "\tUse '%s ' to switch to a video mode\n", p,p,p ); exit(1); } XCloseDisplay( display ); return 0; } --fdj2RfSjLxBAspz7-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message