linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [Linux-fbdev-devel] Current discussion about the future of free software graphics
@ 2004-05-11  0:11 Sottek, Matthew J
  2004-05-11  2:20 ` Adam Jackson
  0 siblings, 1 reply; 14+ messages in thread
From: Sottek, Matthew J @ 2004-05-11  0:11 UTC (permalink / raw)
  To: Michel Dänzer, xserver, mesa3d-dev, dri-devel,
	linux-fbdev-devel


>It does, or the ioctl must verify the register data, which could require
>about the same amount of code as computing it in the kernel in the first
>place (possibly even more; the problem changes from computing a valid
>combination of register values for a specific requested mode to limiting
>the huge number of register value combinations to those that don't lock
>up the chip or worse). I've pointed this out several times before, but
>nobody has presented a solution yet. Will the userspace code live in a
>daemon that runs as root? Or will only privileged processes be allowed
>to change display properties?

I am in agreement with Michel on this point.
There is a privilege problem.
Either you trust the data coming from user-space to kernel-space
implicitly which means the user-space process now must be privileged,
or you don't trust user-space and you have to re-validate the data coming
into the kernel.
The former doesn't buy you much. Now you have another root running deamon
floating around to be a security problem.
The latter's protocol and re-validation is difficult to the point of being
a complete waste of effort.

I have conceded that I am fine with a user-space mode setting API
as long as there is no imposed user/kernel split. For those who's chips
would require too much code to revalidate, they can just put the whole
mode setting in the kernel. I think we will discover that many of the
more advanced drivers will end up taking this route.

In the end I think this design is more complicated than is necessary. The
end goal should be to minimize privileged code, not just kernel code. When
you go with a split design you are forcing more privileged code than if
all the code lived in the same place.



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Re: Current discussion about the future of free software graphics
@ 2004-05-12  3:30 Jon Smirl
  2004-05-13 10:39 ` Michel Dänzer
  0 siblings, 1 reply; 14+ messages in thread
From: Jon Smirl @ 2004-05-12  3:30 UTC (permalink / raw)
  To: Ian Romanick, James Simmons; +Cc: linux-fbdev-devel, dri-devel

If everyone will please read Benh's original post describing this... Ben and I
had been emailing on this topic before he wrote this.

--- Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> I agree with the idea of moving the EDID decoding & mode selection to
> userland. In this regard, though, I beleive we should aim toward some
> simple library that sits with the kernel, eventually distributed with
> the kernel tree, to live in initramfs optionally since it may be
> required to even get a console at boot (which is fine, initramfs is
> available early). The video cards themselves have PCI drivers that can
> "trigger" detection by the library via hotplug, the library could manage
> things like persistent configuration, either separate desktops or
> geometry of a complex desktop, etc... and eventually notification of
> userland clients of mode changes.
> 
> One reason for that is lots of monitors lie about their capabilities in
> their EDID block, so we want "override" files.
> 
> The kernel driver in this case doesn't need to be that much different
> than the current fbdev's though, except that we want to move the HW
> access for graphics commands to the kernel too, which basically turns
> into merging the DRI driver and the fbdev. There is no need, I think, to
> re-invent the wheel from scratch here, it would be a lot more realistic
> to build on top of those existing pieces.

What this is saying is that very early in the boot process the graphics driver
will be initialized. At this point it will generate a hotplug event. This event
will be handled by an app and lib that live in initramfs.  This is not saying
that mode-setting will be delayed until normal user space starts. The initial
hotplug event occurs very early in the boot process, almost as early as the
current device driver based code runs. 

This is very similar to the way udev works. Udev is a user space replacement for
devfs. Instead of having a /dev with 40,000 devices in it, udev builds one on
the fly at each boot with exactly your devices in it. Now that I have used udev
instead of devfs I have to agree that it is a much better solution. In fact the
udev app will run before the mode-setting app since it's the udev app that
creates the devices in /dev now by detecting additions to sysfs. udev FAQ:
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ
We all know Linux is non-functional without a /dev directory, and now /dev is
being build in user space.

Andrew, akpm, has also explained to me that even the current fbdev is not really
active at boot. Instead those initial printk's are queued until the fbdev driver
initialized and prints them.

So moving mode setting to user space is not the end of the world. Everything
will still work. This is more like a monolithic vs microkernel type of decision.
All of the existing code is going to be reused (if we can figure out the
licenses). I've already built a very messy prototype by moving the existing
fbdev code to user space and it works just fine. I also called another little
app which executed the VBIOS and reset secondary cards at boot via hotplug.

I've convinced myself of the advantages of moving mode setting to user space,
but maybe I've missed something that someone else will point out. But let's look
at this as an engineering problem and try to come up with a robust, efficient solution.

=====
Jon Smirl
jonsmirl@yahoo.com


	
		
