DY1212W LVDS Panel - Touchscreen Calibration Guide

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

DY1212W LVDS Panel - Touchscreen Calibration Guide

DY1212W LVDS Panel - Touchscreen Calibration Guide

This tutorial describes the complete procedure for calibrating a touchscreen display using Weston, specifically validated with the DY1212W LVDS panel on the following NXP development platforms:

i.MX93‑EVK
FRDM‑i.MX95
FRDM‑i.MX8MP

While the initial calibration performed by Weston works only temporarily, this guide will walk you through configuring the system so that the calibration becomes persistent across reboots. The steps below include performing the initial calibration, editing Weston’s configuration, creating a calibration helper script, and applying udev rules to store the calibration matrix automatically.

 

Temporary Touchscreen Calibration
To begin, run the following command to perform an initial calibration of your touchscreen:

weston-touch-calibrator LVDS-1

 

After running this command, your display should be correctly calibrated.
However, this calibration is not persistent, and you will need to recalibrate after every reboot unless you complete the persistence steps below.

 

Making the Calibration Persistent
Follow the steps below to ensure that calibration settings are preserved across system restarts.

Step 1: Edit the Weston Configuration File

Open the following file:

/etc/xdg/weston/weston.ini

Under the [libinput] section, add these lines:

[libinput]
touchscreen_calibrator=true
+ calibration_helper=/usr/bin/save-calibration.sh

This enables the calibration helper script that will automatically save your settings.

Step 2: Create the Calibration Helper Script
Create a new script at:

/usr/bin/save-calibration.sh

 

Insert the following content:

#!/bin/bash
# Store the transformation arguments for the resistive touchscreen as udev rule

echo 'SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="'$2' '$3' '$4' '$5' '$6' '$7'"' >> /etc/udev/rules.d/touchscreen.rules

 

Make the script executable:

chmod 755 /usr/bin/save-calibration.sh

 

Step 3: Restart Weston and Recalibrate
Restart the Weston service:

systemctl restart weston

 

Run the calibration tool again to generate the persistent settings:

weston-touch-calibrator LVDS-1
reboot

 

Conclusion


After completing all of the steps above, your touchscreen calibration will now persist across reboots, ensuring a consistent user experience even after powering off the board. This configuration allows the system to automatically store and apply calibration data through a udev rule generated by your helper script.


If you encounter any issues or require further assistance, feel free to reach out.


Best regards,
Chavira

