From b44b530d369cefef4f676f119fabf65cdf430f0b Mon Sep 17 00:00:00 2001 From: joerg Date: Wed, 8 Feb 2006 17:18:53 +0000 Subject: Add DragonFly support. --- graphics/vid/distinfo | 4 ++-- graphics/vid/patches/patch-ab | 52 +++++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 21 deletions(-) (limited to 'graphics/vid') diff --git a/graphics/vid/distinfo b/graphics/vid/distinfo index 95d54f723b7..679195abd27 100644 --- a/graphics/vid/distinfo +++ b/graphics/vid/distinfo @@ -1,7 +1,7 @@ -$NetBSD: distinfo,v 1.6 2005/03/15 16:17:44 rillig Exp $ +$NetBSD: distinfo,v 1.7 2006/02/08 17:18:53 joerg Exp $ SHA1 (vid-1.0.1.tar.gz) = 4967f9d02429f9202ea879c051c736d112856063 RMD160 (vid-1.0.1.tar.gz) = 5e06bd923506fbd2978e3a05f98b6315c1ed5fd0 Size (vid-1.0.1.tar.gz) = 13986 bytes SHA1 (patch-aa) = b9856144dcdd456387506bcf4d81f240191ea964 -SHA1 (patch-ab) = c36d321b9fdf018f0eed7158b3750c2152ee4e53 +SHA1 (patch-ab) = 0d8a3f261d13f3e34df343ec23c1752adeb19902 diff --git a/graphics/vid/patches/patch-ab b/graphics/vid/patches/patch-ab index d4f7937a87a..e38fa9d6488 100644 --- a/graphics/vid/patches/patch-ab +++ b/graphics/vid/patches/patch-ab @@ -1,8 +1,20 @@ -$NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ +$NetBSD: patch-ab,v 1.4 2006/02/08 17:18:53 joerg Exp $ ---- vid.c.orig Mon May 8 13:59:03 2000 +--- vid.c.orig 2000-05-08 04:59:03.000000000 +0000 +++ vid.c -@@ -48,6 +48,8 @@ +@@ -35,7 +35,11 @@ + #include + #include + ++#if defined(__DragonFly__) ++#include ++#else + #include ++#endif + + #include + +@@ -48,6 +52,8 @@ ov511_reg_read(int fd, int reg) { struct usb_ctl_request ur; unsigned char data[1024]; @@ -11,7 +23,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ ur.request.bmRequestType = UT_READ_VENDOR_INTERFACE; ur.request.bRequest = 2; -@@ -57,6 +59,17 @@ +@@ -57,6 +63,17 @@ ov511_reg_read(int fd, int reg) { ur.data = data; ur.flags = 0; ur.actlen = 0; @@ -29,7 +41,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ if(ioctl(fd, USB_DO_REQUEST, &ur) < 0) { return -1; -@@ -72,6 +85,8 @@ +@@ -72,6 +89,8 @@ ov511_reg_write(int fd, int reg, int val data[0] = val; @@ -38,14 +50,15 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ ur.request.bmRequestType = UT_WRITE_VENDOR_INTERFACE; ur.request.bRequest = 2; -@@ -81,7 +96,17 @@ +@@ -81,7 +100,17 @@ ov511_reg_write(int fd, int reg, int val ur.data = data; ur.flags = 0; ur.actlen = 0; +- +#else + ur.ucr_request.bmRequestType = UT_WRITE_VENDOR_INTERFACE; + ur.ucr_request.bRequest = 2; - ++ + USETW(ur.ucr_request.wValue, 0); /* unused */ + USETW(ur.ucr_request.wIndex, reg); /* index */ + USETW(ur.ucr_request.wLength, 1); /* payload len in bytes */ @@ -56,7 +69,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ if(ioctl(fd, USB_DO_REQUEST, &ur) < 0) { return -1; } -@@ -217,12 +242,15 @@ +@@ -217,12 +246,15 @@ main(int argc, char *argv[]) { struct vidstate vs; /* current read state */ int small = 0; /* use 320x240 */ int frmnm = 0; /* cyclic frame number key */ @@ -73,7 +86,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ "\nCopyright 2000 Peter S. Housel" "\nThis program is free software; " "you may redistribute it under the terms of" -@@ -235,14 +263,14 @@ +@@ -235,14 +267,14 @@ main(int argc, char *argv[]) { exit(0); } else if(strcmp(*argv, "--help") == 0) { fprintf(stderr, "usage: vid [options]\n" @@ -90,7 +103,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ exit(0); } else if(strcmp(*argv, "--small") == 0) { small = 1; -@@ -287,18 +315,33 @@ +@@ -287,18 +319,33 @@ main(int argc, char *argv[]) { exit(1); } @@ -117,17 +130,17 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ if((fd = open(dev, O_RDWR)) < 0) continue; +#if !defined(USB_STACK_VERSION) ||(USB_STACK_VERSION < 2) - if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0 -- || udi.vendorNo != 0x05A9 || udi.productNo != 0x0511) { ++ if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0 + || udi.vendorNo != 0x05A9 || udi.productNo != 0x0511 && udi.productNo != 0xa511) { +#else -+ if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0 + if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0 +- || udi.vendorNo != 0x05A9 || udi.productNo != 0x0511) { + || udi.udi_vendorNo != 0x05A9 || udi.udi_productNo != 0x0511 && udi.udi_productNo != 0xa511) { +#endif close(fd); fd = -1; continue; -@@ -308,12 +351,18 @@ +@@ -308,12 +355,18 @@ main(int argc, char *argv[]) { } if(fd < 0) { @@ -147,7 +160,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ /* reset the OV511 */ if(ov511_reg_write(fd, OV511_REG_RST, 0x7f) < 0) -@@ -398,23 +447,56 @@ +@@ -398,23 +451,56 @@ main(int argc, char *argv[]) { if(ov511_reg_write(fd, OV511_REG_CE_EN, 0x0) < 0) exit(1); @@ -220,7 +233,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ if(small) { vs.width = 320; -@@ -442,14 +524,19 @@ +@@ -442,14 +528,19 @@ main(int argc, char *argv[]) { ov511_reg_write(fd, OV511_REG_LNDV, 0x00); /* set FIFO format (993-byte packets) */ @@ -242,7 +255,7 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ if(ioctl(fd, USB_SET_ALTINTERFACE, &alt) < 0) { perror("USB_SET_ALTINTERFACE"); exit(1); -@@ -468,42 +555,49 @@ +@@ -468,43 +559,50 @@ main(int argc, char *argv[]) { vs.xels = pnm_allocarray(vs.width, vs.height); /* open the isochronous endpoint (endpoint 1) */ @@ -300,9 +313,10 @@ $NetBSD: patch-ab,v 1.3 2002/06/23 15:22:57 kent Exp $ frmnm = 1; } } -+ + + /* reset and close the OV511 */ + ov511_reg_write(fd, OV511_REG_RST, 0x7f); - ++ close(isoc); close(fd); + -- cgit v1.2.3