changeset 25274:cfb786831ff7

sync with vidix.sf.net r317: fixes colorspace issues for vidix savage driver
author ben
date Tue, 04 Dec 2007 22:33:08 +0000
parents a07e6b9e36c1
children d4fda3892e5b
files vidix/savage_vid.c
diffstat 1 files changed, 10 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/vidix/savage_vid.c	Tue Dec 04 22:22:24 2007 +0000
+++ b/vidix/savage_vid.c	Tue Dec 04 22:33:08 2007 +0000
@@ -277,18 +277,18 @@
 unsigned int GetBlendForFourCC( int id )
 {
     switch( id ) {
+	case IMGFMT_UYVY:
+	    return 0;
 	case IMGFMT_YUY2:
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
 	    return 1;
 	case IMGFMT_Y211:
 	    return 4;
-	case IMGFMT_RGB15:
+	case IMGFMT_BGR15:
 	    return 3;
-	case IMGFMT_RGB16:
+	case IMGFMT_BGR16:
 	    return 5;
         default:
-	    return 0;
+	    return 1;
     }
 }
 
@@ -450,12 +450,6 @@
 
 
 
-    /* Set surface format. */
-
-		OUTREG(SSTREAM_CONTROL_REG,GetBlendForFourCC(info->format) << 24 | info->src_w);
-
-		debugout(SSTREAM_CONTROL_REG,GetBlendForFourCC(info->format) << 24 | info->src_w);
-
     /* Calculate horizontal scale factor. */
 
     //FIXME: enable scaling
@@ -491,9 +485,9 @@
     OUTREG(SSTREAM_WINDOW_SIZE_REG, OS_WH(info->drw_w, info->drw_h) );
     debugout(SSTREAM_WINDOW_SIZE_REG, OS_WH(info->drw_w, info->drw_h) );
 
-
+    /* Set surface format and adjust scaling */
 
-    ssControl = 0;
+    ssControl = GetBlendForFourCC(info->format) << 24 | info->src_w;
 
     if( info->src_w > (info->drw_w << 1) )
     {
@@ -510,10 +504,6 @@
 	    ssControl |= HDSCALE_64;
     }
 
-    ssControl |= info->src_w;
-    ssControl |= (1 << 24);
-
-    //FIXME: enable scaling
     OUTREG(SSTREAM_CONTROL_REG, ssControl);
     debugout(SSTREAM_CONTROL_REG, ssControl);
 
@@ -1063,8 +1053,8 @@
 //    case IMGFMT_YV12:
 //    case IMGFMT_I420:
     case IMGFMT_UYVY:
-    case IMGFMT_YVYU:
     case IMGFMT_YUY2:
+    case IMGFMT_Y211:
     case IMGFMT_RGB15:
     case IMGFMT_RGB16:
 //    case IMGFMT_BGR32:
@@ -1229,6 +1219,7 @@
 
    info->pitch = ((info->src_w << 1) + 15) & ~15;
 
+#if 0
   swap_uv = 0;
   switch (vinfo->fourcc)
   {
@@ -1275,6 +1266,7 @@
 
 		  break;
   }
+#endif
 			info->pitch |= ((info->pitch >> 1) << 16);
 
 		  vinfo->frame_size = info->pitch * info->src_h;