[Mplayer-cvslog] CVS: main/drivers/radeon README,1.14,1.15

Nick Kurshev nickols_k at mail.ru
Thu Jan 3 11:17:30 CET 2002


Hello, Michael!

On Wed, 2 Jan 2002 13:11:19 +0100 you wrote:

> Hi
> 
> On Wednesday 02 January 2002 12:57, Nick Kurshev wrote:
> [...]
> > > what about decreasing hue range to -100..+100, and using sin/cos lookup
> > > table?
> >
> > We'll lose precision.
> do some interpolation (with a table & cubic interpolation it will be more 
> than precise enough)
> 
I already solved this problem with generic_math.h which perform linear interpolation
by 1.8 degree step.
But there is other BIGGEST problem. This driver violates rule: "No float in the kernel" :(
Well there is way to avoid this problem (from linux-kernel at vger.kernel.org):

#> Can "double" or "float" be used in kernel modules ?
#> Is there a significan performance penalty in using them inside
#> the kernel?
#>
#> Some information is much appreciated
#>
#> Ravi
#
#This is becoming a FAQ.
#
#You can't use the floating point unit inside the kernel. The reason is
#that the state of the FPU is undefined within the kernel. Of course,
#in principle, anything is possible, however, you would have to:
#
#(1) Lock the kernel.
#(2) Save the current FPU state (this also does 'finit').
#(3) Do the math.
#(4) restore the FPU state.
#(5) Ulock the kernel.
#
#I don't have the ix86 book here, but it's about 130 or so clocks to
#save the FPU state and slightly less to restore it. You can do a
#lot of integer math in those clocks.
#
#It is also difficult to have the 'C' compiler do what you want when
#you want it, so to make sure the FPU state was safe, you probably
#would have to do everything in inline-asm. There is the additional
#problem of handling FPU exceptions within the kernel.
#
#So, as you can see, you don't want to use the FPU within the kernel.
#Also, some ix86 processors don't have FPU units. When encountering
#a FPU opcode, the kernel traps to an exception handler which emulates
#the FPU.
#
#Cheers,
#Dick Johnson

So probably I'll move these drivers into user-space.
In this case they will work even under Win98 ;)

> [...]
> 
> Michael
> _______________________________________________
> Mplayer-cvslog mailing list
> Mplayer-cvslog at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-cvslog
> 


Best regards! Nick



More information about the MPlayer-cvslog mailing list