%3CLINGO-SUB%20id%3D%22lingo-sub-2327968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDY1212W%20LVDS%20%E9%9D%A2%E6%9D%BF%20-%20%E8%A7%A6%E6%91%B8%E5%B1%8F%E6%A0%A1%E5%87%86%E6%8C%87%E5%8D%97%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%0A%3CP%3E%E6%9C%AC%E6%95%99%E7%A8%8B%E4%BB%8B%E7%BB%8D%E4%BD%BF%E7%94%A8%20Weston%20%E6%A0%A1%E5%87%86%E8%A7%A6%E6%91%B8%E5%B1%8F%E6%98%BE%E7%A4%BA%E5%99%A8%E7%9A%84%E5%AE%8C%E6%95%B4%E6%AD%A5%E9%AA%A4%EF%BC%8C%E7%89%B9%E5%88%AB%E6%98%AF%E5%9C%A8%E4%BB%A5%E4%B8%8B%E6%81%A9%E6%99%BA%E6%B5%A6%E5%BC%80%E5%8F%91%E5%B9%B3%E5%8F%B0%E4%B8%8A%E4%BD%BF%E7%94%A8%20DY1212W%20LVDS%20%E9%9D%A2%E6%9D%BF%E8%BF%9B%E8%A1%8C%E7%9A%84%E9%AA%8C%E8%AF%81%EF%BC%9A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fdevelopment-boards-and-designs%2Fi.MX93EVK%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ei.MX93-EVK%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fdevelopment-boards-and-designs%2FFRDM-IMX95%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EFRDM-i.MX95%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fdevelopment-boards-and-designs%2FFRDM-IMX8MPLUS%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EFRDM-i.MX8MP%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E8%99%BD%E7%84%B6%20Weston%20%E6%89%A7%E8%A1%8C%E7%9A%84%E5%88%9D%E5%A7%8B%E6%A0%A1%E5%87%86%E5%8F%AA%E6%98%AF%E4%B8%B4%E6%97%B6%E6%80%A7%E7%9A%84%EF%BC%8C%E4%BD%86%E6%9C%AC%E6%8C%87%E5%8D%97%E5%B0%86%E6%8C%87%E5%AF%BC%E6%82%A8%E9%85%8D%E7%BD%AE%E7%B3%BB%E7%BB%9F%EF%BC%8C%E4%BD%BF%E6%A0%A1%E5%87%86%E5%9C%A8%E9%87%8D%E5%90%AF%E5%90%8E%E4%BB%8D%E8%83%BD%E6%8C%81%E7%BB%AD%E3%80%82%E4%BB%A5%E4%B8%8B%E6%AD%A5%E9%AA%A4%E5%8C%85%E6%8B%AC%E6%89%A7%E8%A1%8C%E5%88%9D%E5%A7%8B%E6%A0%A1%E5%87%86%E3%80%81%E7%BC%96%E8%BE%91%20Weston%20%E9%85%8D%E7%BD%AE%E3%80%81%E5%88%9B%E5%BB%BA%E6%A0%A1%E5%87%86%E8%BE%85%E5%8A%A9%E8%84%9A%E6%9C%AC%E4%BB%A5%E5%8F%8A%E5%BA%94%E7%94%A8%20udev%20%E8%A7%84%E5%88%99%E8%87%AA%E5%8A%A8%E5%AD%98%E5%82%A8%E6%A0%A1%E5%87%86%E7%9F%A9%E9%98%B5%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E%E4%B8%B4%E6%97%B6%E6%A0%A1%E5%87%86%E8%A7%A6%E6%91%B8%E5%B1%8F%3C%2FSTRONG%3E%3CBR%20%2F%3E%E9%A6%96%E5%85%88%EF%BC%8C%E8%BF%90%E8%A1%8C%E4%BB%A5%E4%B8%8B%E5%91%BD%E4%BB%A4%E5%AF%B9%E8%A7%A6%E6%91%B8%E5%B1%8F%E8%BF%9B%E8%A1%8C%E5%88%9D%E5%A7%8B%E6%A0%A1%E5%87%86%EF%BC%9A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3Eweston-touch-calibrator%20LVDS-1%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E8%BF%90%E8%A1%8C%E6%AD%A4%E5%91%BD%E4%BB%A4%E5%90%8E%EF%BC%8C%E6%98%BE%E7%A4%BA%E5%B1%8F%E5%BA%94%E5%B7%B2%E6%AD%A3%E7%A1%AE%E6%A0%A1%E5%87%86%E3%80%82%3CBR%20%2F%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E8%BF%99%E7%A7%8D%E6%A0%A1%E5%87%86%E4%B8%8D%E6%98%AF%E6%8C%81%E4%B9%85%E6%80%A7%E7%9A%84%EF%BC%8C%E9%99%A4%E9%9D%9E%E5%AE%8C%E6%88%90%E4%B8%8B%E9%9D%A2%E7%9A%84%E6%8C%81%E4%B9%85%E6%80%A7%E6%AD%A5%E9%AA%A4%EF%BC%8C%E5%90%A6%E5%88%99%E6%AF%8F%E6%AC%A1%E9%87%8D%E5%90%AF%E5%90%8E%E9%83%BD%E9%9C%80%E8%A6%81%E9%87%8D%E6%96%B0%E6%A0%A1%E5%87%86%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E%E4%BD%BF%E6%A0%A1%E5%87%86%E6%8C%81%E7%BB%AD%E8%BF%9B%E8%A1%8C%3C%2FSTRONG%3E%3CBR%20%2F%3E%E8%AF%B7%E6%8C%89%E7%85%A7%E4%BB%A5%E4%B8%8B%E6%AD%A5%E9%AA%A4%E6%93%8D%E4%BD%9C%EF%BC%8C%E4%BB%A5%E7%A1%AE%E4%BF%9D%E5%9C%A8%E7%B3%BB%E7%BB%9F%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%E6%97%B6%E4%BF%9D%E7%95%99%E6%A0%A1%E5%87%86%E8%AE%BE%E7%BD%AE%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%E7%AC%AC%201%20%E6%AD%A5%EF%BC%9A%E7%BC%96%E8%BE%91%20Weston%20%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%E6%89%93%E5%BC%80%E4%BB%A5%E4%B8%8B%E6%96%87%E4%BB%B6%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E%2Fetc%2Fxdg%2Fweston%2Fweston.ini%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E5%9C%A8%20%5Blibinput%5D%20%E9%83%A8%E5%88%86%E4%B8%8B%EF%BC%8C%E6%B7%BB%E5%8A%A0%E4%BB%A5%E4%B8%8B%E5%87%A0%E8%A1%8C%EF%BC%9A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E%5Blibinput%5D%0Atouchscreen_calibrator%3Dtrue%0A%2B%20calibration_helper%3D%2Fusr%2Fbin%2Fsave-calibration.sh%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E8%BF%99%E5%B0%86%E5%90%AF%E7%94%A8%E6%A0%A1%E5%87%86%E8%BE%85%E5%8A%A9%E8%84%9A%E6%9C%AC%EF%BC%8C%E8%AF%A5%E8%84%9A%E6%9C%AC%E5%B0%86%E8%87%AA%E5%8A%A8%E4%BF%9D%E5%AD%98%E6%82%A8%E7%9A%84%E8%AE%BE%E7%BD%AE%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%E6%AD%A5%E9%AA%A4%202%EF%BC%9A%E5%88%9B%E5%BB%BA%E6%A0%A1%E5%87%86%E8%BE%85%E5%8A%A9%E8%84%9A%E6%9C%AC%3C%2FSTRONG%3E%3CBR%20%2F%3E%E5%9C%A8%E4%BB%A5%E4%B8%8B%E7%BD%91%E5%9D%80%E5%88%9B%E5%BB%BA%E6%96%B0%E8%84%9A%E6%9C%AC%EF%BC%9A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E%2Fusr%2Fbin%2Fsave-calibration.sh%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E6%8F%92%E5%85%A5%E4%BB%A5%E4%B8%8B%E5%86%85%E5%AE%B9%EF%BC%9A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E%23!%2Fbin%2Fbash%0A%23%20Store%20the%20transformation%20arguments%20for%20the%20resistive%20touchscreen%20as%20udev%20rule%0A%0Aecho%20'SUBSYSTEM%3D%3D%22input%22%2C%20KERNEL%3D%3D%22event%5B0-9%5D*%22%2C%20ENV%7BID_INPUT_TOUCHSCREEN%7D%3D%3D%221%22%2C%20ENV%7BLIBINPUT_CALIBRATION_MATRIX%7D%3D%22'%242'%20'%243'%20'%244'%20'%245'%20'%246'%20'%247'%22'%20%26gt%3B%26gt%3B%20%2Fetc%2Fudev%2Frules.d%2Ftouchscreen.rules%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E4%BD%BF%E8%84%9A%E6%9C%AC%E5%8F%AF%E6%89%A7%E8%A1%8C%EF%BC%9A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3Echmod%20755%20%2Fusr%2Fbin%2Fsave-calibration.sh%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E%E6%AD%A5%E9%AA%A4%203%EF%BC%9A%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%20Weston%20%E5%B9%B6%E9%87%8D%E6%96%B0%E6%A0%A1%E5%87%86%3C%2FSTRONG%3E%3CBR%20%2F%3E%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%20Weston%20%E6%9C%8D%E5%8A%A1%EF%BC%9A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3Esystemctl%20restart%20weston%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E5%86%8D%E6%AC%A1%E8%BF%90%E8%A1%8C%E6%A0%A1%E5%87%86%E5%B7%A5%E5%85%B7%E4%BB%A5%E7%94%9F%E6%88%90%E6%8C%81%E4%B9%85%E8%AE%BE%E7%BD%AE%EF%BC%9A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3Eweston-touch-calibrator%20LVDS-1%0Areboot%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3E%E7%BB%93%E6%9D%9F%E8%AF%AD%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%E5%AE%8C%E6%88%90%E4%B8%8A%E8%BF%B0%E6%89%80%E6%9C%89%E6%AD%A5%E9%AA%A4%E5%90%8E%EF%BC%8C%E6%82%A8%E7%9A%84%E8%A7%A6%E6%91%B8%E5%B1%8F%E6%A0%A1%E5%87%86%E7%8E%B0%E5%9C%A8%E5%B0%86%E5%9C%A8%E9%87%8D%E5%90%AF%E5%90%8E%E6%8C%81%E7%BB%AD%E8%BF%9B%E8%A1%8C%EF%BC%8C%E4%BB%8E%E8%80%8C%E7%A1%AE%E4%BF%9D%E5%8D%B3%E4%BD%BF%E5%9C%A8%E5%85%B3%E9%97%AD%E4%B8%BB%E6%9D%BF%E5%90%8E%E4%B9%9F%E8%83%BD%E8%8E%B7%E5%BE%97%E7%A8%B3%E5%AE%9A%E7%9A%84%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C%E3%80%82%E6%AD%A4%E9%85%8D%E7%BD%AE%E5%85%81%E8%AE%B8%E7%B3%BB%E7%BB%9F%E9%80%9A%E8%BF%87%E8%BE%85%E5%8A%A9%E8%84%9A%E6%9C%AC%E7%94%9F%E6%88%90%E7%9A%84%20udev%20%E8%A7%84%E5%88%99%E8%87%AA%E5%8A%A8%E5%AD%98%E5%82%A8%E5%92%8C%E5%BA%94%E7%94%A8%E6%A0%A1%E5%87%86%E6%95%B0%E6%8D%AE%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%E5%A6%82%E6%9E%9C%E6%82%A8%E9%81%87%E5%88%B0%E4%BB%BB%E4%BD%95%E9%97%AE%E9%A2%98%E6%88%96%E9%9C%80%E8%A6%81%E8%BF%9B%E4%B8%80%E6%AD%A5%E5%B8%AE%E5%8A%A9%EF%BC%8C%E8%AF%B7%E9%9A%8F%E6%97%B6%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%E8%87%B4%E4%BB%A5%E6%9C%80%E5%B4%87%E9%AB%98%E7%9A%84%E6%95%AC%E6%84%8F%EF%BC%8C%3CBR%20%2F%3EChavira%3C%2FP%3E%0A%3C%2FLINGO-BODY%3E
无评分
版本历史
最后更新:
‎03-09-2026 10:02 AM
更新人: