ioctl_meteor.h revision 205781
133965Sjdp/*- 2104834Sobrien * Copyright (c) 1995 Mark Tinguely and Jim Lowe 377298Sobrien * All rights reserved. 433965Sjdp * 533965Sjdp * Redistribution and use in source and binary forms, with or without 633965Sjdp * modification, are permitted provided that the following conditions 733965Sjdp * are met: 833965Sjdp * 1. Redistributions of source code must retain the above copyright 933965Sjdp * notice, this list of conditions and the following disclaimer. 1033965Sjdp * 2. Redistributions in binary form must reproduce the above copyright 1133965Sjdp * notice, this list of conditions and the following disclaimer in the 1233965Sjdp * documentation and/or other materials provided with the distribution. 1333965Sjdp * 3. All advertising materials mentioning features or use of this software 1433965Sjdp * must display the following acknowledgement: 1533965Sjdp * This product includes software developed by Mark Tinguely and Jim Lowe 1633965Sjdp * 4. The name of the author may not be used to endorse or promote products 1733965Sjdp * derived from this software without specific prior written permission. 1860484Sobrien * 1960484Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2060484Sobrien * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 2133965Sjdp * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 2233965Sjdp * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 2333965Sjdp * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 2433965Sjdp * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 2533965Sjdp * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2677298Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 2733965Sjdp * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28104834Sobrien * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2933965Sjdp * POSSIBILITY OF SUCH DAMAGE. 3060484Sobrien * 3133965Sjdp * $FreeBSD: head/sys/dev/bktr/ioctl_meteor.h 205781 2010-03-28 00:10:09Z gibbs $ 3233965Sjdp */ 3377298Sobrien/* 3433965Sjdp * ioctl constants for Matrox Meteor Capture card. 3533965Sjdp */ 3633965Sjdp 3733965Sjdp#ifndef _DEV_BKTR_IOCTL_METEOR_H_ 3833965Sjdp#define _DEV_BKTR_IOCTL_METEOR_H_ 3933965Sjdp 4033965Sjdp#ifndef _KERNEL 4178828Sobrien#include <sys/types.h> 4233965Sjdp#endif 4333965Sjdp#include <sys/ioccom.h> 4433965Sjdp 4560484Sobrienstruct meteor_capframe { 4633965Sjdp short command; /* see below for valid METEORCAPFRM commands */ 4733965Sjdp short lowat; /* start transfer if < this number */ 4833965Sjdp short hiwat; /* stop transfer if > this number */ 4977298Sobrien} ; 5033965Sjdp 5133965Sjdp/* structure for METEOR[GS]ETGEO - get/set geometry */ 5233965Sjdpstruct meteor_geomet { 5333965Sjdp unsigned short rows; 5433965Sjdp unsigned short columns; 5533965Sjdp unsigned short frames; 5633965Sjdp unsigned long oformat; 5733965Sjdp} ; 5833965Sjdp 5933965Sjdp/* structure for METEORGCOUNT-get count of frames, fifo errors and dma errors */ 6033965Sjdpstruct meteor_counts { 6133965Sjdp unsigned long fifo_errors; /* count of fifo errors since open */ 6233965Sjdp unsigned long dma_errors; /* count of dma errors since open */ 6333965Sjdp unsigned long frames_captured; /* count of frames captured since open */ 64104834Sobrien unsigned long even_fields_captured; /* count of even fields captured */ 6533965Sjdp unsigned long odd_fields_captured; /* count of odd fields captured */ 6633965Sjdp} ; 6733965Sjdp 6833965Sjdp/* structure for getting and setting direct transfers to vram */ 6977298Sobrienstruct meteor_video { 7033965Sjdp unsigned long addr; /* Address of location to dma to */ 7133965Sjdp unsigned long width; /* Width of memory area */ 7233965Sjdp unsigned long banksize; /* Size of Vram bank */ 73104834Sobrien unsigned long ramsize; /* Size of Vram */ 7433965Sjdp}; 7533965Sjdp 7633965Sjdp#define METEORCAPTUR _IOW('x', 1, int) /* capture a frame */ 7733965Sjdp#define METEORCAPFRM _IOW('x', 2, struct meteor_capframe) /* sync capture */ 78104834Sobrien#define METEORSETGEO _IOW('x', 3, struct meteor_geomet) /* set geometry */ 7933965Sjdp#define METEORGETGEO _IOR('x', 4, struct meteor_geomet) /* get geometry */ 8033965Sjdp#define METEORSTATUS _IOR('x', 5, unsigned short) /* get status */ 8133965Sjdp#define METEORSHUE _IOW('x', 6, signed char) /* set hue */ 8233965Sjdp#define METEORGHUE _IOR('x', 6, signed char) /* get hue */ 8333965Sjdp#define METEORSFMT _IOW('x', 7, unsigned long) /* set format */ 8433965Sjdp#define METEORGFMT _IOR('x', 7, unsigned long) /* get format */ 8560484Sobrien#define METEORSINPUT _IOW('x', 8, unsigned long) /* set input dev */ 8660484Sobrien#define METEORGINPUT _IOR('x', 8, unsigned long) /* get input dev */ 8760484Sobrien#define METEORSCHCV _IOW('x', 9, unsigned char) /* set uv gain */ 8860484Sobrien#define METEORGCHCV _IOR('x', 9, unsigned char) /* get uv gain */ 8960484Sobrien#define METEORSCOUNT _IOW('x',10, struct meteor_counts) 9033965Sjdp#define METEORGCOUNT _IOR('x',10, struct meteor_counts) 9133965Sjdp#define METEORSFPS _IOW('x',11, unsigned short) /* set fps */ 92104834Sobrien#define METEORGFPS _IOR('x',11, unsigned short) /* get fps */ 93104834Sobrien#define METEORSSIGNAL _IOW('x', 12, unsigned int) /* set signal */ 94104834Sobrien#define METEORGSIGNAL _IOR('x', 12, unsigned int) /* get signal */ 95104834Sobrien#define METEORSVIDEO _IOW('x', 13, struct meteor_video) /* set video */ 96104834Sobrien#define METEORGVIDEO _IOR('x', 13, struct meteor_video) /* get video */ 97104834Sobrien#define METEORSBRIG _IOW('x', 14, unsigned char) /* set brightness */ 98104834Sobrien#define METEORGBRIG _IOR('x', 14, unsigned char) /* get brightness */ 99104834Sobrien#define METEORSCSAT _IOW('x', 15, unsigned char) /* set chroma sat */ 100104834Sobrien#define METEORGCSAT _IOR('x', 15, unsigned char) /* get uv saturation */ 101104834Sobrien#define METEORSCONT _IOW('x', 16, unsigned char) /* set contrast */ 102104834Sobrien#define METEORGCONT _IOR('x', 16, unsigned char) /* get contrast */ 103104834Sobrien#define METEORSBT254 _IOW('x', 17, unsigned short) /* set Bt254 reg */ 10433965Sjdp#define METEORGBT254 _IOR('x', 17, unsigned short) /* get Bt254 reg */ 105104834Sobrien#define METEORSHWS _IOW('x', 18, unsigned char) /* set hor start reg */ 10633965Sjdp#define METEORGHWS _IOR('x', 18, unsigned char) /* get hor start reg */ 10733965Sjdp#define METEORSVWS _IOW('x', 19, unsigned char) /* set vert start reg */ 10833965Sjdp#define METEORGVWS _IOR('x', 19, unsigned char) /* get vert start reg */ 10933965Sjdp#define METEORSTS _IOW('x', 20, unsigned char) /* set time stamp */ 11033965Sjdp#define METEORGTS _IOR('x', 20, unsigned char) /* get time stamp */ 11133965Sjdp 11233965Sjdp#define METEOR_STATUS_ID_MASK 0xf000 /* ID of 7196 */ 11333965Sjdp#define METEOR_STATUS_DIR 0x0800 /* Direction of Expansion port YUV */ 11433965Sjdp#define METEOR_STATUS_OEF 0x0200 /* Field detected: Even/Odd */ 115104834Sobrien#define METEOR_STATUS_SVP 0x0100 /* State of VRAM Port:inactive/active */ 116104834Sobrien#define METEOR_STATUS_STTC 0x0080 /* Time Constant: TV/VCR */ 11733965Sjdp#define METEOR_STATUS_HCLK 0x0040 /* Horiz PLL: locked/unlocked */ 11860484Sobrien#define METEOR_STATUS_FIDT 0x0020 /* Field detect: 50/60hz */ 11933965Sjdp#define METEOR_STATUS_ALTD 0x0002 /* Line alt: no line alt/line alt */ 12033965Sjdp#define METEOR_STATUS_CODE 0x0001 /* Colour info: no colour/colour */ 12177298Sobrien 122104834Sobrien /* METEORCAPTUR capture options */ 123104834Sobrien#define METEOR_CAP_SINGLE 0x0001 /* capture one frame */ 12477298Sobrien#define METEOR_CAP_CONTINOUS 0x0002 /* continuously capture */ 125104834Sobrien#define METEOR_CAP_STOP_CONT 0x0004 /* stop the continuous capture */ 12633965Sjdp 12733965Sjdp /* METEORCAPFRM capture commands */ 128#define METEOR_CAP_N_FRAMES 0x0001 /* capture N frames */ 129#define METEOR_CAP_STOP_FRAMES 0x0002 /* stop capture N frames */ 130#define METEOR_HALT_N_FRAMES 0x0003 /* halt of capture N frames */ 131#define METEOR_CONT_N_FRAMES 0x0004 /* continue after above halt */ 132 133 /* valid video input formats: */ 134#define METEOR_FMT_NTSC 0x00100 /* NTSC -- initialized default */ 135#define METEOR_FMT_PAL 0x00200 /* PAL */ 136#define METEOR_FMT_SECAM 0x00400 /* SECAM */ 137#define METEOR_FMT_AUTOMODE 0x00800 /* auto-mode */ 138#define METEOR_INPUT_DEV0 0x01000 /* camera input 0 -- default */ 139#define METEOR_INPUT_DEV_RCA METEOR_INPUT_DEV0 140#define METEOR_INPUT_DEV1 0x02000 /* camera input 1 */ 141#define METEOR_INPUT_DEV2 0x04000 /* camera input 2 */ 142#define METEOR_INPUT_DEV3 0x08000 /* camera input 3 */ 143#define METEOR_INPUT_DEV_RGB 0x0a000 /* for rgb version of meteor */ 144#define METEOR_INPUT_DEV_SVIDEO 0x06000 /* S-video input port */ 145 146 /* valid video output formats: */ 147#define METEOR_GEO_RGB16 0x0010000 /* packed -- initialized default */ 148#define METEOR_GEO_RGB24 0x0020000 /* RBG 24 bits packed */ 149 /* internally stored in 32 bits */ 150#define METEOR_GEO_YUV_PACKED 0x0040000 /* 4-2-2 YUV 16 bits packed */ 151#define METEOR_GEO_YUV_PLANAR 0x0080000 /* 4-2-2 YUV 16 bits planer */ 152#define METEOR_GEO_YUV_PLANER METEOR_GEO_YUV_PLANAR 153#define METEOR_GEO_UNSIGNED 0x0400000 /* unsigned uv outputs */ 154#define METEOR_GEO_EVEN_ONLY 0x1000000 /* set for even only field capture */ 155#define METEOR_GEO_ODD_ONLY 0x2000000 /* set for odd only field capture */ 156#define METEOR_GEO_FIELD_MASK 0x3000000 157#define METEOR_GEO_YUV_422 0x4000000 /* 4-2-2 YUV in Y-U-V combined */ 158#define METEOR_GEO_OUTPUT_MASK 0x40f0000 159#define METEOR_GEO_YUV_12 0x10000000 /* YUV 12 format */ 160#define METEOR_GEO_YUV_9 0x40000000 /* YUV 9 format */ 161 162#define METEOR_FIELD_MODE 0x80000000 /* Field cap or Frame cap */ 163 164#define METEOR_SIG_MODE_MASK 0xffff0000 165#define METEOR_SIG_FRAME 0x00000000 /* signal every frame */ 166#define METEOR_SIG_FIELD 0x00010000 /* signal every field */ 167 168 /* following structure is used to coordinate the synchronous */ 169 170struct meteor_mem { 171 /* kernel write only */ 172 int frame_size; /* row*columns*depth */ 173 unsigned num_bufs; /* number of frames in buffer (1-32) */ 174 /* user and kernel change these */ 175 int lowat; /* kernel starts capture if < this number */ 176 int hiwat; /* kernel stops capture if > this number. 177 hiwat <= numbufs */ 178 unsigned active; /* bit mask of active frame buffers 179 kernel sets, user clears */ 180 int num_active_bufs; /* count of active frame buffer 181 kernel increments, user decrements */ 182 183 /* reference to mmapped data */ 184 caddr_t buf; /* The real space (virtual addr) */ 185} ; 186 187#endif /* !_DEV_BKTR_IOCTL_METEOR_H_ */ 188