summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-core.c
AgeCommit message (Collapse)Author
2009-05-18minor have assigned value twiceMauro Carvalho Chehab
From: figo.zhang <figo.zhang@kolorific.com> The variable minor have assigned value twice, the first time is in the initial "video_device" data struct in those drivers, pls see saa7134-video.c,line 2503. --- Signed-off-by: Figo.zhang <figo.zhang@kolorific.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-31cx88: Add support for stereo and sap detection for A2Mauro Carvalho Chehab
From: Marton Balint <cus@fazekas.hu> The patch implements reliable stereo and sap detection for the A2 sound standard. This is achieved by processing the samples of the audio RDS fifo of the cx2388x chip. A2M, EIAJ and BTSC stereo/sap detection is also possible with this new approach, but it's not implemented yet. Stereo detection when alsa handles the sound also does not work yet. Priority: normal Signed-off-by: Marton Balint <cus@fazekas.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-01v4l2-subdev: move s_std from tuner to core.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> s_std didn't belong in the tuner ops. Stricly speaking it should be part of the video ops, but it is used by audio and tuner devices as well, so it is more efficient to make it part of the core ops. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-30cx88: Fix compilation breakage for kernels older than 2.6.22Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-29cx88: convert to v4l2_subdev.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Convert cx88 to use v4l2_subdev since the old i2c autoprobing mechanism will be removed. Added code to explicitly load tvaudio where needed. Also fix the rtc-isl1208 support: since that driver no longer supports autoprobing it has to be loaded using the new i2c API. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-14cx88: convert to v4l2_device.Mauro Carvalho Chehab
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-30tda9887/cx88: secam-bghdarron@kewl.org
From: Frederic CAND <frederic.cand@anevia.com> Adds secam bgh support Signed-off-by: Frederic CAND <frederic.cand@anevia.com>
2008-10-16cx88: Change spurious buffer message into a debug only messageSteven Toth
From: Steven Toth <stoth@linuxtv.org> A number of users have complained that their syslog often shows this messages but it doesn't impact performance. I'm changing this to a debug message, so developers will still see the message during testing and users will no longer be bothered by this. Priority: normal Signed-off-by: Steven Toth <stoth@linuxtv.org>
2008-07-20videodev: move some functions from v4l2-dev.h to v4l2-common.h or v4l2-ioctl.hHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The functions in a header should not belong to another module. The prio functions belong to v4l2-common.c, so move them to v4l2-common.h. The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header and move those functions to it. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-20videodev: rename 'dev' to 'parent'Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The field 'dev' is not the video device, but the parent of the video device. Rename accordingly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.16Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 4 removes the compatibility support for kernels < 2.6.16. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.0Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> First phase of the backwards compatibility cleanup: stop supporting kernels older than 2.6.0. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-05-21 annotate bcx_riscmemMauro 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-08media/video/cx88 replace remaining __FUNCTION__ occurrencesMichael Krufky
From: Harvey Harrison <harvey.harrison@gmail.com> __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2008-03-23cx88: Enable chroma AGC by default for all non-SECAM modesMauro Carvalho Chehab
From: Frej Drejhammar <frej.drejhammar@gmail.com> An enabled chroma AGC will not degrade picture quality if enabled on a color PAL or NTSC signal with nominal signal levels. It will give a significant color reproduction improvement if the chroma signals diverge from nominal levels. Therefore enable chroma AGC by default for PAL and NTSC standards. Signed-off-by: "Frej Drejhammar <frej.drejhammar@gmail.com>" Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-23cx88: Add user control for chroma AGCMauro Carvalho Chehab
From: Frej Drejhammar <frej.drejhammar@gmail.com> The cx2388x family has support for chroma AGC. This patch implements a the V4L2_CID_CHROMA_AGC control for the cx2388x family. By default chroma AGC is disabled, as in previous versions of the driver. Signed-off-by: "Frej Drejhammar <frej.drejhammar@gmail.com>" Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-14Fix left-overs from the videobuf-dma-sg.c conversion to generic DMAMauro Carvalho Chehab
From: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> The dev element of the struct videobuf_queue is now of type struct device implicitly. Fix left-over casts. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-27[PATCH] static memoryDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> - Static memory is always initialized with 0. - Replaced in some cases C99 comments for /* */ Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2007-11-06V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_Brandon Philips
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g s/STATE_PREPARED/VIDEOBUF_PREPARED/g s/STATE_QUEUED/VIDEOBUF_QUEUED/g s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g s/STATE_DONE/VIDEOBUF_DONE/g s/STATE_ERROR/VIDEOBUF_ERROR/g s/STATE_IDLE/VIDEOBUF_IDLE/g Signed-off-by: Brandon Philips <bphilips@suse.de>
2007-10-10cx88: Replace list_for_each+list_entry with list_for_each_entryTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-23Adapt drivers to use the newer videobuf modulesMauro Carvalho Chehab
PCI-dependent videobuf_foo methods were renamed as videobuf_pci_foo. Also, videobuf_dmabuf is now part of videobuf-dma-sg private struct. So, to access it, a subroutine call is needed. This patch renames all occurences of those function calls to be consistent with the video-buf split. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981 Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-01Fix bug #8689: Fixes IR stop/start during suspend/resumeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> IR workqueue should be disabled during suspend. This avoids some troubles, like the one reported on bug #8689: "The Hauppauge HVR 1100 ir-remote control does not work after resume from suspend to ram or disk." This patch disables IR before suspending, re-enabling it after resume. Thanks to Peter Poklop <Peter.Poklop@gmx.at> for reporting it and helping with the fix. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-23cx88-alsa: Rework buffer handlingTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Rework the way the DMA buffer is handled and IRQs are generated. ALSA uses a ring-buffer of multiple periods. Each period is supposed to corrispond to one IRQ. The existing driver was generating one interrupt per ring-buffer, as opposed to per period. This meant that as soon as the IRQ was generated, the hardware was already starting to re-write the beginning of the buffer. Since the DMA happens on a per-line basis, there was only a narrow window to copy the data out before the buffer was overwritten. The cx88 core RISC program generator is modified so that it can set the IRQ and counter flags to count every X lines of DMA transfer. This way we can generate an interrupt every period instead of every full ring-buffer. Right now only period of one line are supported, but it should be possible to support longer periods. Note that a WRITE instruction generates an IRQ when it starts, not when the transfer is finished. Thus to generate an IRQ when line X is done, one must set the IRQ flag on the instruction that starts line X+1, not the one that ends line X. Change the line size so that there are four lines in the SRAM FIFO. If there are not four lines, the analog output from the cx88's internal DACs is full of clicks and pops. Try to handle FIFO sync errors. Sometimes the chip generates many of these errors before audio data starts. Up to 50 sync errors will be ignored and the counter reset. Have the IRQ handler save the RISC counter to the chip struct, and then have the pointer callback use this to calculate the pointer position. We could read the counter from the pointer callback, but sometimes the sync errors on start up cause the counter to go crazy. ALSA sees this and thinks there has been an overrun. The IRQ hander can avoid saving the counter position on sync errors. The chip "opened" flag wasn't necessary. ALSA won't try to open the same substream multiple times. Probably this code was cut&pasted from the bt87x driver, which has multiple sub-streams for one chip. Do error checking for the videobuf mapping functions. snd_card_cx88_runtime_free() is useless and can be deleted. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-21cx88: Improve risc instruction printing in sram channel dumpTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> When the risc instrunctions from the CMDS were printed, instruction arguments weren't taken into account. This changes output like: cx88[0]: risc0: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ] cx88[0]: risc1: 0x0cac2800 [ INVALID sol eol 23 21 19 18 13 count=2048 ] cx88[0]: risc2: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ] cx88[0]: risc3: 0x0cac2c00 [ INVALID sol eol 23 21 19 18 13 count=3072 ] into: cx88[0]: risc0: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ] cx88[0]: risc1: 0x0cac2800 [ arg #1 ] cx88[0]: risc2: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ] cx88[0]: risc3: 0x0cac2c00 [ arg #1 ] Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-21Cleanup: remove linux/moduleparam.h from drivers/media filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This patch removes all occurences of moduleparm.h from drivers/media files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-18cx88: Add symbolic names for the PCI interrupt bitsTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Used for the PCI_INTMSK and PCI_INT_STAT registers. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-15cx88: Move card core creation from cx88-core.c to cx88-cards.cTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> A lot of code in cx88-cards.c was only used by cx88-core.c when the core state is first allocated and initialized. Moving that task to cx88-cards makes the driver simpler and the files more self contained. - Module parameters tuner, radio, card, and latency move to cx88-cards.c - cx88_boards is made static - cx88_subids is made static and const - cx88_bcount is eliminated - cx88_idcount is eliminated - cx88_card_list() is made static - cx88_card_setup_pre_i2c() is made static - cx88_card_setup() is made static - cx88_pci_quirks() is moved from cx88-core to cx88-cards The function argument "char *name" is made const too - get_ressources() is moved from cx88-core to cx88-cards, and renamed to cx88_get_resources() - The code to allocate and initialize the core state struct and the chip is moved out of cx88-core.c:cx88_get_core() and into a new function in cx88-cards.c, cx88_core_create(). This makes both functions simpler. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-15cx88: Copy board information into card stateTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The cx88 driver state stored the ID of the board type in core->board. Every time the driver need to get some information about the board configuration, it uses the board number as an index into board configuration array. This patch changes it so that the board number is in core->boardnr, and core->board is a copy of the board configuration information. This allows access to board information without the extra indirection. e.g. cx88_boards[core->board].mpeg becomes core->board.mpeg. This has a number of advantages: - The code is simpler to write. - It compiles to be smaller and faster, without needing the extra array lookup to get at the board information. - The cx88_boards array no longer needs to be exported to all cx88 modules. - The boards array can be made const - It should be possible to avoid keeping the (large) cx88_boards array around after the module is loaded. - If module parameters or eeprom info override some board configuration setting, it's not necessary to modify the boards array, which would affect all boards of the same type. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-13cx88: Fix use of uninitialized variableTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> An error message for PCI resource allocation failure used the board type before it was set. Just get rid of the error message, as get_ressources() [sic] already prints one. Format that error message better, and add the pci function and subsystem information to better associate the error with what caused it. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-03-29Fix cx88_print_irqbits calls to use ARRAY_SIZEMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> cx88_print_irqbits were expecting a string pointer with 32 bytes. Better to pass the string size and use ARRAY_SIZE on its calls. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-20Removed v4l2_tvnorm and made videodev to auto-generate standardsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> v4l2_tvnorm were meant to describe video standards and its names to V4L2 API. However, this were meaning several static structures at the driver. This patch changes the internals in a way that, at the driver, only a v4l2_tvnorm (a 32 bit integer) should be filled, with all supported parameters. videodev will dynamically generate the proper API array based on supported standards. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-20Added support for V4L2_STD_NTSC_443Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/cx88/cx88-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
2007-01-20Convert cx8800 driver to video_ioctl2 handlerMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> video_ioctl2 handler provides V4L2 API parsing. Using it makes the driver simpler, and isolates API parsing. This allows future reusage of driver controls using other ways, like sysfs and/or procfs and increases isolation of driver-specific handling from the generic common ioctl processing. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-27Backport some changes that happened at mainstreamMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Basic changes: - replaced i2c_bit_del_bus() to i2c_del_adapter(); - Fixed MODULE_AUTHOR on ov7670 - Updates on drivers not maintained on this tree: i2c-id.h and sound/* kernel-sync: drivers/media/dvb/pluto2/pluto2.c | 8 ++++---- drivers/media/video/bt8xx/bttv-i2c.c | 6 +----- drivers/media/video/cx88/cx88-core.c | 2 +- drivers/media/video/cx88/cx88-vp3054-i2c.c | 2 +- drivers/media/video/ov7670.c | 2 +- drivers/media/video/vino.c | 2 +- drivers/media/video/zoran_card.c | 2 +- include/linux/i2c-id.h | 18 ++++++------------ sound/pci/bt87x.c | 4 ++-- Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-18Fixes bug 7267: PAL/60 is not workingMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> On cx88 driver, sampling rate should be at chroma subcarrier freq (FSC). However, driver were programming wrong values for PAL/60, PAL/Nc and NTSC 4.43. This patch do the proper calculation. It also calculates htotal, hdelay and hactive constants, according with the sampling rate. It is tested with PAL/60 by Piotr Maksymuk and Olivier. Test is still required for PAL/Nc. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-09-29norm_notchfilter is used on just one point and argument is bogusMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Removed norm_notchfilter function. All the code is bound to 4 x FSC, so, any other filter won't work fine. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-09-25cx88: fix analog capture notch filterMichael Krufky
From: Lars Gjesse Kjellberg <lars.g.kjellberg@get2net.dk> This patch changes the setting of the cx2388x notch filter to match that of the video capture sample frequency, removing some annoying interference lines THAT would appear when capturing composite video. This has been tested in PAL and NTSC TV norms. It sets the Y/C separation luma notch filter, which removes the chroma signal from the luma signal when using a composite input. The luma notch filter operates at the video decoder's frequency, not the ADC's frequency or at the frequency of the scaled video. Y/C separation happens after the sample rate converter, before video scaling. The datasheet provides plots of the filter response for three _video decoder_ frequencies, 4x Fsc, square pixel, and ccir601. These are the same three frequencies for the notch filter control. It seems pretty clear that this filter should be set based on the video decoder frequency. The cx88 driver always uses a video decoder frequency of 4xFsc. Signed-off-by: Lars Gjesse Kjellberg <lars.g.kjellberg@get2net.dk> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-09-14Basic DVB-T and analog TV support for the HVR1300.Steven Toth
From: Steven Toth <stoth@hauppauge.com> This is the first in a series of patches to add full WinTV-HVR1300 support to Linux. This first patch will enable analog TV support and DVB-T support. Later patches will add the hardware MPEG encoder support. Signed-off-by: Steven Toth <stoth@hauppauge.com>
2006-08-17Enable audio DMA restart on channel change even when cx88-alsa is compiledRicardo Cerqueira
From: Ricardo Cerqueira <v4l@cerqueira.org> cx88-alsa can be compiled in (in distro built kernels, for example), but not used. In those cases, the audio DMA restart is needed for proper sound on NICAM channels. This patch enables the DMA restart even with ALSA, but the functions now check if cx88-alsa is really active. Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
2006-07-24cx88: add support for Norwood PCI TV Tuner (non-pro)Michael Krufky
From: Peter Naulls <peter@chocky.org> This patch adds support for Norwood PCI TV Tuner (non-pro) Signed-off-by: Peter Naulls <peter@chocky.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-07-19[PATCH] 64bit resource: fix up printks for resources in video driversMauro Carvalho Chehab
From: Greg Kroah-Hartman <gregkh@suse.de> This is needed if we wish to change the size of the resource structures. kernel-sync: backport from kernel to v4l/dvb tree Based on an original patch from Vivek Goyal <vgoyal@in.ibm.com> Cc: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-24cx88: cleanupsMichael Krufky
From: Adrian Bunk <bunk@stusta.de> remove the following unused hooks: - cx88-blackbird.c: cx88_ioctl_hook() - cx88-blackbird.c: cx88_ioctl_translator() make the following needlessly global functions static: - cx88-tvaudio.c: cx88_detect_nicam() remove the following unused EXPORT_SYMBOL's: - cx88-cards.c: cx88_bcount - cx88-cards.c: cx88_subids - cx88-cards.c: cx88_idcount - cx88-cards.c: cx88_card_list - cx88-cards.c: cx88_card_setup - cx88-core.c: cx88_start_audio_dma - cx88-core.c: cx88_stop_audio_dma - cx88-i2c.c: cx88_i2c_init Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-05-11Adjust VBI offset to match value reported in VBI formatMauro Carvalho Chehab
From: Trent Piepho <xyzzy@speakeasy.org> The actual offset of the start of VBI data is incorrectly documented for both the cx2388x and bt8x8. For the cx2388x, it appears to be about 220 to 224 + VBI_V_DEL*2. The driver has been incorrectly reporting an offset of 244. This patch adjusts VBI_V_DEL to 10, so that the offset of 244 is correct. This is the same offset as the bttv driver, and expected by some software. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-05-09Cx88 NTSC VBI fixesMauro Carvalho Chehab
From: Michael Schimek <mschimek@gmx.at> Hi, VBI (Closed Caption, CC) capturing never worked in NTSC mode with the cx88 driver. They were tested with libzvbi and a patched version of tvtime. Signed-off-by: Michael H. Schimek <mschimek@gmx.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-04-11Since we are not using CVS, $Id makes no sense anymoreMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-04-11Correct buffer size calculations in cx88-core.cMauro Carvalho Chehab
From: Duncan Sands <duncan.sands@math.u-psud.fr> The computation in cx88_risc_buffer suffers from the mistake: a non-zero padding value can cause more page borders to be crossed, leading to big buffer over-runs. This patch changes the additive constant from 3 + 4 to 4 It also changees the constant in cx88_risc_databuffer from 3 + 4 to 2, because 2 dwords are the correct vaule. Signed-off-by: Duncan Sands <baldrick@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-03-15Merging from mchehab vivi branchMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> merge: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-03-13BUG_ON() Conversion in drivers/video/mediaMauro Carvalho Chehab
From: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-03-10Make video_buf more genericMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Video_buf were concerned to allow PCI devices to be used as video capture devices. This patch extends video_buf features by virtualizing pci-dependent functions and allowing other type of devices to use it. It is still DMA centric, although it may be used also by devices that emulates scatter/gather behavior or a DMA device Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-02-26bttv: correct bttv_risc_packed buffer sizeMauro Carvalho Chehab
From: Duncan Sands <duncan.sands@math.u-psud.fr> This patch fixes the strange crashes I was seeing after using bttv card, caused by a buffer overflow in bttv_risc_packed. The instruction buffer size calculation contains two errors: (a) a non-zero padding value can push the start of the next bpl section to just before a page border, leading to more scanline splits and thus additional instructions. (b) the first DMA region can be smaller than one page, so there can be a scanline split even if bpl*lines is smaller than PAGE_SIZE. For example, consider the case where offset is 0, bpl is 2, padding is 4094, lines is smaller than 2048, the first DMA region has size 1 and all others have size PAGE_SIZE, assumed to equal 4096. Then all bpl regions cross page borders and the number of instructions written is 2*lines+2, rather than lines+2 (the current estimate). With this patch the number of instructions for this example is estimated to be 2*lines+3. Also, the BUG_ON that was supposed to catch buffer overflows contained a thinko causing it fire only if the buffer was overrun by a factor of 16 or more, so it fixes the the BUG_ON's (using sizeof rather than "4"). Signed-off-by: Duncan Sands <baldrick@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>