Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Apr 2005 16:22:53 -0700
From:      Jacob Meuser <jakemsr@jakemsr.com>
To:        freebsd-multimedia@freebsd.org
Subject:   patch for bktr(4): better luma notch filter ioctls
Message-ID:  <20050423232253.GA17807@puff.jakemsr.gom>

next in thread | raw e-mail | index | archive | help
the current luma notch interface does not jive with the datasheet,
and it really doesn't seem to work as expected. instead of changing
the bahaviour of the current ioctls and potentially breaking
programs, add new ioctls.

-- 
<jakemsr@jakemsr.com>

Index: bktr_core.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/bktr/bktr_core.c,v
retrieving revision 1.138
diff -u -r1.138 bktr_core.c
--- bktr_core.c	9 Jan 2005 17:42:03 -0000	1.138
+++ bktr_core.c	23 Apr 2005 23:17:46 -0000
@@ -2160,6 +2160,23 @@
 		*(int *)arg = (int) ( (INB(bktr, BKTR_E_CONTROL) & 0xe0) >> 5) ;
 		break;
 
+	/* According to the datasheet, 0, 8, 16, and 32 are only the valid
+	 * arguments.  However, 0 and 32 seem to do the same thing, and 24
+	 * does both 8 (low luma cutoff) and 16 (swap U and V).
+	 */
+	case BT848_SLNOTCH2:	/* set luma notch */
+		tmp_int = (*(int *)arg & 0x3) << 3;
+		OUTB(bktr, BKTR_E_CONTROL,
+		    INB(bktr, BKTR_E_CONTROL) & ~BT848_E_CONTROL_LNOTCH);
+		OUTB(bktr, BKTR_O_CONTROL,
+		    INB(bktr, BKTR_O_CONTROL) & ~BT848_O_CONTROL_LNOTCH);
+		OUTB(bktr, BKTR_E_CONTROL, (tmp_int | BT848_E_CONTROL_LNOTCH));
+		OUTB(bktr, BKTR_O_CONTROL, (tmp_int | BT848_O_CONTROL_LNOTCH));
+
+	case BT848_GLNOTCH2:	/* get luma notch */
+		*(int *)arg = (int) ((INB(bktr,
+		    BKTR_E_CONTROL) & ~BT848_E_CONTROL_LNOTCH) >> 3 & 0x3);
+		break;
 
 	/*  */
 	case BT848_SCONT:	/* set contrast */
Index: ioctl_bt848.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/bktr/ioctl_bt848.h,v
retrieving revision 1.30
diff -u -r1.30 ioctl_bt848.h
--- ioctl_bt848.h	20 Dec 2003 17:12:25 -0000	1.30
+++ ioctl_bt848.h	23 Apr 2005 23:17:46 -0000
@@ -141,6 +141,9 @@
 #define BT848_SLNOTCH	_IOW('x', 55, int)		/* set luma notch */
 #define BT848_GLNOTCH	_IOR('x', 56, int)		/* get luma notch */
 
+#define BT848_SLNOTCH2	_IOW('x', 79, int)		/* set luma notch */
+#define BT848_GLNOTCH2	_IOR('x', 79, int)		/* get luma notch */
+
 /* Read/Write the BT848's I2C bus directly
  * b7-b0:    data (read/write)
  * b15-b8:   internal peripheral register (write)   


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