summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/saa7146_core.c
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2003-08-11 11:27:09 +0000
committerMichael Hunold <devnull@localhost>2003-08-11 11:27:09 +0000
commit638d95f3a4fce85199a783efb204ddcb79e1fc0c (patch)
treee6e6be65bba037722ab3f7e875421fcd85c37d0d /linux/drivers/media/common/saa7146_core.c
parentd7eeec469d2e3ca508f755ca02b85d5d0dfe5d55 (diff)
downloadmediapointer-dvb-s2-638d95f3a4fce85199a783efb204ddcb79e1fc0c.tar.gz
mediapointer-dvb-s2-638d95f3a4fce85199a783efb204ddcb79e1fc0c.tar.bz2
- follow latest changes in video-buf
- fix pgtable_build_single, it should work for all kinds of buffers (system memory (kernel/user) and gfx-memory) - add/change some debug messages
Diffstat (limited to 'linux/drivers/media/common/saa7146_core.c')
-rw-r--r--linux/drivers/media/common/saa7146_core.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c
index 7ff131b25..ff007a6e5 100644
--- a/linux/drivers/media/common/saa7146_core.c
+++ b/linux/drivers/media/common/saa7146_core.c
@@ -139,28 +139,34 @@ int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt)
return 0;
}
-void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length )
+void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt,
+ struct scatterlist *list, int sglen )
{
u32 *ptr, fill;
+ intnr_pages = 0;
int i,j,p;
-//fm DEB_EE(("pci:%p, pt:%p, sl:%p, len:%d\n",pci,pt,list,length));
+ BUG_ON( 0 == sglen);
/* if we have a user buffer, the first page may not be
aligned to a page boundary. */
pt->offset = list->offset;
ptr = pt->cpu;
- for (i = 0; i < length; i++, list++) {
+ for (i = 0; i < sglen; i++, list++) {
+/*
+ printk("i:%d, adr:0x%08x, len:%d, offset:%d\n", i,sg_dma_address(list), sg_dma_len(list), list->offset);
+*/
for (p = 0; p * 4096 < list->length; p++, ptr++) {
- *ptr = sg_dma_address(list) - list->offset;
+ *ptr = sg_dma_address(list) + p * 4096;
+ nr_pages++;
}
}
/* safety; fill the page table up with the last valid page */
fill = *(ptr-1);
- for(;i<1024;i++) {
+ for(i=nr_pages;i<1024;i++) {
*ptr++ = fill;
}