From protius@teryx.bobdbob.com  Sun Nov 24 08:15:54 2002
Return-Path: <protius@teryx.bobdbob.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6807537B40B
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Nov 2002 08:15:53 -0800 (PST)
Received: from teryx.bobdbob.com (w178.z067105181.was-dc.dsl.cnc.net [67.105.181.178])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DF41A43E6E
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Nov 2002 08:15:47 -0800 (PST)
	(envelope-from protius@teryx.bobdbob.com)
Received: (from protius@localhost)
	by teryx.bobdbob.com (8.12.6/8.12.6) id gAOGFk9x016231;
	Sun, 24 Nov 2002 11:15:46 -0500 (EST)
	(envelope-from protius)
Message-Id: <200211241615.gAOGFk9x016231@teryx.bobdbob.com>
Date: Sun, 24 Nov 2002 11:15:46 -0500 (EST)
From: Tommy Johnson <tjohnson@teryx.bobdbob.com>
Reply-To: Tommy Johnson <tjohnson@bobdbob.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: The bktr driver when capturing a full frame fails to generate signals
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         45678
>Category:       i386
>Synopsis:       The bktr driver when capturing a full frame fails to generate signals
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    roger
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 24 08:20:00 PST 2002
>Closed-Date:    Sat Dec 07 01:09:19 PST 2002
>Last-Modified:  Sat Dec 07 01:09:19 PST 2002
>Originator:     Tommy Johnson
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
bobDbob.com  (personal system)
>Environment:
System: FreeBSD teryx.bobdbob.com 4.7-STABLE FreeBSD 4.7-STABLE #0: Wed Oct 30 19:31:17 EST 2002 protius@teryx.bobdbob.com:/local/src/sys/compile/TERYX i386

bktr1: <BrookTree 878> mem 0xfebfc000-0xfebfcfff irq 14 at device 18.0 on pci0
iicbb1: <I2C bit-banging driver> on bti2c1
iicbus2: <Philips I2C bus> on iicbb1 master-only
iicbus3: <Philips I2C bus> on iicbb1 master-only
smbus2: <System Management Bus> on bti2c1
bktr1: Pinnacle/Miro TV, Philips NTSC tuner.
pci0: <unknown card> (vendor=0x109e, dev=0x0878) at 18.1 irq 14

>Description:

When one is attempting to capture full frames of video in YUV, continuous
mode, the device driver will never signal the userland program when it has
captured a frame.  Yet it works fine with single fields, or RGB.

The problem is that the DMA program for YUV mode is generating extra 
interupts, which makes the driver think it has missed fields, so it does
not deliver any frames.  The RGB DMA program does not generate the extra
interupts.


>How-To-Repeat:

>Fix:


http://www.bobdbob.com/~tjohnson/software/bktrdiff.txt  (in case the mail
system dammages the diff file)


*** bktr_core.c.orig	Sat Nov 23 17:39:20 2002
--- bktr_core.c	Sat Nov 23 21:22:59 2002
***************
*** 806,812 ****
  
  	}
  
- 
  	/*
  	 *  Register the completed field
  	 *    (For dual-field mode, require fields from the same frame)
--- 806,811 ----
***************
*** 3080,3086 ****
  
  	/* contruct sync : for video packet format */
  	/* sync, mode indicator packed data */
! 	*dma_prog++ = OP_SYNC | 1 << 15 | BKTR_FM1;
  	*dma_prog++ = 0;  /* NULL WORD */
  
  	b = cols;
--- 3079,3085 ----
  
  	/* contruct sync : for video packet format */
  	/* sync, mode indicator packed data */
! 	*dma_prog++ = OP_SYNC | BKTR_RESYNC | BKTR_FM1;
  	*dma_prog++ = 0;  /* NULL WORD */
  
  	b = cols;
