llandsmeer / inkvt

Experimental VT100 terminal emulator for Kobo e-readers
GNU General Public License v3.0
39 stars 5 forks source link

Slightly hardier reinit #8

Closed NiLuJe closed 4 years ago

NiLuJe commented 4 years ago

Only actually resize the terminal on layout swaps (as opposed to a simple rotation inversion). Also, reset/clear the screen first, to avoid potential crashes (possibly a race on devices where a rotation is done in two steps, because NTX kernels are fun. This at least fixed 0 <-> 2 on my H2O ;))

Update FBInk to pull a minor API change that made the return value from fbink_reinit slightly more usable ;). (i.e., if it's positive, it's a bitmask with each and every reason why the reinit was needed recorded).

llandsmeer commented 4 years ago

cozette2

Cozy :heavy_check_mark:

llandsmeer commented 4 years ago

Yeah I didn't test the rotations that thoroughly.. (although 0->2 worked for me IIRC). Thanks for your effort and FBInk change, it's a lot clearn this way :)

NiLuJe commented 4 years ago

Yeah, the H2O is a special snowflake in that the EPDC will invert all rotate constants during the post-ioctl fb state setup, which then updates the fb state for real.

Since I was running the fbdepth command from within inkvt, I was getting enough damage events to catch both in a reinit (which means OK_LAYOUT_CHANGE then ends up being true for both, even if you physically only do an invert :s), and for some combinations, it went kablooey ;).

This way, I still get a few missed refreshes while the fb state is unstable on the kernel side, but no more crashes ;).

(Things are probably much tamer if the rotation is done from outside/not during inkvt damage events ;)).