All of lore.kernel.org
 help / color / mirror / Atom feed
* RMI4 F12 clipping issues
@ 2016-12-20 21:29 Nick Dyer
  2016-12-23 19:28 ` Christopher Heiny
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Dyer @ 2016-12-20 21:29 UTC (permalink / raw)
  To: Christopher Heiny
  Cc: Dmitry Torokhov, Chris Healy, Lucas Stach, Andrew Duggan,
	linux-input

Hi Christopher-

I wonder if you could comment on an issue we've seen with the mainline
RMI4 driver code?

We've discovered that the code where the driver adjusts the positions
reported to the input layer, according to Low/High Transmitter/Receiver
clip values read out of F12 ctrl register 08, doesn't seem to work
properly. It ends up with a stripe of co-ordinates down one side of the
screen which is inaccessible to input touches.

The below patch shows the lines causing the proble. It does fix our
issue, although obviously it's not a proper fix. I suspect the root
cause is that clipping as set in F12 ctrl register 08 has a different
use case (and units) to clipping as defined via device tree, so we
shouldn't be reading these values into clip_x_low etc in rmi_f12.c in
the first place. Do you agree?

I think there's another minor issue in that we should be passing
sensor->min_x to input_set_abs_params(ABS_MT_POSITION_X).

cheers

Nick

---
 drivers/input/rmi4/rmi_2d_sensor.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/input/rmi4/rmi_2d_sensor.c b/drivers/input/rmi4/rmi_2d_sensor.c
index e97bd7f..5f474b4 100644
--- a/drivers/input/rmi4/rmi_2d_sensor.c
+++ b/drivers/input/rmi4/rmi_2d_sensor.c
@@ -52,15 +52,6 @@ void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor,
 	obj->x += axis_align->offset_x;
 	obj->y += axis_align->offset_y;
 
-	obj->x =  max(axis_align->clip_x_low, obj->x);
-	obj->y =  max(axis_align->clip_y_low, obj->y);
-
-	if (axis_align->clip_x_high)
-		obj->x = min(sensor->max_x, obj->x);
-
-	if (axis_align->clip_y_high)
-		obj->y =  min(sensor->max_y, obj->y);
-
 	sensor->tracking_pos[slot].x = obj->x;
 	sensor->tracking_pos[slot].y = obj->y;
 }
@@ -147,16 +138,6 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor)
 		if (sensor->axis_align.swap_axes)
 			swap(sensor->max_x, sensor->max_y);
 
-		sensor->min_x = sensor->axis_align.clip_x_low;
-		if (sensor->axis_align.clip_x_high)
-			sensor->max_x = min(sensor->max_x,
-				sensor->axis_align.clip_x_high);
-
-		sensor->min_y = sensor->axis_align.clip_y_low;
-		if (sensor->axis_align.clip_y_high)
-			sensor->max_y = min(sensor->max_y,
-				sensor->axis_align.clip_y_high);
-
 		set_bit(EV_ABS, input->evbit);
 		input_set_abs_params(input, ABS_MT_POSITION_X, 0, sensor->max_x,
 					0, 0);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-23 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-20 21:29 RMI4 F12 clipping issues Nick Dyer
2016-12-23 19:28 ` Christopher Heiny

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.