]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 11:46:49 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 11:46:49 +0000 (13:46 +0200)
added patches:
hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch

queue-4.19/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch b/queue-4.19/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch
new file mode 100644 (file)
index 0000000..8c36abb
--- /dev/null
@@ -0,0 +1,49 @@
+From 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <jason.gerecke@wacom.com>
+Date: Tue, 30 Jul 2024 08:51:55 -0700
+Subject: HID: wacom: Defer calculation of resolution until resolution_code is known
+
+From: Jason Gerecke <jason.gerecke@wacom.com>
+
+commit 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad upstream.
+
+The Wacom driver maps the HID_DG_TWIST usage to ABS_Z (rather than ABS_RZ)
+for historic reasons. When the code to support twist was introduced in
+commit 50066a042da5 ("HID: wacom: generic: Add support for height, tilt,
+and twist usages"), we were careful to write it in such a way that it had
+HID calculate the resolution of the twist axis assuming ABS_RZ instead
+(so that we would get correct angular behavior). This was broken with
+the introduction of commit 08a46b4190d3 ("HID: wacom: Set a default
+resolution for older tablets"), which moved the resolution calculation
+to occur *before* the adjustment from ABS_Z to ABS_RZ occurred.
+
+This commit moves the calculation of resolution after the point that
+we are finished setting things up for its proper use.
+
+Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
+Fixes: 08a46b4190d3 ("HID: wacom: Set a default resolution for older tablets")
+Cc: stable@vger.kernel.org
+Signed-off-by: Jiri Kosina <jkosina@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/wacom_wac.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -1830,12 +1830,14 @@ static void wacom_map_usage(struct input
+       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);
++      int resolution;
+       if (equivalent_usage == HID_DG_TWIST) {
+               resolution_code = ABS_RZ;
+       }
++      resolution = hidinput_calc_abs_res(field, resolution_code);
++
+       if (equivalent_usage == HID_GD_X) {
+               fmin += features->offset_left;
+               fmax -= features->offset_right;
index ed60044859f729f2aac2078f48d9553bc5f3d970..fdacea538d5bf2bfa0fcd6a2d9e84f245cc0c613 100644 (file)
@@ -62,3 +62,4 @@ drm-msm-use-drm_debug_enabled-to-check-for-debug-cat.patch
 drm-msm-dpu-don-t-play-tricks-with-debug-macros.patch
 mmc-mmc_test-fix-null-dereference-on-allocation-fail.patch
 bluetooth-mgmt-add-error-handling-to-pair_device.patch
+hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch