I've finally tracked down 3d issue, as expected it was SGX drivers not setting a flag Android wants, and it ended up doing some operations in software mode (which wasn't obvious as soft rasterizers use self-modifying code, I though that was recompiled java instead; and SGX still did some of the work, so looked like working..).
I've found out Cyanogenmod already has a workaround for this (disabled by default though) so I switched relevant components to it. That didn't go well, it wasn't even compiling anymore, so I ended up migrating to Cyanogenmod almost completely. Then it was building again, but no longer booting, after spending some hours messing around it I've got it to boot, but now it doesn't accept any input, maybe it thinks the screen is off, who knows?
So it's kind of a 1 step forward, but 2 steps back, real messy. Ohwell, at least we've got Cyanogenmod now, maybe...