View Single Post
Old 06-09-2020, 06:59 PM   #9
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Linux FB rotation is expressed in terms of 90° clockwise turns. So +1 or -1 from Portrait is always going to be Landscape.

Don't trust the actual absolute values, as eInk panels are only extremely rarely mounted Upright/Portrait, and some of them respond in weird ways to rotation events (see mirroring, which may not apply to every rotation state).

fbdepth -o returns the current rotation (as would reading /sys/class/graphics/fb0/rotate), and the actual range of valid constants is 0 to 3, so the & 3 gets us a wraparound at 3 (as would % 4, if you're more comfortable with divisions).

Last edited by NiLuJe; 06-09-2020 at 07:02 PM.
NiLuJe is offline   Reply With Quote