diff mbox

[06/25] HID: multitouch: optimize FlatFrog panels

Message ID 1359120190-18281-7-git-send-email-benjamin.tissoires@gmail.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Benjamin Tissoires Jan. 25, 2013, 1:22 p.m. UTC
Relying on ALWAYS_VALID enhance a little the processing time of
the events.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
 drivers/hid/hid-multitouch.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Henrik Rydberg Jan. 28, 2013, 3:10 p.m. UTC | #1
Hi Benjamin,

> Relying on ALWAYS_VALID enhance a little the processing time of
> the events.
> 
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
> ---
>  drivers/hid/hid-multitouch.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Is there a measurement backing up this claim? I suspect
micro-optimizations of this kind drowns completely along the rather
long way from device, via malloc and loops, to the input core.
Considering the must-be-tested-for-regression risk on top of that,
this patch falls far below what is worth doing, IMHO.

> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 5a886bd..7dfe891 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -229,8 +229,9 @@ static struct mt_class mt_classes[] = {
>  	},
>  
>  	{ .name = MT_CLS_FLATFROG,
> -		.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
> -			MT_QUIRK_NO_AREA,
> +		.quirks = MT_QUIRK_ALWAYS_VALID |
> +			MT_QUIRK_NO_AREA |
> +			MT_QUIRK_CONTACT_CNT_ACCURATE,
>  		.sn_move = 2048,
>  		.maxcontacts = 40,
>  	},
> -- 
> 1.8.1
> 

Thanks.
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benjamin Tissoires Jan. 28, 2013, 4:01 p.m. UTC | #2
On Mon, Jan 28, 2013 at 4:10 PM, Henrik Rydberg <rydberg@euromail.se> wrote:
> Hi Benjamin,
>
>> Relying on ALWAYS_VALID enhance a little the processing time of
>> the events.
>>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
>> ---
>>  drivers/hid/hid-multitouch.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> Is there a measurement backing up this claim? I suspect
> micro-optimizations of this kind drowns completely along the rather
> long way from device, via malloc and loops, to the input core.

No, the measure I made for this are roughly the same. It's purely
micro-optimization, and yes, mallocs must kill the processing time.
However, the purpose of this patch and the others entitled 'optimize
XXX' is to show that I did not invented the new default class. My true
objective is to remove all the quirks related to the 'valid'
information in order to have a driver as universal as possible and to
be able to clean it up.

> Considering the must-be-tested-for-regression risk on top of that,
> this patch falls far below what is worth doing, IMHO.

It _has_ been tested. I got the HID traces from FlatFrog and either
they use different firmwares with different processing in their
devices, the kernel processing is good.

Cheers,
Benjamin

>
>> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
>> index 5a886bd..7dfe891 100644
>> --- a/drivers/hid/hid-multitouch.c
>> +++ b/drivers/hid/hid-multitouch.c
>> @@ -229,8 +229,9 @@ static struct mt_class mt_classes[] = {
>>       },
>>
>>       { .name = MT_CLS_FLATFROG,
>> -             .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
>> -                     MT_QUIRK_NO_AREA,
>> +             .quirks = MT_QUIRK_ALWAYS_VALID |
>> +                     MT_QUIRK_NO_AREA |
>> +                     MT_QUIRK_CONTACT_CNT_ACCURATE,
>>               .sn_move = 2048,
>>               .maxcontacts = 40,
>>       },
>> --
>> 1.8.1
>>
>
> Thanks.
> Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 5a886bd..7dfe891 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -229,8 +229,9 @@  static struct mt_class mt_classes[] = {
 	},
 
 	{ .name = MT_CLS_FLATFROG,
-		.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
-			MT_QUIRK_NO_AREA,
+		.quirks = MT_QUIRK_ALWAYS_VALID |
+			MT_QUIRK_NO_AREA |
+			MT_QUIRK_CONTACT_CNT_ACCURATE,
 		.sn_move = 2048,
 		.maxcontacts = 40,
 	},