[lkml]   [2001]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch] zero-bounce highmem I/O
   From: Gerd Knorr <>
Date: Thu, 16 Aug 2001 15:35:41 +0200

> To be honest, you really shouldn't care about this. If you are
> writing a block device, the block/scsi/ide/whatever layer should take
> care to only give you memory that can be DMA'd to/from.
> Same goes for the networking layer.

bttv is neither blkdev nor networking ...

It is video layer, and the video layer should be helping along with
these sorts of issues.

The video layer should provide PCI device helpers which allow the
drivers to just do something like:

struct scatterlist *video_pci_get_user_pages(struct pci_dev *pdev,
int npages);

void video_pci_put_user_pages(struct pci_dev *pdev,
struct scatterlist *sg,
int npages);

The scatter list returned (NULL indicates failure, ala -ENOMEM)
will tell the driver everything it needs to know. Let us define
it as follows:

SG entry 0
address == base of vmalloc()'d area

SG entry 0 ... NPAGES
sg_dma_address(sg) = dma_address for that page
sg_dma_len(sg) = dma_length, usually PAGE_SIZE

sg_dma_len could be something larger than PAGE_SIZE if the
platform has a way of using virtual mappings in PCI space.
You would simply give the device DMA address/len pairs from
the SG array until you either hit the NPAGES entry or you
see a dma_len of zero.

I realize this does not address the kiovec based scheme you
are experimenting with now, but this does deal with the biggest
problem the video layer has right now wrt. portability.

In fact, this isn't even a video layer issue, and the kernel
ought to provide my suggested interfaces in some generic

David S. Miller
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:57    [W:0.120 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site