Waveshare 7″ touchscreen showing lines and black screen

Waveshare touchscreen 7inchI’ve recently bought a waveshare 7 inch touchscreen, which didn’t work out of the box. It comes with custom raspbian image, which isn’t handy because you can’t upgrade so easily. So actually this display is able to work on stock raspbian with slight modifications to config.txt as you can see below.

# set current over USB to 1.2A
max_usb_current=1

# overscan to adjust image position
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0

# HDMI config
hdmi_drive=1
hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=87

# 1024x600 display
hdmi_cvt=1024 600 60 3 0 0 0

Also I couldn’t get touch capabilities working on Raspberry Pi, yet touch worked on Ubuntu. So I’ve made a fork of a driver I found on github: https://github.com/JohnPoison/waveshare-7inch-touchscreen-driver . And added support for right button on hold and scroll by two fingers.