My goal was to have a program that draws on the display without changing its state (rotation and the like). So you can display an image but if nickel [or whatever] decides to redraw the screen it can do so without trouble.
The program that Kobo provides (pickel showpic) breaks that rule completely, it just rotates the screen and then nickel can't draw anymore until you manually restore the original rotation. In conjunction with the 180°/rotation flip issue it looked like this:
Code:
rotate=$(cat /sys/class/graphics/fb0/rotate) # <- x
something pickel showpic
echo "$rotate" > /sys/class/graphics/fb0/rotate # x->x or x->y
cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate # x->x or y->x
So afterwards, even though pickel changed the rotation, the original rotation is restored regardless whether the device changes the rotation on write or no (write read write cycle gets the original back in all cases).
Or so I thought.
What I'm seeing now (trying to replicate that using the GET/PUT syscalls) seems to be more erratic, in particular the rules change from the moment something was written to /sys/class/graphics/fb0/rotate for the first time.
Before writing to /sys/class/graphics/fb0/rotate: the PUT syscall does not change the rotation. (x->x->x->x->x)
After writing to /sys/class/graphics/fb0/rotate: the PUT syscall does change the rotation (x->y->x->y->x) and the GET syscall returns the inverse value.
Suddenly on one and the same device you can't rely on the rotation return value anymore! My earlier attempt shows picture correctly or turned on its head depending on whether something was ever written to /sys/class/graphics/fb0/rotate before.
I'm too tired right now to puzzle this out completely, will try again tomorrow. I hope it's just a bug in my code.