__________________________________
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861 


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Current discussion about the future of free software graphics
@ 2004-05-11 18:09 sottek
  2004-05-11 19:55 ` James Simmons
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: sottek @ 2004-05-11 18:09 UTC (permalink / raw)
  To: eich, agd5f, michel, keithp, jonsmirl, jsimmons
  Cc: linux-fbdev-devel, dri-devel

Can we wrap this up the discussion and try to get to a consensus on
design requirements? I think most of the opinions are starting to
solidify enough to start hashing out the requirements and actual
design.

Also, we probably want to drop the communication down to just one
list? I think dri-devel seems to have the widest group of subscribers.

To start the ball rolling here is a few requirements that I have. We
can build up the list and veto as needed to try and get to a working 
set.

1: Design must provide a mechanism for basic mode setting in a
device independent manner from an application with user level
permissions. ("Basic" to be defined)
2: Design must provide a mechanism for any number of driver dependent
extensions.
3: Design must provide a mechanism to allow the kernel to draw oops
or console messages to the screen in any mode.
4: Design must insure that user applications may not set the hardware
into an unstable state that could lead to lockup or damage display
devices.
5: Design must incorporate a bi-direction API versioning system. The
application must indicate the API version it is expecting first,
followed by the driver's reply.

And some that may require some discussion:
6: Design must provide a mechnism by which the driver can inform a
user application of acceptable modes that may later be applied to
hardware.
7: Design must provide a mechnism for user level applications to
use rendering features of hardware in a secure manner.
8: Design must provide a mechanism for multi-framebuffer and
multi-display per framebuffer devices to be controlled.



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <1084205711.804.43.camel@thor.asgaard.local>]
* Current discussion about the future of free software graphics
@ 2004-05-10 16:15 Michel Dänzer
  0 siblings, 0 replies; 14+ messages in thread
From: Michel Dänzer @ 2004-05-10 16:15 UTC (permalink / raw)
  To: xserver, mesa3d-dev, dri-devel, linux-fbdev-devel


[ Apologies for the broad cross-post; I'd like to reach anyone
potentially interested ]


First of all, it should be fairly obvious to anyone that ideally only a
single kernel driver should muck with the hardware directly. However,
I'd like to point out again that it doesn't follow that the DRM and the
framebuffer device must merge to a single entity (which 'has to be' the
DRM if you ask some people, the framebuffer device if you ask
others...). E.g., they could both use the same mini-driver which deals
with the hardware. Let's try and keep our minds open to all possible
solutions.


I'd also like to comment on some points I noticed in the
ksummit-2004-discuss archives:

In http://thunk.org/pipermail/ksummit-2004-discuss/2004-May/000388.html,
Jim Gettys wrote:

> In short, the X server would put a sequence of commands into a piece
> of memory also visible by the graphics card, set up the DMA
> transfer, tell it to go, and then continue setting up a second buffer,
> and call into the UNIX kernel with the transfer address of the
> second buffer, that transfer to be initiated at interrupt time
> when the first buffer's commands had been processed; this then blocked
> the X server, so it had good "interactive" behavior under many
> circumstances.
> 
> It may be that system calls are now cheap enough to do this rather than
> having to do it in user space [...]

Yes, that's basically what the r128 and radeon X drivers do when the DRI
is enabled, and it's considerably faster than direct register banging.


In http://thunk.org/pipermail/ksummit-2004-discuss/2004-May/000391.html,
Jon Smirl wrote:

> The modelines would be passed into the plug-in libs which would turn them into
> register values. Finally the plug-in lib would use a private IOCTL to set the
> state into the video hardware. 
> 
> There are numerous pros and cons for both a both schemes. The user space code is
> swappable, easier to debug, and does not need to be run as root.

It does, or the ioctl must verify the register data, which could require
about the same amount of code as computing it in the kernel in the first
place (possibly even more; the problem changes from computing a valid
combination of register values for a specific requested mode to limiting
the huge number of register value combinations to those that don't lock
up the chip or worse). I've pointed this out several times before, but
nobody has presented a solution yet. Will the userspace code live in a
daemon that runs as root? Or will only privileged processes be allowed
to change display properties?


-- 
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-05-13 10:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-11  0:11 [Linux-fbdev-devel] Current discussion about the future of free software graphics Sottek, Matthew J
2004-05-11  2:20 ` Adam Jackson
     [not found]   ` <200405102120.48640.ajax-TAsg7VrFCGc@public.gmane.org>
2004-05-11 13:24     ` Michel Dänzer
  -- strict thread matches above, loose matches on Subject: below --
2004-05-12  3:30 Jon Smirl
2004-05-13 10:39 ` Michel Dänzer
2004-05-11 18:09 sottek
2004-05-11 19:55 ` James Simmons
2004-05-12 14:14   ` Alan Cox
2004-05-11 20:07 ` Geert Uytterhoeven
2004-05-11 23:10   ` James Simmons
2004-05-11 23:15 ` Nicolas Souchu
2004-05-12 13:34 ` Michel Dänzer
2004-05-12 13:54 ` Egbert Eich
     [not found] <1084205711.804.43.camel@thor.asgaard.local>
2004-05-10 23:45 ` James Simmons
2004-05-10 16:15 Michel Dänzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).