Next came a mmiotrace of an NVidia blob suspend / resume cycle.
The register writes were then compared to what Nouveau wrote. The result was:
32 registers were different, but why was still unknown. Further prodding from
mjg59 revealed that there was a "...need to restore some of the ramdac and
crtc registers in order to restore the correct screen associations...". Failing
to do so let Nouveau detect a wrong output type (like a CRT instead of a laptop
Further hacking allowed mjg59 to get the backlight on, but still
Nouveau wouldn't display anything else than a black screen. Of course, Nouveau
claimed that it detected the display correctly and was using it (details
More debugging and discussion ensued with mjg59 finally getting
it right. Nouveau did not set PTIMER_NUMERATOR and PTIMER_DENOMINATOR. Setting
those gave mjg59 a picture, that is, the display came up. However, still no output,
no working text or graphics mode (details
More testing showed a merge problem on mjg59's side which resulted
in incorrect TMDS register writes. Correcting that allowed "nv" to get
the card into a fully working state. (Yes, indeed "nv" not Nouveau.
"nv" is sometimes a bit better getting a slightly messed up card into
a working state).
Additionally, mjg59 later started working on generic thermal code
into which driver like Nouveau would hook into (details
here). A few days later and hwmon could read temperatures from NVidia cards
through that code (details
here), although it was a very rough first version.
Hanno had problems with his NV17 based computer, which prompted
malc0 to offer him a patch which resulted in success. Marcheu was interested
as to why the patch still was not in mainline, to which malc0 said that it contained
some ugly hacks which needed refinement.
In came bkaindl and pestered malc0 about suspend to disk support
for NV4x. Macl0 admitted having stopped working on it, as he had other things
with higher priority on his to-do list. So bkaindl discussed possible solutions
with malc0 while comparing the patch to the (then) current code for NV4x. When
he spotted a difference he changed the code to work similar to the NV3x code path
and was successful! However, testing the same changes with malc0's laptop did
not work at all, which sent them both back to the drawing board.
Moondrake (our local PPC coder and tester) checked the patch with
his Powerbook and it worked, too. Well, kind of, as he said:
"malc0: your suspend stuff is amazing. [...] except for having
to do hacks for doing the post in the DDX, remembering to setup bigendian mode
and some panel hacks to turn on the backlight, the patches worked out of the box"
With this, one goal of writing an nv_bios kernel module to handle
suspending NVidia cards was reached.