I am accessing /dev/fb0, the screen's frame buffer, in console mode, Debian 10, using a HP Envy Touchsmart laptop, using fwrite standard C function.
It states that "cat /sys/class/graphics/fb0/virtual_size" should return fb0's dimensions.
It returns 1366 x 768 pixels. This is my actual screen resolution. So good so far.
But when I write into /dev/fb0, I actually need to write 1376 pixels before I start a new row.
Please note pixels are 32-bit packets, so it does not look like there is an underlying scanline alignment issue. We are talking about a difference of 10 times 4 bytes, i.e. 40 bytes, which is a lot.
Where does this discrepancy come from? How do I get the scanline width information without having to find out visually?