ponty / framebuffer-vncserver

VNC server for Linux framebuffer devices
GNU General Public License v2.0
169 stars 69 forks source link

fixed screen 'smearing' on 1366 X 768 and other displays #11

Closed zschroeder6212 closed 3 years ago

zschroeder6212 commented 3 years ago

The current implementation uses the screen resolution retrieved from the fb_var_screeninfo struct which doesn't always match the width of the frame buffer. I fixed the issue by calculating the width of the frame buffer using the line length, which is more accurate.

Before: smear After: no_smear

ponty commented 3 years ago

Thanks but this breaks the tests: python3 vfb.py

The problem is the 1 bit color:

# fbset -g 640 480 640 480 1 
# ./framebuffer-vncserver  
Initializing framebuffer device /dev/fb0...
Floating point exception (core dumped)

bits_per_pixel / 8 = 0

fb_xres = fix_scrinfo.line_length / (var_scrinfo.bits_per_pixel / 8);
zschroeder6212 commented 3 years ago

That should fix it.

zschroeder6212 commented 3 years ago

Sorry, that still only works on 32 bit color.

zschroeder6212 commented 3 years ago

That works.

ponty commented 3 years ago

Thanks.