5 ifeq "${display_rotate}" "0"
6 display_touch_calibration := 200 3950 250 4000
7 else ifeq "${display_rotate}" "2"
8 display_touch_calibration := 3950 200 4000 250
13 ### Waveshare 5 Inch Display ###
16 hdmi_cvt=800 480 60 6 0 0 0
18 dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
19 display_rotate=${display_rotate}
22 define display_ws5inch_cfg :=
24 Identifier "evdev touchscreen catchall"
25 MatchIsTouchscreen "on"
26 Option "Calibration" "${display_touch_calibration}"
27 MatchDevicePath "/dev/input/event*"
32 export display_ws5inch_cfg
34 PACKAGES += xserver-xorg-input-evdev xinput xinput-calibrator
36 .PHONY: _display_ws5inch
37 _config: _display_ws5inch
38 _display_ws5inch: ${CFGROOT} _copy _mount
39 mkdir -p "$${CFGROOT}/usr/share/X11/xorg.conf.d/"
40 printf '%s\n' "$${display_ws5inch_cfg}" >"$${CFGROOT}/usr/share/X11/xorg.conf.d/45-evdev.conf"
41 mkdir -p "$${CFGROOT}/etc/X11/Xsession.d/"
42 printf 'xrandr --size 800x480\n' >"$${CFGROOT}/etc/X11/Xsession.d/10display_resolution"
43 # Correct DPI scaling, although application support is mediocre
44 mkdir -p "$${CFGROOT}/etc/X11/Xresources/"
45 printf 'Xft.dpi: 180\n' >"$${CFGROOT}/etc/X11/Xresources/dpi_resolution"
46 # Workaround for applications that do not handle DPI scaling correctly
47 -sed -i 's;^Exec=chromium;Exec=env GDK_DPI_SCALE=.5 chromium;' $${CFGROOT}/usr/share/applications/chromium*.desktop
48 -sed -i 's;^Exec=firefox;Exec=env GDK_DPI_SCALE=.5 firefox;' $${CFGROOT}/usr/share/applications/firefox*.desktop