[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dri-devel
Subject:    Re: [Dri-devel] Savage and nVidia DRI drivers
From:       Linus Torvalds <torvalds () transmeta ! com>
Date:       2002-10-31 19:13:35
[Download RAW message or body]


On Thu, 31 Oct 2002, Keith Whitwell wrote:
> 
> On voodoo-1, even vertices that aren't snapped to 1/16th(?) subpixel coords 
> will crash it...  Hmmm, you can't do fp in the kernel, right?

You _can_ use FP, but you have to jump through hoops to do so, especially 
if you're in an asynchronous context (ie interrupt or similar).

In process context (ie ioctl() code) you could just decide that part of 
the calling convention of the ioctl() is that the FP register state is 
corrupted, and use FP fairly freely - but realizing that FP usage is 
basically the same as "access to user mode" and can cause traps. 

Oh, and getting an FP exception in the kernel is _definitely_ illegal, and
can (and does) cause a hung box. The FP exception handling depends on a 
signal handler cleaning the thing up.

In general, the rule would be: don't do it. It's possible, but there are a
lot of cases you have to worry about, and it would be a _lot_ better to do
the FP (including any coordinate snapping) in mesa in user mode, and maybe
just verify the values in the kernel (which can be done with fairly simple
integer arithmetic).

		Linus



-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic