Date: Sun, 5 Oct 1997 07:32:59 -0300 (EST) From: Joao Carlos Mendes Luis <jonny@coppe.ufrj.br> To: multimedia@FreeBSD.ORG Subject: Proposed patches to bt848 device Message-ID: <199710051032.HAA11806@gaia.coppe.ufrj.br>
next in thread | raw e-mail | index | archive | help
Hi,
Here are my proposed patches to the bt848 device driver to support
all video formats supported by the chip. I tested it with NTSC and
PAL/M, but cannot test it with other formats. Please test and send
reports. If there's no problem, I'd like to see it committed.
My system is a 2.2-stable from one or two weeks ago. I did not
see any changes to bt848 device on cvs lists, so it's probably the
same as 2.2.5-beta.
Bugs: I had to copy some data from brktree_reg.h to ioctl_bt848.h
Maybe this could be better rewritten.
Oh, I'll send patches to fxtv right after this.
Jonny
--
Joao Carlos Mendes Luis jonny@gta.ufrj.br
+55 21 290-4698 jonny@coppe.ufrj.br
Universidade Federal do Rio de Janeiro UFRJ/COPPE/CISI
PGP fingerprint: 29 C0 50 B9 B6 3E 58 F2 83 5F E3 26 BF 0F EA 67
--- sys/pci/brooktree848.c.old Mon Sep 29 20:36:56 1997
+++ sys/pci/brooktree848.c Sun Oct 5 07:03:50 1997
@@ -1298,6 +1298,38 @@
*(u_short *)arg = temp;
break;
+ case BT848SFMT: /* set input format */
+ temp = *(unsigned long*)arg & BT848_IFORM_FORMAT;
+ bt848->iform &= ~BT848_IFORM_FORMAT;
+ bt848->iform |= temp;
+ switch( temp ) {
+ case BT848_IFORM_F_AUTO:
+ bktr->flags = (bktr->flags & ~METEOR_FORM_MASK) |
+ METEOR_AUTOMODE;
+ break;
+
+ case BT848_IFORM_F_NTSCM:
+ case BT848_IFORM_F_NTSCJ:
+ case BT848_IFORM_F_PALM:
+ bktr->flags = (bktr->flags & ~METEOR_FORM_MASK) |
+ METEOR_NTSC;
+ bt848->adelay = 0x68;
+ bt848->bdelay = 0x5d;
+ bktr->format_params = FORMAT_PARAMS_NTSC525;
+ break;
+
+ case BT848_IFORM_F_PALBDGHI:
+ case BT848_IFORM_F_PALN:
+ case BT848_IFORM_F_SECAM:
+ case BT848_IFORM_F_RSVD:
+ bktr->flags = (bktr->flags & ~METEOR_FORM_MASK) |
+ METEOR_PAL;
+ bt848->adelay = 0x7f;
+ bt848->bdelay = 0x72;
+ bktr->format_params = FORMAT_PARAMS_PAL625;
+ }
+ break;
+
case METEORSFMT: /* set input format */
switch(*(unsigned long *)arg & METEOR_FORM_MASK ) {
case 0: /* default */
@@ -1334,6 +1366,10 @@
case METEORGFMT: /* get input format */
*(u_long *)arg = bktr->flags & METEOR_FORM_MASK;
+ break;
+
+ case BT848GFMT: /* get input format */
+ *(u_long *)arg = bt848->iform & BT848_IFORM_FORMAT;
break;
case METEORSCOUNT: /* (re)set error counts */
--- sys/i386/include/ioctl_bt848.h.old Sun Oct 5 07:07:00 1997
+++ sys/i386/include/ioctl_bt848.h Sun Oct 5 05:36:20 1997
@@ -181,3 +181,19 @@
/* set clip list */
#define BT848SCLIP _IOW('x', 66, struct _bktr_clip )
#define BT848GCLIP _IOR('x', 66, struct _bktr_clip )
+
+/* set input format */
+#define BT848SFMT _IOW('x', 67, unsigned long )
+#define BT848GFMT _IOR('x', 67, unsigned long )
+
+/* XXX - Copied from /sys/pci/brktree_reg.h */
+#define BT848_IFORM_FORMAT (0x7<<0)
+# define BT848_IFORM_F_RSVD (0x7)
+# define BT848_IFORM_F_SECAM (0x6)
+# define BT848_IFORM_F_PALN (0x5)
+# define BT848_IFORM_F_PALM (0x4)
+# define BT848_IFORM_F_PALBDGHI (0x3)
+# define BT848_IFORM_F_NTSCJ (0x2)
+# define BT848_IFORM_F_NTSCM (0x1)
+# define BT848_IFORM_F_AUTO (0x0)
+
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710051032.HAA11806>
