[MPlayer-dev-eng] [PATCH] Improved DGA vertical retrace sync

Fredrik Noring noring at nocrew.org
Thu Sep 26 00:47:21 CEST 2002


ons 2002-09-25 klockan 23.44 skrev Arpi:
> applied both

I think my buffer algorithm was slightly off, causing the three
buffer case perform as badly as the two buffer case (although the
four and beyond buffer case worked alot better). 

If anyone is having problem with this, try the attached patch (still
using three buffers). I'm going to do a bit more testing on this and
related things.

        Fredrik



Index: vo_dga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dga.c,v
retrieving revision 1.49
diff -u -r1.49 vo_dga.c
--- vo_dga.c	25 Sep 2002 21:41:42 -0000	1.49
+++ vo_dga.c	25 Sep 2002 23:05:04 -0000
@@ -262,14 +262,8 @@
 
 #define MAX_NR_VIDEO_BUFFERS 3
 
-#define VIDEO_BUFFER_DRAW \
-        (vo_dga_video_buffer[vo_dga_current_video_buffer % \
-			     vo_dga_nr_video_buffers])
-
-#define VIDEO_BUFFER_DISPLAY \
-        (vo_dga_video_buffer[(vo_dga_current_video_buffer + \
-			      vo_dga_nr_video_buffers - 1) % \
-			     vo_dga_nr_video_buffers])
+#define CURRENT_VIDEO_BUFFER \
+        (vo_dga_video_buffer[vo_dga_current_video_buffer])
 
 static int vo_dga_nr_video_buffers;      // Total number of frame buffers.
 static int vo_dga_current_video_buffer;  // Buffer available for rendering.
@@ -298,7 +292,7 @@
 
   offset = vo_dga_width * y0 +x0;
   buffer_stride = vo_dga_width;
-  d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
+  d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
      
   switch( HW_MODE.vdm_mplayer_depth ){
 
@@ -345,7 +339,7 @@
   char *s, *d;
 
   s = *src;
-  d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
+  d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
   
   switch(SRC_MODE.vdm_conversion_func){
   case VDM_CONV_NATIVE:
@@ -360,7 +354,7 @@
   // DBG-COde
 
 #if 0
-  d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
+  d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
   fillblock(d, 0, 10, 0x800000ff);
   fillblock(d, 10, 10, 0x8000ff00);
   fillblock(d, 20, 10, 0x80ff0000);
@@ -429,7 +423,7 @@
 #ifdef HAVE_DGA2
 		XDGASetViewport(vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 
 				0,
-				VIDEO_BUFFER_DISPLAY.y, 
+				CURRENT_VIDEO_BUFFER.y, 
 				XDGAFlipRetrace);
 #else
 		XF86DGASetViewPort(vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
@@ -448,7 +442,7 @@
   if (scale_srcW) {
     uint8_t *dst[3] =
     {
-	    VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset,
+	    CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset,
 	    0,
 	    0
     };
@@ -457,7 +451,7 @@
           /*scale_dstW*/ vo_dga_width * HW_MODE.vdm_bytespp, HW_MODE.vdm_bitspp,
 		      scale_srcW, scale_srcH, scale_dstW, scale_dstH);
   } else {
-    yuv2rgb(VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset + 
+    yuv2rgb(CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset + 
           (vo_dga_width * y +x) * HW_MODE.vdm_bytespp,
            src[0], src[1], src[2],
            w,h, vo_dga_width * HW_MODE.vdm_bytespp,




More information about the MPlayer-dev-eng mailing list