summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorDaniel Scheller <d.scheller@gmx.net>2018-04-09 18:47:44 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-05-04 16:39:59 +0200
commit28473a197aeae3e12fc85ba3ddec1181a8fee882 (patch)
treebefa30d8ef47140871be3a9dd4d4e07e220f79b4 /drivers/media/pci
parentmedia: ddbridge: use spin_lock_irqsave() in output_work() (diff)
downloadlinux-28473a197aeae3e12fc85ba3ddec1181a8fee882.tar.xz
linux-28473a197aeae3e12fc85ba3ddec1181a8fee882.zip
media: ddbridge: fix output buffer check
A 188 byte gap has to be left between the writer and the consumer. This requires 2*188 bytes available to be able to write to the output buffers. So, change ddb_output_free() to report free bytes according to this rule. Picked up from the upstream dddvb-0.9.33 release. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 7e57f5864df3..216a9a3fecef 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -572,12 +572,12 @@ static u32 ddb_output_free(struct ddb_output *output)
if (output->dma->cbuf != idx) {
if ((((output->dma->cbuf + 1) % output->dma->num) == idx) &&
- (output->dma->size - output->dma->coff <= 188))
+ (output->dma->size - output->dma->coff <= (2 * 188)))
return 0;
return 188;
}
diff = off - output->dma->coff;
- if (diff <= 0 || diff > 188)
+ if (diff <= 0 || diff > (2 * 188))
return 188;
return 0;
}