[MPlayer-cvslog] r29988 - trunk/vidix/sh_veu_vid.c

cehoyos subversion at mplayerhq.hu
Fri Dec 11 00:16:09 CET 2009


Author: cehoyos
Date: Fri Dec 11 00:16:08 2009
New Revision: 29988

Log:
Update the SuperH VEU vidix driver with code that calls fsync() after each
frame to make sure the frame is flushed in case of deferred io.

Patch by Magnus Damm, damm opensource se

Modified:
   trunk/vidix/sh_veu_vid.c

Modified: trunk/vidix/sh_veu_vid.c
==============================================================================
--- trunk/vidix/sh_veu_vid.c	Wed Dec  9 21:20:18 2009	(r29987)
+++ trunk/vidix/sh_veu_vid.c	Fri Dec 11 00:16:08 2009	(r29988)
@@ -1,6 +1,6 @@
 /*
  * VIDIX driver for SuperH Mobile VEU hardware block.
- * Copyright (C) 2008 Magnus Damm
+ * Copyright (C) 2008, 2009 Magnus Damm
  *
  * Requires a kernel that exposes the VEU hardware block to user space
  * using UIO. Available in upstream linux-2.6.27 or later.
@@ -179,8 +179,7 @@ static int get_fb_info(char *device, str
     memset(iomem, 0, fip->line_length * fip->height);
     munmap(iomem, fip->size);
 
-    close(fd);
-    return 0;
+    return fd;
 }
 
 #define VESTR 0x00 /* start register */
@@ -268,6 +267,7 @@ struct sh_veu_plane {
 
 static struct sh_veu_plane _src, _dst;
 static vidix_playback_t my_info;
+static int fb_fd;
 
 static int sh_veu_probe(int verbose, int force)
 {
@@ -276,6 +276,7 @@ static int sh_veu_probe(int verbose, int
     ret = get_fb_info("/dev/fb0", &fbi);
     if (ret < 0)
         return ret;
+    fb_fd = ret;
 
     if (fbi.bpp != 16) {
         printf("sh_veu: only 16bpp supported\n");
@@ -315,6 +316,9 @@ static void sh_veu_wait_irq(vidix_playba
     read(uio_dev.fd, &n_pending, sizeof(unsigned long));
 
     write_reg(&uio_mmio, 0x100, VEVTR); /* ack int, write 0 to bit 0 */
+
+    /* flush framebuffer to handle deferred io case */
+    fsync(fb_fd);
 }
 
 static int sh_veu_is_veu2h(void)
@@ -486,6 +490,7 @@ static int sh_veu_init(void)
 
 static void sh_veu_destroy(void)
 {
+    close(fb_fd);
 }
 
 static int sh_veu_get_caps(vidix_capability_t *to)


More information about the MPlayer-cvslog mailing list