From 625f24e6cd29ecb04e95010d9ec80a3171f941bb Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: May 17 2023 19:15:57 +0000 Subject: HID: wacom: Set a default resolution for older tablets (bsc#1012628). --- diff --git a/patches.kernel.org/6.3.3-209-HID-wacom-Set-a-default-resolution-for-older-ta.patch b/patches.kernel.org/6.3.3-209-HID-wacom-Set-a-default-resolution-for-older-ta.patch new file mode 100644 index 0000000..88bf041 --- /dev/null +++ b/patches.kernel.org/6.3.3-209-HID-wacom-Set-a-default-resolution-for-older-ta.patch @@ -0,0 +1,54 @@ +From: Ping Cheng +Date: Sun, 9 Apr 2023 09:42:29 -0700 +Subject: [PATCH] HID: wacom: Set a default resolution for older tablets +References: bsc#1012628 +Patch-mainline: 6.3.3 +Git-commit: 08a46b4190d345544d04ce4fe2e1844b772b8535 + +commit 08a46b4190d345544d04ce4fe2e1844b772b8535 upstream. + +Some older tablets may not report physical maximum for X/Y +coordinates. Set a default to prevent undefined resolution. + +Signed-off-by: Ping Cheng +Link: https://lore.kernel.org/r/20230409164229.29777-1-ping.cheng@wacom.com +Signed-off-by: Benjamin Tissoires +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + drivers/hid/wacom_wac.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c +index 9312d611..e499b447 100644 +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -1895,6 +1895,7 @@ static void wacom_map_usage(struct input_dev *input, struct hid_usage *usage, + int fmax = field->logical_maximum; + unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid); + int resolution_code = code; ++ int resolution = hidinput_calc_abs_res(field, resolution_code); + + if (equivalent_usage == HID_DG_TWIST) { + resolution_code = ABS_RZ; +@@ -1915,8 +1916,15 @@ static void wacom_map_usage(struct input_dev *input, struct hid_usage *usage, + switch (type) { + case EV_ABS: + input_set_abs_params(input, code, fmin, fmax, fuzz, 0); +- input_abs_set_res(input, code, +- hidinput_calc_abs_res(field, resolution_code)); ++ ++ /* older tablet may miss physical usage */ ++ if ((code == ABS_X || code == ABS_Y) && !resolution) { ++ resolution = WACOM_INTUOS_RES; ++ hid_warn(input, ++ "Wacom usage (%d) missing resolution \n", ++ code); ++ } ++ input_abs_set_res(input, code, resolution); + break; + case EV_KEY: + case EV_MSC: +-- +2.35.3 + diff --git a/series.conf b/series.conf index 81706f5..832de71 100644 --- a/series.conf +++ b/series.conf @@ -942,6 +942,7 @@ patches.kernel.org/6.3.3-206-drm-amdgpu-disable-sdma-ecc-irq-only-when-sdma-.patch patches.kernel.org/6.3.3-207-drm-amd-pm-avoid-potential-UBSAN-issue-on-legac.patch patches.kernel.org/6.3.3-208-firewire-net-fix-unexpected-release-of-object-f.patch + patches.kernel.org/6.3.3-209-HID-wacom-Set-a-default-resolution-for-older-ta.patch ######################################################## # Build fixes that apply to the vanilla kernel too.