From patchwork Tue Dec 20 21:29:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 9482273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47F6C606DB for ; Tue, 20 Dec 2016 21:30:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39ABC27F86 for ; Tue, 20 Dec 2016 21:30:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A12728404; Tue, 20 Dec 2016 21:30:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86A2A27F86 for ; Tue, 20 Dec 2016 21:30:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765220AbcLTVaC (ORCPT ); Tue, 20 Dec 2016 16:30:02 -0500 Received: from avasout06.plus.net ([212.159.14.18]:46861 "EHLO avasout06.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765211AbcLTVaC (ORCPT ); Tue, 20 Dec 2016 16:30:02 -0500 Received: from lava ([80.229.148.18]) by avasout06 with smtp id NMVy1u0060Q3Geg01MVz8N; Tue, 20 Dec 2016 21:29:59 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.2 cv=VYWHBBh9 c=1 sm=1 tr=0 a=o7Djd4SkmPXITDn8qH+ssQ==:117 a=o7Djd4SkmPXITDn8qH+ssQ==:17 a=kj9zAlcOel0A:10 a=n5n_aSjo0skA:10 a=6akLWW9ZnjkzofS8FioA:9 a=CjuIK1q_8ugA:10 Received: from nick by lava with local (Exim 4.86_2) (envelope-from ) id 1cJRyw-0005Lc-2l; Tue, 20 Dec 2016 21:29:58 +0000 Date: Tue, 20 Dec 2016 21:29:58 +0000 From: Nick Dyer To: Christopher Heiny Cc: Dmitry Torokhov , Chris Healy , Lucas Stach , Andrew Duggan , linux-input@vger.kernel.org Subject: RMI4 F12 clipping issues Message-ID: <20161220212957.GA19338@lava.h.shmanahar.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);