summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-mailbox.c
AgeCommit message (Collapse)Author
2009-04-13cx18: Rename the work queue to "in_work_queue"Andy Walls
From: Andy Walls <awalls@radix.net> Rename the work queue to "in_work_queue" to indicate it is handling incoming mailbox commands. This is preparation for adding a work queue for handling deferrable outgoing mailbox commands. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2009-01-04cx18: Fix bad audio in first analog capture.Andy Walls
From: Andy Walls <awalls@radix.net> Normalize the APU state before the second firmware load so that audio for the first analog capture is correct. Many thanks to Conexant for supporting me in finding a solution for this problem. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2009-01-01cx18: Additional debug to display outgoing mailbox parametersAndy Walls
From: Andy Walls <awalls@radix.net> Added debug display of outgoing mailbox arguments. Fixed a minor problem with display of stale incoming mailbox contents, when user was not looking for debug warnings. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-12-14cx18: Refine the firmware load and firmware startup processAndy Walls
From: Andy Walls <awalls@radix.net> Refine the firmware load and firmware startup process. Significant changes are to ensure the SCB and IPC area are correct before starting up the firmware, and letting the CPU firmware start up the APU firmware for us. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-23cx18: Use a known open task handle when setting stream CX2341x parametersAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Use a known open task handle when setting stream CX2341x parameters Sometimes, we might only have VBI or YUV stream open instead of an MPEG stream. Let's make sure we use a valid task handle to perform the CX2341x control settings. 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-25cx18: Change to per CX23418 device work queues for deferrable work handlingAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Change to per CX23418 device work queues for deferrable work handling. Needed to support 2.6.22 and earlier kernels that can't selectively cancel work orders. Also will provide slightly better performance on SMP systems. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-23cx18: Quiet a sometimes common warning that often has benign consequencesAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Quiet a sometimes common warning that often has benign consequences. No one probably cares that the firmware took forever to ack our command, as they always seem to succeed whether or not the firmware acks it in a reasonable amount of time. 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-21cx18: Adjust outgoing mailbox timeouts and remove statistics loggingAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Adjust outgoing mailbox timeouts and remove statistics logging. This saves some wasted storage in struct cx18 for each card. Cutting the outgoing mailbox timeouts in half from the previous value appears to be safe with MythTV. Got rid of interrupted case code path after a wait uninterruptable returns. 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-17cx18: Remove unnecessary MMIO accesses in time critical irq handling pathAndy Walls
From: Andy Walls <awalls@radix.net> Remove unnecessary MMIO accesses in time critical irq handling path. Also ensured that the mailbox ack field is read in last, so we know for sure if we have a stale mailbox or not on receipt. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-16cx18: Propagate staleness of mailbox and mdl ack data to work handlerAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Propagate staleness of mailbox and mdl ack data to work handler to let the work handler know that the data from the encoder may not be coherent. Allows for smarter handling of buffers in future, to deal with MDLs that fall out of rotation due to irq handler being late in collecting mailbox and mdl ack info. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-16cx18: Change to singlethreaded global work queue thread for deferable workAndy Walls
From: Andy Walls <awalls@radix.net> Change to singlethreaded global work queue thread for deferable work, instead of the kernel default multithreaded work queue. This ensures execution of deferable work is always in the proper order, so caputred buffers don't get reordered. 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-08cx18: Further changes to improve mailbox protocol integrity & performnceAndy Walls
From: Andy Walls <awalls@radix.net> All waits for cx18 mailbox API commands are now uninterruptable. Added code to collect mailbox ack statistics. Tweaked timeouts based on collected stats and video vertical frame and field rates. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-07cx18: Improve handling of outgoing mailboxes detected to be busyAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Improve handling of outgoing mailboxes detected to be busy. When encountering a busy mailbox, sleep instead of polling, and wait for interrupt or timeout. If the mailbox is still busy, force it free. When sending commands, make sure we never create a situation where we mark the mailbox busy upon sending, and ensure we always have a method to cleanly recover from a busy mailbox. Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-05cx18: Add outgoing mailbox mutexes and check for ack via waitq vs pollAndy Walls
From: Andy Walls <awalls@radix.net> Add mutexes to ensure exclusive access for outgoing driver to CX23418 mailboxes. Also wait on a waitq for mailbox acknowledgement from the CX23418 instead of polling. Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-11-01cx18: Mark CX18_CPU_DE_RELEASE_MDL as a slow API callAndy Walls
From: Andy Walls <awalls@radix.net> cx18: Mark CX18_CPU_DE_RELEASE_MDL as a slow API call. Give the encoder time to complete the MDL release before destroying the encoder internal task. This avoids an encoder lockup on the next digital capture and error messages about buffers being returned for an inactive encoder task handle. Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-10-31cx18: Fix write retries for registers that always change - part 2.Andy Walls
From: Andy Walls <awalls@radix.net> cx18: Fix write retries for registers that always change - part 2. Some registers, especially interrupt related ones, will never read back the value just written. Modified interrupt register readback checks to make sure the intended effect was achieved. Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-10-25cx18: Disable write retries for registers that always change - part 1.Andy Walls
From: Andy Walls <awalls@radix.net> cx18: Disable write retries for registers that always change - part 1. Interrupt related registers will likely not read back the value we just wrote. Disable retries for these registers for now to avoid accidently discarding interrupts. More intelligent read back verification criteria are needed for these and other registers (e.g. GPIO line registers), which will be addressed in subsequent changes. Priority: high Signed-off-by: Andy Walls <awalls@radix.net>
2008-08-30cx18: Create cx18_ specific wrappers for all pci mmio accessesors.Andy Walls
From: Andy Walls <awalls@radix.net> cx18: Create cx18_ specific wrappers for all pci mmio accessesors. This is a first step in instrumenting all CX23418 PCI bus IO, to debug problems with accessing the CX23418's PCI memory mapped IO. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-08-23cx18: Have CX23418 release buffers at end of capture.Andy Walls
From: Andy Walls <awalls@radix.net> cx18: Have CX23418 release buffers at end of capture. The CX23418 reuses task handles so we need to have it release the buffers associated with a task handle at the end of a capture. If we don't, buffer ids used for one type of stream in the driver (MPEG, TS, PCM), could be used for another type of stream by the CX23418, if a previously used handle is assigned to a different type of stream. The driver would drop valid buffers when this happened. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
2008-06-28cx18: set correct audio inputs for tuner and line-in 2.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-05-21 cx18 iomem annotationsMauro Carvalho Chehab
From: Al Viro <viro@ftp.linux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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>