***************
*** 3096,3102 ****
  	switch (i_flag) {
  	case 1:
  		/* sync vre */
! 		*dma_prog++ = OP_SYNC  | 1 << 24 | BKTR_VRE;
  		*dma_prog++ = 0;  /* NULL WORD */
  
  		*dma_prog++ = OP_JUMP;
--- 3095,3101 ----
  	switch (i_flag) {
  	case 1:
  		/* sync vre */
! 		*dma_prog++ = OP_SYNC  | BKTR_GEN_IRQ | BKTR_VRE;
  		*dma_prog++ = 0;  /* NULL WORD */
  
  		*dma_prog++ = OP_JUMP;
***************
*** 3105,3111 ****
  
  	case 2:
  		/* sync vro */
! 		*dma_prog++ = OP_SYNC  | 1 << 24 | BKTR_VRO;
  		*dma_prog++ = 0;  /* NULL WORD */
  		*dma_prog++ = OP_JUMP;
  		*dma_prog++ = (u_long ) vtophys(bktr->dma_prog);
--- 3104,3110 ----
  
  	case 2:
  		/* sync vro */
! 		*dma_prog++ = OP_SYNC  | BKTR_GEN_IRQ | BKTR_VRO;
  		*dma_prog++ = 0;  /* NULL WORD */
  		*dma_prog++ = OP_JUMP;
  		*dma_prog++ = (u_long ) vtophys(bktr->dma_prog);
***************
*** 3113,3119 ****
  
  	case 3:
  		/* sync vro */
! 		*dma_prog++ = OP_SYNC	 | 1 << 24 | 1 << 15 | BKTR_VRO;
  		*dma_prog++ = 0;  /* NULL WORD */
  		*dma_prog++ = OP_JUMP  ;
  		*dma_prog = (u_long ) vtophys(bktr->odd_dma_prog);
--- 3112,3118 ----
  
  	case 3:
  		/* sync vro */
! 		*dma_prog++ = OP_SYNC | BKTR_GEN_IRQ | BKTR_RESYNC | BKTR_VRO;
  		*dma_prog++ = 0;  /* NULL WORD */
  		*dma_prog++ = OP_JUMP  ;
  		*dma_prog = (u_long ) vtophys(bktr->odd_dma_prog);
***************
*** 3127,3133 ****
  		dma_prog = (u_long * ) bktr->odd_dma_prog;
  
  		/* sync vre */
! 		*dma_prog++ = OP_SYNC | 1 << 24 |  1 << 15 | BKTR_FM1;
  		*dma_prog++ = 0;  /* NULL WORD */
  
  		for (i = 0; i < (rows/interlace) ; i++) {
--- 3126,3132 ----
  		dma_prog = (u_long * ) bktr->odd_dma_prog;
  
  		/* sync vre */
! 		*dma_prog++ = OP_SYNC | BKTR_RESYNC | BKTR_FM1;
  		*dma_prog++ = 0;  /* NULL WORD */
  
  		for (i = 0; i < (rows/interlace) ; i++) {
***************
*** 3140,3146 ****
  	}
  
  	/* sync vro IRQ bit */
! 	*dma_prog++ = OP_SYNC   |  1 << 24  | 1 << 15 |  BKTR_VRE;
  	*dma_prog++ = 0;  /* NULL WORD */
  	*dma_prog++ = OP_JUMP ;
  	*dma_prog++ = (u_long ) vtophys(bktr->dma_prog);
--- 3139,3145 ----
  	}
  
  	/* sync vro IRQ bit */
! 	*dma_prog++ = OP_SYNC   |  BKTR_GEN_IRQ  | BKTR_RESYNC |  BKTR_VRE;
  	*dma_prog++ = 0;  /* NULL WORD */
  	*dma_prog++ = OP_JUMP ;
  	*dma_prog++ = (u_long ) vtophys(bktr->dma_prog);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->roger 
Responsible-Changed-By: johan 
Responsible-Changed-When: Fri Nov 29 12:40:04 PST 2002 
Responsible-Changed-Why:  
Over to bktr maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45678 
State-Changed-From-To: open->closed 
State-Changed-By: roger 
State-Changed-When: Sat Dec 7 01:08:28 PST 2002 
State-Changed-Why:  
Patch has been applied to -current in time for FreeBSB 5.0 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45678 
>Unformatted:
