summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-queue.c
AgeCommit message (Collapse)Author
2009-04-15cx18: Simplify the work handler for outgoing mailbox commandsAndy Walls
From: Andy Walls <awalls@radix.net> Simplify the way outgoing work handler gets scheduled to send empty buffers back to the firmware for use. Also reduced the memory required for scheduling this outgoing work, by using a single, per stream work object. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2009-04-13cx18: Convert per stream mutex locks to per queue spin locksAndy Walls
From: Andy Walls <awalls@radix.net> To avoid sleeps in providing buffers to user space and in handling incoming buffers from the capture unit, converted the per stream mutex for locking queues to 3 spin locks. There is now a spin lock per queue to increase concurrency when moving buffers around. Also simplified queue manipulations and buffer handling of incoming buffers of data from the capture unit. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2009-01-10cx18: Rename structure members: dev to pci_dev and v4l2dev to video_devAndy Walls
From: Andy Walls <awalls@radix.net> Renamed structure member name to be more specific to type in anticipation of updating to the v4l2_device/v4l2_subdev framework. Too many objects named "dev" and /v4l2_\{0,1\}dev/ would be to confusing. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-12-14cx18: Convert some list manipulations to emphasize entries not listsAndy Walls
From: Andy Walls <awalls@radix.net> Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-12-14cx18 Replace magic number 63 with CX18_MAX_FW_MDLS_PER_STREAMAndy Walls
From: Andy Walls <awalls@radix.net> Removed magic number that referred to firmware limit on the number of MDLs the firmware can maintain for any stream at any one time. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-12-12cx18: Avoid making firmware API calls with the queue lock heldAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Avoid making firmware API calls with the queue lock held. The source of MPEG strem corruption when not holding the queue lock was found to be that the MPEG buffer could be retrieved by the user app before it was sync'ed for the host cpu. Incoming buffers are now sync'ed before being put on q_full and releasing the queue lock. We can thus avoid the sometimes lengthy call to the firmware for CPU_DE_SET_MDL while holding the queue lock, so we can get better performance. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-12-08cx18: Allow more than 63 capture buffers in rotation per streamAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Allow more than 63 capture buffers in rotation per stream. Implement q_busy to hold buffers the firmware has for use. q_free holds truly unused buffers in a pool. New buffers are given to the firmware as soon as the firmware returns one, if there are any to give to the firmware. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-27cx18: Eliminate q_io from stream buffer handlingAndy Walls
From: Andy Walls <awalls@radix.net> Eliminate q_io from stream buffer handling in anticipation of upcoming changes in buffer handling. q_io was a holdover from ivtv and it's function in cx18 was trivial and not necessary. We just push things back onto the front of q_full now, instead of maintaining a 1 buffer q_io queue. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-21cx18: Copyright attribution update for files modified by awallsAndy Walls
From: Andy Walls <awalls@radix.net> Add copyright attribution for files modified by awalls in 2008 Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-18cx18: Restore buffers that have fallen out of the transfer rotationAndy Walls
From: Andy Walls <awalls@radix.net> Restore buffers that have fallen out of the transfer rotation, and check for coherent mailbox data when processing a stale mailbox. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-16cx18: Convert per stream queue spinlocks into mutexesAndy Walls
From: Andy Walls <awalls@radix.net> Convert the per stream queue spinlocks into mutexes. All queue manipulation happens via the work queue or system calls into the driver, and not in an interrupt context. This reduces the amout of time the cx18 driver keeps interrupts disabled. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-15cx18: Major rewrite of interrupt handling for incoming mailbox processingAndy Walls
From: Andy Walls <awalls@radix.net> A major rewrite of interrupt handling for incoming mailbox processing, to split the timing critical steps from the the deferrable steps as the sending XPU on the CX23418 will time out and overwrite our incoming mailboxes rather quickly. Setup a pool of work "order forms" for the irq handler to send jobs to the new work handler routine which uses the kernel default work queue to do the deferrable work. Started optimizing some of the cx18-io calls as they are now the low hanging fruit for recoving microseconds back from the timeline. Future optimizations will get rid of mmio read retries, mmio stats logging, and combine smaller functions in the irq path into the larger ones to save ~2 us each. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-04cx18: Move DVB buffer transfer handling from irq handler to work_queueAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Move DVB buffer transfer handling from irq handler to work_queue thread. In order to properly lock the epu2cpu mailbox for driver to CX23418 commands, the DVB/TS buffer handling needs to be moved from the IRQ handler and IRQ context to a work queue. This work_queue implmentation is strikingly similar to the ivtv implementation - for better or worse. Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-08-29merge: http://linuxtv.org/hg/~awalls/v4l-dvbMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-08-22cx18: Convert cx18_queue buffers member to atomic_tAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Convert cx18_queue buffers member to atomic_t. This allows safe concurrent access to check if a queue has data without having to acquire the queue spinlock. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-08-22cx18: Remove redundant struct cx18_queue length member.Andy Walls
From: Andy Walls <awalls@radix.net> cx18: Remove redundant struct cx18_queue length member. It can be trivially computed from queue->buffers * stream->buf_size, if ever really needed. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-08-22cx18: Simplify queue flush logic to prevent oops in cx18_flush_queues()Andy Walls
From: Andy Walls <awalls@radix.net> cx18: Simplify queue flush logic to prevent oops in cx18_flush_queues(). If accounting of a queue is in error, logic borrowed from ivtv will cause an oops when flushing the queues for a stream. This change greatly simplifies the queue flush logic, and sets the queue back to sane defaults on a flush. Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-08-23v4l-dvb: fix a bunch of sparse warningsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Fixed a lot of sparse warnings: mostly warnings about shadowed variables and signed/unsigned mismatches. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-17cx18: Add missing lock for when the irq handler manipulates the queuesAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Add missing lock for when the irq handler manipulates the queues. This was a potential source of stream queue corruption. Also changed the name of cx18_queue_find_buf() to cx18_queue_get_buf_irq(). Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-05-05 cx18/: possible cleanupsMauro Carvalho Chehab
From: Adrian Bunk <bunk@kernel.org> This patch contains the following possible cleanups: - cx18-i2c.c should #include "cx18-i2c.h" for getting the prototypes of it's global functions - make the following needlessly global functions static: - cx18-fileops.c:cx18_claim_stream() - cx18-fileops.c:cx18_release_stream() - cx18-queue.c:cx18_queue_move() - remove the following unused functions: - cx18-driver.c:cx18_waitq() - cx18-queue.c:cx18_buf_copy_from_user() Signed-off-by: Adrian Bunk <bunk@kernel.org> Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-01cx18/ivtv: improve and fix out-of-memory handlingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - don't show kernel backtrace when the allocation of the buffers fails: the normal ivtv/cx18 messages are clear enough and the backtrace scares users. - fix cleanup after the buffer allocation fails (caused kernel panic). Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-04-28cx18: new driver for the Conexant CX23418 MPEG encoder chipHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Many thanks to Steve Toth from Hauppauge and Nattu Dakshinamurthy from Conexant for their support. I am in particular thankful to Hauppauge since without their help this driver would not exist. It should also be noted that Steve did the work to get the DVB part up and running. Thank you! Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: G. Andrew Walls <awalls@radix.net>