From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: kanoj@google.engr.sgi.com, andrea@suse.de,
alan@lxorguk.ukuu.org.uk, sct@redhat.com,
Gerhard.Wichert@pdb.siemens.de, Winfried.Gerhard@pdb.siemens.de,
linux-kernel@vger.rutgers.edu, linux-mm@kvack.org,
linux-usb@suse.com
Subject: Re: [bigmem-patch] 4GB with Linux on IA32
Date: Tue, 17 Aug 1999 12:39:40 +0100 (BST) [thread overview]
Message-ID: <E11Ghah-0004RI-00@the-village.bc.nu> (raw)
In-Reply-To: <Pine.LNX.3.95.990817000705.19678B-100000@cesium.transmeta.com> from "Linus Torvalds" at Aug 17, 99 00:23:04 am
> If you write a driver and you want to give direct DMA access to some
> program, the way to do it is NOT by using some magic ioctl number and
> doing stupid things like some drivers do (ie notably bttv).
The bttv does it right Linus. It has to do some nastiness to work around
the Linux vm subsystem thats all. That nastiness is solely to get a table
of bus addressses of vmalloc pages. I don't think the 4Gig patch breaks it
at all. In the ideal world virt_to_bus() would work on vmalloc pages. It
doesnt and there are good reasons why so we have to handle that bit ourself.
The only ioctl stuff it has for directly sending stuff to addresses is for
frame buffer direct DMA, which is the only sane way to handle TV viewing.
That is given the bus address of the frame buffer by the X server, which
does know what it is doing.
> process wants direct access to the buffers that the IO is done from, and
> use an explicit mmap() on the file descriptor. The driver can then
> allocate a contiguous chunk of memory of the right type, and with the
> right restrictions, and then let the nopage() function page it into the
> user process space.
Thats basically what bttv does. When you start grabbing we do
vmalloc
write BT848 RISC DMA script to match the pages allocated
mmap maps those pages into user space as a ring buffer
The vmalloc is done off the ioctls to begin frame grabbing because it would
be very stupid to have 2-4Mb of ram allocated on open when a user didnt
want to do capturing.
> this, and have been doing it for several years. I don't know why the bttv
> driver has to be so broken, but as far as I can tell it's one of two (the
Its doing what you say it should. So why is it broken. It has to grab
2Mb of RAM or more at times and map them into user space. It does exactly
that.
> and I hadn't noticed until after I did a quick grep.. You can use
> __get_free_pages() to grab a larger area than just a single page.
Video capture cards want several megabytes. get_free_pages() is unreliable
above about 16K. The bttv could certainly be written to do a loop of using
get_free_page() for each page it wants. That would be a fair bit cleaner.
However Stephens rawio promises to provide roughly the right framework
for doing this stuff properly so I don't plan to do the job twice.
Alan
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/
next prev parent reply other threads:[~1999-08-17 11:39 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-08-16 16:29 Andrea Arcangeli
1999-08-16 16:48 ` Matthew Wilcox
1999-08-16 17:19 ` Andrea Arcangeli
1999-08-16 18:43 ` Kanoj Sarcar
1999-08-16 19:43 ` Alan Cox
1999-08-16 20:54 ` Andrea Arcangeli
1999-08-16 22:47 ` Andrea Arcangeli
1999-08-16 23:26 ` Andrea Arcangeli
1999-08-16 23:39 ` Kanoj Sarcar
1999-08-17 0:10 ` Andrea Arcangeli
1999-08-17 6:37 ` Kanoj Sarcar
1999-08-17 6:41 ` Linus Torvalds
1999-08-17 6:50 ` Kanoj Sarcar
1999-08-17 7:03 ` Linus Torvalds
1999-08-17 7:23 ` Linus Torvalds
1999-08-17 11:39 ` Alan Cox [this message]
1999-08-26 16:27 ` Andrea Arcangeli
1999-08-17 11:46 ` Alan Cox
1999-08-17 14:26 ` Andrea Arcangeli
1999-08-17 6:39 ` Linus Torvalds
1999-08-17 12:40 ` Andrea Arcangeli
1999-08-17 6:29 ` Linus Torvalds
1999-08-17 12:37 ` Andrea Arcangeli
1999-08-17 14:04 ` Andrea Arcangeli
1999-08-17 8:52 ` Jakub Jelinek
1999-08-17 9:13 ` Pavel Machek
1999-08-18 14:08 ` Andrea Arcangeli
1999-08-19 12:20 ` Andrea Arcangeli
1999-08-16 23:28 ` Kanoj Sarcar
1999-08-16 23:49 ` Andrea Arcangeli
1999-08-17 6:29 ` David S. Miller
1999-08-17 12:38 ` Andrea Arcangeli
1999-08-17 0:17 ` Andrea Arcangeli
1999-08-19 13:33 ` Thierry Vignaud
1999-08-19 16:49 ` Stephen C. Tweedie
1999-08-20 7:35 ` Thierry Vignaud
1999-08-20 9:55 ` Alan Cox
1999-08-20 18:25 ` Linus Torvalds
1999-08-16 20:34 ` Andrea Arcangeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E11Ghah-0004RI-00@the-village.bc.nu \
--to=alan@lxorguk.ukuu.org.uk \
--cc=Gerhard.Wichert@pdb.siemens.de \
--cc=Winfried.Gerhard@pdb.siemens.de \
--cc=andrea@suse.de \
--cc=kanoj@google.engr.sgi.com \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=linux-usb@suse.com \
--cc=sct@redhat.com \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox