Re: sunffb
Marc Aurele La France <[email protected]>
| Newsgroups | gmane.comp.xfree86.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 31 May 2005, Michael wrote:
>>> We finally got the sunffb driver to work on NetBSD/sparc64,
>>> including acceleration. Turns out there was a problem in the VIS
>>> assembler code:
>>> wr %g0, 0, %fprs
>>> this will turn off the FPU so any subsequent FPU instruction will
>>> cause a trap. On NetBSD this led to huge numbers of traps which
>>> rendered the Xserver unusable when acceleration was enabled.
>>> So for NetBSD I changed this to
>>> wr %g0, 4, %fprs
>>> to leave the FPU active and clean only the dirty bits. No more
>>> excessive traps and things work.
>> I'm inclined to simply change both occurrences.
> At least for NetBSD we'll definitely do so in our repository.
>>> Since I highly doubt this is an oversight - what's the purpose of
>>> turning off the FPU after using VIS? Apparently the author expected
>>> the OS to do something which NetBSD doesn't do, but what? And why?
>>> Provoking a trap seems a rather expensive way to reset the FPU ( if
>>> that's the purpose... )
>>> PS: yes, I mailed the author too
>> Let us know if you get a response.
> He said it's supposed to keep the scheduler from storing/saving FPU
> context until someone really uses it again ( which causes a trap ), at
> least on Linux. I'm not sure this helps much in this code - the ffb/afb
> doesn't have block transfer hardware ( they dropped it because VIS is
> faster ) so the VIS code will run a lot.
> Maybe writing 0 into %fprs should be Linux-specific.
I'm not a big fan of this idea, because module binaries are supposed to be
portable across OS'es. In this case, there are also SunOS and the other
*BSD's to consider.
What does NetBSD do with the trap? Does it export it as a signal to its
user-land? If so, which signal? Also, is it "precise", or can the signal
occur a few instructions later?
Another option would be to export something like xf86{En,Dis}ableFPU() from
os-support/ and have OS-specific implementations there.
Marc.
+----------------------------------+-----------------------------------+
| Marc Aurele La France | work: 1-780-492-9310 |
| Computing and Network Services | fax: 1-780-492-1729 |
| 352 General Services Building | email: [email protected] |
| University of Alberta +-----------------------------------+
| Edmonton, Alberta | |
| T6G 2H1 | Standard disclaimers apply |
| CANADA | |
+----------------------------------+-----------------------------------+
XFree86 developer and VP. ATI driver and X server internals.