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

cehoyos subversion at mplayerhq.hu
Fri Dec 11 00:22:20 CET 2009


Author: cehoyos
Date: Fri Dec 11 00:22:19 2009
New Revision: 29990

Log:
Update the SuperH VEU vidix driver with experimental support for VEU3F.

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	Fri Dec 11 00:20:09 2009	(r29989)
+++ trunk/vidix/sh_veu_vid.c	Fri Dec 11 00:22:19 2009	(r29990)
@@ -219,6 +219,8 @@ static int get_fb_info(char *device, str
 #define VCOFFR 0x224 /* color conversion offset */
 #define VCBR   0x228 /* color conversion clip */
 
+#define VRPBR  0xc8 /* resize passband */
+
 /* Helper functions for reading registers. */
 
 static unsigned long read_reg(struct uio_map *ump, int reg_offs)
@@ -323,14 +325,19 @@ static void sh_veu_wait_irq(vidix_playba
 
 static int sh_veu_is_veu2h(void)
 {
-    return uio_mmio.size > 0xb8;
+    return uio_mmio.size == 0x27c;
+}
+
+static int sh_veu_is_veu3f(void)
+{
+    return uio_mmio.size == 0xcc;
 }
 
 static unsigned long sh_veu_do_scale(struct uio_map *ump,
                                      int vertical, int size_in,
                                      int size_out, int crop_out)
 {
-    unsigned long fixpoint, mant, frac, value, rep;
+    unsigned long fixpoint, mant, frac, value, rep, vb;
 
     /* calculate FRAC and MANT */
     do {
@@ -402,6 +409,34 @@ static unsigned long sh_veu_do_scale(str
     }
     write_reg(ump, value, VRFSR);
 
+    /* VEU3F needs additional VRPBR register handling */
+    if (sh_veu_is_veu3f()) {
+        if (size_out > size_in)
+            vb = 64;
+        else {
+            if ((mant >= 8) && (mant < 16))
+                value = 4;
+            else if ((mant >= 4) && (mant < 8))
+                value = 2;
+            else
+                value = 1;
+
+            vb = 64 * 4096 * value;
+            vb /= 4096 * mant + frac;
+        }
+
+        /* set resize passband register */
+        value = read_reg(ump, VRPBR);
+        if (vertical) {
+            value &= ~0xffff0000;
+            value |= vb << 16;
+        } else {
+            value &= ~0xffff;
+            value |= vb;
+        }
+        write_reg(ump, value, VRPBR);
+    }
+
     return (((size_in * crop_out) / size_out) + 0x03) & ~0x03;
 }
 


More information about the MPlayer-cvslog mailing list