Date: Sat, 22 Mar 1997 18:16:52 -0800 From: Amancio Hasty <hasty@rah.star-gate.com> To: Steve Passe <smp@csn.net> Cc: multimedia@freebsd.org Subject: Re: First Cut at separating tuner and capture devices Message-ID: <199703230216.SAA01151@rah.star-gate.com> In-Reply-To: Your message of "Sat, 22 Mar 1997 18:56:47 MST." <199703230156.SAA15808@Ilsa.StevesCafe.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Your suggestion is a good one so just cut an paste them to tuner_ioctl. This is a logical partition and not a physical partition which I did with my patch;however I understand the need to make the change. With respect to the matrox meteor we of course will break compatibility where as with my suggested changes we maintain full ioctl compatibility . Nevertheless, less go ahead an proceed on this path since I think is the appropriate course. So how does the hook works? int bktr_ioctl( dev_t dev, int cmd, caddr_t arg, int flag, struct proc *pr ) { bktr_reg_t *bktr; int unit; int status; int count; int tmp_int; volatile u_char *bt848, c_temp; volatile u_short *bts_reg, s_temp; volatile u_long *btl_reg; unsigned int temp, temp1; unsigned int error; struct meteor_geomet *geo; struct meteor_counts *cnt; struct meteor_video *video; vm_offset_t buf; unit = UNIT(minor(dev)); if (unit >= NBKTR) /* unit out of range */ return(ENXIO); ----- if (minor(dev) > 0 ) { return tuner_ioctl(minor(dev), cmd, arg, flag, pr); } ------ The minor device is greater than 0 so off it goes to the tuner section. Your main device is still 0 , 1, 2, etc.. so the device which the tuner code affects can be located. Lets see in open you get a device handle 0xff. The first 4 bits denotes the major device. The fifth bit flags that we are addressing the tuner device. Enjoy, Amancio >From The Desk Of Steve Passe : > Hi, > > patches apply cleanly. first problem I see is that to be practical > we will need to move all input control and color control into the tuner_ioctl : > > case METEORSINPUT: /* set input device */ > case METEOR_INPUT_DEV0: > case METEOR_INPUT_DEV1: > case METEOR_INPUT_DEV2: > case METEOR_INPUT_DEV_SVIDEO: > > case BT848_SHUE: /* set hue */ > case BT848_GHUE: /* get hue */ > case BT848_SBRIG: /* set brightness */ > case BT848_GBRIG: /* get brightness */ > case BT848_SCSAT: /* set chroma saturation */ > case BT848_GCSAT: /* get chroma saturation */ > case BT848_SVSAT: /* set chroma V saturation */ > case BT848_GVSAT: /* get chroma V saturation */ > case BT848_SUSAT: /* set chroma U saturation */ > case BT848_GUSAT: /* get chroma U saturation */ > case BT848_SCONT: /* set contrast */ > case BT848_GCONT: /* get contrast */ > > --- > can we do this, does it make any sense? > > where are the hooks to tuner_xxx in brooktree848.c? I don't see > where anything gets steered to them via the minor number? what am I > missing? > > > -- > Steve Passe | powered by > smp@csn.net | Symmetric MultiProcessor FreeBSD >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703230216.SAA01151>