Thread: [Linux1394-cvslog] rev 657 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <dm...@li...> - 2002-10-29 03:19:44
|
Author: dmaas Date: 2002-10-28 22:19:41 -0500 (Mon, 28 Oct 2002) New Revision: 657 Modified: trunk/raw1394.c Log: rawiso merge part 5 - last one - change raw1394 poll() to return POLLPRI for isochronous activity. There is a slight chance this could break some existing applications - if they (incorrectly) assume that POLLPRI or an exception return from select() means there are pending read events, they could end up stuck in raw1394_loop_iterate(). If that happens, we need to find another way to signal isochronous activity. Modified: trunk/raw1394.c ============================================================================== --- trunk/raw1394.c (original) +++ trunk/raw1394.c 2002-10-28 22:19:42.000000000 -0500 @@ -2157,6 +2157,15 @@ return -EINVAL; } +/* Queued read() events and isochronous readiness are two completely + * independent sources of input. We must provide unique POLL values + * for each, so that libraw can distinguish between them. Older versions + * of libraw expect POLLIN to mean only that a read() event is pending. + * So, we have to use something other than POLLIN. The best choice seems + * to be POLLPRI ("urgent out-of-band input") - which also allows us + * to support select(), since POLLPRI signals "exception" activity + */ + static unsigned int raw1394_poll(struct file *file, poll_table *pt) { struct file_info *fi = file->private_data; @@ -2164,12 +2173,19 @@ poll_wait(file, &fi->poll_wait_complete, pt); + /* check for pending read() events */ spin_lock_irq(&fi->reqlists_lock); if (!list_empty(&fi->req_complete)) { mask |= POLLIN | POLLRDNORM; } spin_unlock_irq(&fi->reqlists_lock); + /* check for isochronous activity */ + if(fi->iso_state != RAW1394_ISO_INACTIVE) { + if(hpsb_iso_n_ready(fi->iso_handle) > 0) + mask |= POLLPRI; + } + return mask; } |