Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 1996 10:55:29 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        luigi@labinfo.iet.unipi.it (Luigi Rizzo)
Cc:        dufault@hda.com, jkh@time.cdrom.com, hasty@rah.star-gate.com, multimedia@rah.star-gate.com, hackers@FreeBSD.org
Subject:   Re: Amancio's tv program with capture!
Message-ID:  <199601231755.KAA17864@phaeton.artisoft.com>
In-Reply-To: <199601231226.NAA07338@labinfo.iet.unipi.it> from "Luigi Rizzo" at Jan 23, 96 01:26:06 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> we were discussing the possibility of making a shared memory segment 
> use the physical pages where the frame grabber dumps its output. The
> frame grabber has an mmap() call to give the user program access to
> these data.

[ ... ]

> terminology: "frame buffer" is usually the name of the output buffer,
> while the meteor is an input device.
> 
> In any case, the meteor has an mmap() call.
> 
> I was looking at shmat():
> 
>      shmat(int shmid, void *addr, int flag)
> 
> DESCRIPTION
>      Shmat() attaches the shared memory segment identifed by shmid to the
>      calling process's address space.  The address where the segment is at-
>      tached is determined as follows:
> 
>      ...
> 
>      o   If addr is nonzero and SHM_RND is not specifed in flag, the segment
>          is attached the specified address.
>      ...
> 
> thus, in principle, you could pass the parameter to the kernel.
> 
> A possible implementation could delay the actual allocation of pages to
> the time shmat() is called the first time, as opposed to what I believe
> is the current behaviour of allocating pages in shmget().
> 
> At this point, if the virtual address is already mapped, and provided
> the shm segment is not already mapped, use the existing pages to
> map the memory. My guess is that the current code would fail in this
> case.
> 
> Unfortunately I think this would require non-trivial changes to the
> code in sysv_shm.c, and might possibly have some side effects.
> 
> I am cross-posting this to hackers for advice.

I would suggest adding an mmap() entry point for the device driver
and calling it when you request pages to be mmapped.  The system
mmap() interface would not be changed, it would just act differently
for vnodes that were devices.

This would work for mapping video memory by device generically as well
as frame capture buffers, etc..


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601231755.KAA17864>