Jump to content

Screen Calibration

From postmarketOS Wiki
Revision as of 01:28, 26 August 2017 by Ollieparanoid (talk | contribs)

Framebuffer

On most Android devices, a somewhat working framebuffer is required to get Weston and other Wayland compositors running. The alternative to framebuffer would be DRI.

If your framebuffer does not work out of the box, try the following:

  • Run this to set the framebuffer resolution: cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode
  • Boot TWRP/Android and read out the correct framebuffer configurations from the /sys... paths and try to set them in pmOS
  • If you made it work, create an initfs hook, that instantly sets the framebuffer right. Example

If the screen looks laggy, it might be a known issue with refresh rate. It can be solved by hardcoding the refresh rate in the video driver, see mdss_fb_refresh_rate.patch.

Weston

  • Make sure, that Weston runs on the device
  • Look in /tmp/weston.log (via SSH) for the touch device name. For lg-mako, the name is touch_dev, but it may be different for your device.
  • Copy 90-android-touch-dev.rules from device-lg-mako to your device's aport. Replace touch_dev with your touch device name. Adjust the APKBUILD, so it gets installed properly (Example)
# use 'weston-calibrator' to calibrate the touchscreen!
SUBSYSTEM=="input", ATTRS{name}=="touch_dev", \
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1" \
ENV{WL_CALIBRATION}="0.982113 -0.006129 1.983124 -0.002560 1.000800 -6.012451"

Reload udev rules:

# Reload all rules
udevadm control --reload
# Re-apply those rules on all devices
udevadm trigger
  • This calibration may just work fine (it has been reported, that it works on hammerhead). If it does, you are done here. Otherwise continue for the calibration.
  • Connect to your phone via SSH
  • Get a root shell: sudo su - (Because right now, Weston runs as root)
  • Run weston-calibrator as root
  • Adjust your udev rules-file to the output from weston-calibrator