[lkml]   [2000]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [linux-fbdev] fbdev 2.4.0 cleanups

On 15 Mar 2000, Marcus Sundberg wrote:

> James A Simmons <> writes:
> > Here is the main reasons why I have it so only one app can open /dev/fb at
> > a time. Its called SMP. Consider two apps running at the same time both
> > with /dev/fb opened. Problem:
> SMP is no different from UP as far as graphics hardware is concerned.
> The PCI/AGP bus will serialize accesses and the card will not notice
> any difference between SMP and two processes task switching in UP.

See my other post about multiple access. What I'm talking about is the
different state the hardware can be in per process. Even with one process
allowed a write and a bunch of reads that data they could be reading could
be altered by the one app thats allowed write access to change modes.
I'm talking about the hardware context. The video card can be in
different state for each process.

> > Now do people agree with me that /dev/fb should only be opened once.
> No.
> Having several fbdev apps sleeping on several incative VTs while
> you are running another on the current VT must be possible, otherwise
> you are removing important functionality.

I'm talking about running several fbdev apps on top of the same VT. Of
course I see where VT switching can cause problems too :(

> It's most probably too late to redesign fbdev for safe user access
> for 2.4, but in any case only allowing one open() is not the right
> way for 2.4 or any future kernel version. If you want some safety
> for 2.4, then only allow root processes to map the MMIO region.

It more than MMIO region access. See my other post about what could go
wrong. It true this feature has been removed and will be in placed for
2.5.X. Breaking things now would be a bad idea with 2.4.X coming out.
You right it to late now. By the way sparc fbdev driver have been doing it
this way. They got it right from the start.


Another big problem is fork. Consider a card with different apertures
for big endian and little endian. The little endian is used for 8 and less
bpp mode and big endian is used for 16+ bpp modes. Imagine this scratch

int main()


ioctl(FBIOSETVAR ..(var));

pid = fork();;

if (pid ...)
/* child */


/* parent */
memset(fix->smem_start, fix-smem_len, 0xFFFF);

Now the parent is writing to the framebuffer. Now if the child changes the
mode while the parent is writing to the framebuffer and it changes from
little endian to big endian aperture it cokes. So for /dev/fb the mapping
and file descriptors shouldn't be inherited to child.

"Look its a text editor, no its a OS, no its Emacs"
James Simmons (o_
fbdev/gfx developer (o_ (o_ //\ (/)_ (/)_ V_/_

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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