From 21c910865b8ff05e003262180054107fb9b3d7b4 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 11 Apr 2006 10:18:57 -0300 Subject: [PATCH] --- yaml --- r: 26895 b: refs/heads/master c: bba3ad76a82eb458d31b136fa2414216e20c99cc h: refs/heads/master i: 26893: 901a0045f12f5884f571a31197b8856a45eddcd5 26891: 7c83b47fe4e51e0be95a39faaab0864ab16f587d 26887: ae32bf6d8fe7976eec67b65e3b1289f7fd0e6a20 26879: 7ba7acba1bdeb4c94b7ac029bc3eb65fe3d94cf0 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/cx88/cx88-core.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 031e4300b201..31e8e9a1aeca 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9175b8544ff7b73b158df370acc1d828b28b80b7 +refs/heads/master: bba3ad76a82eb458d31b136fa2414216e20c99cc diff --git a/trunk/drivers/media/video/cx88/cx88-core.c b/trunk/drivers/media/video/cx88/cx88-core.c index 2c3d9f1999be..e1092d5d4628 100644 --- a/trunk/drivers/media/video/cx88/cx88-core.c +++ b/trunk/drivers/media/video/cx88/cx88-core.c @@ -146,9 +146,11 @@ int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, fields++; /* estimate risc mem: worst case is one write per page border + - one write per scan line + syncs + jump (all 2 dwords) */ - instructions = (bpl * lines * fields) / PAGE_SIZE + lines * fields; - instructions += 3 + 4; + one write per scan line + syncs + jump (all 2 dwords). Padding + can cause next bpl to start close to a page border. First DMA + region may be smaller than PAGE_SIZE */ + instructions = fields * (1 + ((bpl + padding) * lines) / PAGE_SIZE + lines); + instructions += 2; if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) return rc; @@ -176,9 +178,11 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc, int rc; /* estimate risc mem: worst case is one write per page border + - one write per scan line + syncs + jump (all 2 dwords) */ - instructions = (bpl * lines) / PAGE_SIZE + lines; - instructions += 3 + 4; + one write per scan line + syncs + jump (all 2 dwords). Here + there is no padding and no sync. First DMA region may be smaller + than PAGE_SIZE */ + instructions = 1 + (bpl * lines) / PAGE_SIZE + lines; + instructions += 1; if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) return rc;