Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jun 2017 03:45:09 +0000 (UTC)
From:      Josh Paetzel <jpaetzel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320393 - head/sys/dev/bktr
Message-ID:  <201706270345.v5R3j9UP076735@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jpaetzel
Date: Tue Jun 27 03:45:09 2017
New Revision: 320393
URL: https://svnweb.freebsd.org/changeset/base/320393

Log:
  driver incorrectly handles the setting of frame rates
  
  PR:	36415
  Submitted by:	brandt@fokus.gmd.de

Modified:
  head/sys/dev/bktr/bktr_core.c

Modified: head/sys/dev/bktr/bktr_core.c
==============================================================================
--- head/sys/dev/bktr/bktr_core.c	Tue Jun 27 01:57:22 2017	(r320392)
+++ head/sys/dev/bktr/bktr_core.c	Tue Jun 27 03:45:09 2017	(r320393)
@@ -972,7 +972,7 @@ video_open( bktr_ptr_t bktr )
 	bktr->flags |= METEOR_OPEN;
 
 #ifdef BT848_DUMP
-	dump_bt848( bt848 );
+	dump_bt848(bktr);
 #endif
 
         bktr->clr_on_start = FALSE;
@@ -1688,7 +1688,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, ioctl_cmd_t cm
 			                    BT848_INT_VSYNC      |
 					    BT848_INT_FMTCHG);
 #ifdef BT848_DUMP
-			dump_bt848( bt848 );
+			dump_bt848(bktr);
 #endif
 			break;
 		
@@ -2522,7 +2522,7 @@ common_ioctl( bktr_ptr_t bktr, ioctl_cmd_t cmd, caddr_
 /*
  * 
  */
-#ifdef BT848_DEBUG 
+#if defined(BT848_DEBUG) || defined(BT848_DUMP)
 static int
 dump_bt848( bktr_ptr_t bktr )
 {
@@ -2542,7 +2542,7 @@ dump_bt848( bktr_ptr_t bktr )
 		       r[i], INL(bktr, r[i]),
 		       r[i+1], INL(bktr, r[i+1]),
 		       r[i+2], INL(bktr, r[i+2]),
-		       r[i+3], INL(bktr, r[i+3]]));
+		       r[i+3], INL(bktr, r[i+3]));
 	}
 
 	printf("%s: INT STAT %x \n", bktr_name(bktr),
@@ -3705,28 +3705,26 @@ start_capture( bktr_ptr_t bktr, unsigned type )
 
 
 /*
- * 
+ * Set the temporal decimation register to get the desired frame rate.
+ * We use the 'skip frame' modus always and always start dropping on an
+ * odd field.
  */
 static void
 set_fps( bktr_ptr_t bktr, u_short fps )
 {
 	struct format_params	*fp;
-	int i_flag;
 
 	fp = &format_params[bktr->format_params];
 
 	switch(bktr->flags & METEOR_ONLY_FIELDS_MASK) {
 	case METEOR_ONLY_EVEN_FIELDS:
 		bktr->flags |= METEOR_WANT_EVEN;
-		i_flag = 1;
 		break;
 	case METEOR_ONLY_ODD_FIELDS:
 		bktr->flags |= METEOR_WANT_ODD;
-		i_flag = 1;
 		break;
 	default:
 		bktr->flags |= METEOR_WANT_MASK;
-		i_flag = 2;
 		break;
 	}
 
@@ -3737,7 +3735,7 @@ set_fps( bktr_ptr_t bktr, u_short fps )
 	OUTB(bktr, BKTR_TDEC, 0);
 
 	if (fps < fp->frame_rate)
-		OUTB(bktr, BKTR_TDEC, i_flag*(fp->frame_rate - fps) & 0x3f);
+		OUTB(bktr, BKTR_TDEC, (fp->frame_rate - fps) & 0x3f);
 	else
 		OUTB(bktr, BKTR_TDEC, 0);
 	return;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706270345.v5R3j9UP076735>