pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/vid Add DragonFly support.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8c969a6fd2fc
branches:  trunk
changeset: 507805:8c969a6fd2fc
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Feb 08 17:18:53 2006 +0000

description:
Add DragonFly support.

diffstat:

 graphics/vid/distinfo         |   4 +-
 graphics/vid/patches/patch-ab |  52 +++++++++++++++++++++++++++---------------
 2 files changed, 35 insertions(+), 21 deletions(-)

diffs (165 lines):

diff -r 2e495c0cc8f6 -r 8c969a6fd2fc graphics/vid/distinfo
--- a/graphics/vid/distinfo     Wed Feb 08 17:08:04 2006 +0000
+++ b/graphics/vid/distinfo     Wed Feb 08 17:18:53 2006 +0000
@@ -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 -r 2e495c0cc8f6 -r 8c969a6fd2fc graphics/vid/patches/patch-ab
--- a/graphics/vid/patches/patch-ab     Wed Feb 08 17:08:04 2006 +0000
+++ b/graphics/vid/patches/patch-ab     Wed Feb 08 17:18:53 2006 +0000
@@ -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 <sys/types.h>
+ #include <sys/ioctl.h>
+ 
++#if defined(__DragonFly__)
++#include <bus/usb/usb.h>
++#else
+ #include <dev/usb/usb.h>
++#endif
+ 
+ #include <pnm.h>
+ 
+@@ -48,6 +52,8 @@ ov511_reg_read(int fd, int reg) {
    struct usb_ctl_request ur;
    unsigned char data[1024];
    
@@ -11,7 +23,7 @@
    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 @@
    
    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 @@
    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 @@
    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 @@
              "\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 @@
        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 @@
        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 && udi.productNo != 0xa511) {
++#else
        if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0
 -       || udi.vendorNo != 0x05A9 || udi.productNo != 0x0511) {
-+       || udi.vendorNo != 0x05A9 || udi.productNo != 0x0511 && udi.productNo != 0xa511) {
-+#else
-+      if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0
 +       || 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 @@
    
    /* 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 @@
  
    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 @@
    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 @@
        frmnm = 1;
      }
    }
-+
+ 
 +  /* reset and close the OV511 */
 +  ov511_reg_write(fd, OV511_REG_RST, 0x7f);
- 
++
    close(isoc);
    close(fd);
+ 



Home | Main Index | Thread Index | Old Index