* [PATCH] Input: goodix-berlin: report a resolution of 10 units/mm
@ 2026-03-21 7:30 Val Packett
2026-03-25 16:08 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Val Packett @ 2026-03-21 7:30 UTC (permalink / raw)
To: Hans de Goede, Dmitry Torokhov, Henrik Rydberg
Cc: Val Packett, Stanislav Zaikin, linux-input, phone-devel,
~postmarketos/upstreaming, linux-kernel
Without a reported resolution, userspace was assuming 1 unit/mm which
is wildly wrong: a regular smartphone is clearly not 2.4 meters tall.
Most applications do not care much for this kind of raw mm value,
but Phosh's on-screen keyboard would accidentally trigger swipe-to-close
gestures due to misinterpreting small movements as huge ones.
Do what the older goodix.c driver does and set the resolution to 10
units/mm to make sure the numbers calculated by userspace are reasonable.
Signed-off-by: Val Packett <val@packett.cool>
---
drivers/input/touchscreen/goodix_berlin_core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/input/touchscreen/goodix_berlin_core.c b/drivers/input/touchscreen/goodix_berlin_core.c
index 83f28b870531..b0938a4f3fec 100644
--- a/drivers/input/touchscreen/goodix_berlin_core.c
+++ b/drivers/input/touchscreen/goodix_berlin_core.c
@@ -628,6 +628,14 @@ static int goodix_berlin_input_dev_config(struct goodix_berlin_core *cd,
touchscreen_parse_properties(cd->input_dev, true, &cd->props);
+ /*
+ * The resolution of these touchscreens is about 10 units/mm, the actual
+ * resolution does not matter much since we set INPUT_PROP_DIRECT.
+ * Set it to 10 to ensure userspace isn't off by an order of magnitude.
+ */
+ input_abs_set_res(cd->input_dev, ABS_MT_POSITION_X, 10);
+ input_abs_set_res(cd->input_dev, ABS_MT_POSITION_Y, 10);
+
error = input_mt_init_slots(cd->input_dev, GOODIX_BERLIN_MAX_TOUCH,
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
if (error)
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: goodix-berlin: report a resolution of 10 units/mm
2026-03-21 7:30 [PATCH] Input: goodix-berlin: report a resolution of 10 units/mm Val Packett
@ 2026-03-25 16:08 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2026-03-25 16:08 UTC (permalink / raw)
To: Val Packett
Cc: Hans de Goede, Henrik Rydberg, Stanislav Zaikin, linux-input,
phone-devel, ~postmarketos/upstreaming, linux-kernel
On Sat, Mar 21, 2026 at 04:30:07AM -0300, Val Packett wrote:
> Without a reported resolution, userspace was assuming 1 unit/mm which
> is wildly wrong: a regular smartphone is clearly not 2.4 meters tall.
> Most applications do not care much for this kind of raw mm value,
> but Phosh's on-screen keyboard would accidentally trigger swipe-to-close
> gestures due to misinterpreting small movements as huge ones.
>
> Do what the older goodix.c driver does and set the resolution to 10
> units/mm to make sure the numbers calculated by userspace are reasonable.
>
> Signed-off-by: Val Packett <val@packett.cool>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-25 16:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21 7:30 [PATCH] Input: goodix-berlin: report a resolution of 10 units/mm Val Packett
2026-03-25 16:08 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox