Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1604875yba; Thu, 25 Apr 2019 02:38:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZ1v9hY1xt4snxOlDznQu+NaiuUG7GPRzeFRl7PmxiI0Xbf49krhok/pcGQwuE6cfA/438 X-Received: by 2002:a65:5289:: with SMTP id y9mr9794065pgp.52.1556185089179; Thu, 25 Apr 2019 02:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556185089; cv=none; d=google.com; s=arc-20160816; b=xJDIJ9iIDq9DgsZVP8odnoFY90yORkbwIEa5Y1oBY018KK5atDxfuke+Oeer6ADkHM sivzVNBkdS5106xsnsBmhbixDT4cnHpd5uCXTMMU/FM6/TOt4Ot/lrQNYNpSxF39zBHQ BPz5cu+FfOrvgQwOqlk+E28MNUcMwFzOxorVuyb8Vv9RKKIgx9tmoMA05jIjzxCearpO A6fCQsdZ31BsUm7VgrrIGzdSkvDTD4kyQ8RZ8qwiUdNnNM94wt34jKrxIGQC7UAhzC/9 BmvWPGWEaXwblbmH7ClburcU8M7JcdttVP8NJy3PByYypO53QhEK8pPMPpik7+7eItdz PcHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=isS8TZkGi0trmiIiXznzKRuEqrcdzgBKJAHNrj4hrV4=; b=Vpa8w5PFB9G8MdL8N3OPQ++DZzTQ/kvAsvFgg1SSc2tfmyQV3kIt2nCDTzK027PTYR vHlLn3SVyjY0YVWtU2zIcy2ByzF5R0A2LmWJppGI8MwY5DTNaMeo6aELZ3J7asmfHo5+ zVwJG6aTK6U/+u2NqpSXgRuAZOJ57h4aMugyK7a+dZZSGTCsT94fURZJMqrTcSnS7hKU TKusdQQRSjknlA4Sw9zHnL/Dtcu4WSaIfKd4SD+cvvcHNdMQzZJdT8cjMyPACQaISL0/ UPMzctz4USmitRSNwqO4WBmAma4XU8XYOvchVUDmKIq4P5Soaruu+RiOKeAoZ0aNuXnk Cp4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63si2150914plb.157.2019.04.25.02.37.53; Thu, 25 Apr 2019 02:38:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728168AbfDYJfO convert rfc822-to-8bit (ORCPT + 99 others); Thu, 25 Apr 2019 05:35:14 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:42118 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbfDYJfN (ORCPT ); Thu, 25 Apr 2019 05:35:13 -0400 Received: by mail-qt1-f193.google.com with SMTP id p20so23620316qtc.9 for ; Thu, 25 Apr 2019 02:35:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PcCGgMFkAjixwCwQRM7cW75NJ4uLHdGhJk5S945fw9M=; b=h7jhpGT57uKLsDV8gUQXXafsJUiGanLAPeNqdEsKaDlHo0S4Jl5wEfzVonM460oS1c WuUQANoniV26Le+r5XUL6NXquruRi+lj3uKw5fBwzQV4YPlK0Q1/SponjQcC+Bc3GvBD mS5wJv7ZzCBTOOpkRdibkytCwnFJdvQwbtrHX93XGlRs+gKwtcdyxyFwcuMy3jn2H7Ku Dya2ooHZ+95OjiTMmsXqYnyki8rYiONgtqAZ3W2Z6z4W82jFXDlzRd3A8RzkFdP3nGiD G0F5t0pB9MUjZrYEoFUcmJ8BjZ3GQcCwdgPxl0xWhKQhv7KmDv4hO8sx53RsbXk060MY qdzA== X-Gm-Message-State: APjAAAWPT7+QgqDLixPQkKXEWt9fFcfw72FYFZvwwZkVTYqPdp8yf9HJ exT+8W7VUlmkaJZthKdd7zsOlTLqOAZKTlgYIvnnJg== X-Received: by 2002:a0c:bec4:: with SMTP id f4mr29032872qvj.17.1556184912486; Thu, 25 Apr 2019 02:35:12 -0700 (PDT) MIME-Version: 1.0 References: <20181205004228.10714-1-peter.hutterer@who-t.net> <20181205004228.10714-8-peter.hutterer@who-t.net> In-Reply-To: From: Benjamin Tissoires Date: Thu, 25 Apr 2019 11:35:01 +0200 Message-ID: Subject: Re: [PATCH v3 7/8] HID: logitech: Enable high-resolution scrolling on Logitech mice To: =?UTF-8?Q?Cl=C3=A9ment_VUCHENER?= Cc: Harry Cutts , Peter Hutterer , "open list:HID CORE LAYER" , Dmitry Torokhov , Jiri Kosina , Linus Torvalds , Nestor Lopez Casado , lkml Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 11:29 AM Clément VUCHENER wrote: > > Le jeu. 25 avr. 2019 à 10:45, Benjamin Tissoires > a écrit : > > > > On Thu, Apr 25, 2019 at 10:25 AM Clément VUCHENER > > wrote: > > > > > > Le jeu. 25 avr. 2019 à 09:40, Benjamin Tissoires > > > a écrit : > > > > > > > > Hi Clément, > > > > > > > > On Wed, Apr 24, 2019 at 5:34 PM Clément VUCHENER > > > > wrote: > > > > > > > > > > Hi Benjamin, > > > > > > > > > > I tried again to add hi-res wheel support for the G500 with Hans de > > > > > Goede's latest patch series you've just merged in for-5.2/logitech, it > > > > > is much better but there is still some issues. > > > > > > > > > > The first one is the device index, I need to use device index 0 > > > > > instead 0xff. I added a quick and dirty quirk (stealing in the > > > > > QUIRK_CLASS range since the normal quirk range looks full) to change > > > > > the device index assigned in __hidpp_send_report. After that the > > > > > device is correctly initialized and the wheel multiplier is set. > > > > > > > > Hmm, maybe we should restrain a little bit the reserved quirks... > > > > But actually, .driver_data and .quirks are both unsigned long, so you > > > > should be able to use the 64 bits. > > > > > > Only on 64 bits architectures, or is the kernel forcing long integers > > > to be 64 bits everywhere? > > > > Damnit, you are correct, there is no such enforcement :/ > > > > > > > > > > > > > > > > > > > The second issue is that wheel values are not actually scaled > > > > > according to the multiplier. I get 7/8 full scroll event for each > > > > > wheel step. I think it happens because the mouse is split in two > > > > > devices. The first device has the wheel events, and the second device > > > > > has the HID++ reports. The wheel multiplier is only set on the second > > > > > device (where the hi-res mode is enabled) and does not affect the > > > > > wheel events from the first one. > > > > > > > > I would think this have to do with the device not accepting the > > > > command instead. Can you share some raw logs of the events (ideally > > > > with hid-recorder from > > > > https://gitlab.freedesktop.org/libevdev/hid-tools)? > > > > > > I already checked with usbmon and double-checked by querying the > > > register. The flag is set and accepted by the device and it behaves > > > accordingly: it sends about 8 wheel events per step. > > > > OK, that's what I wanted to see. > > > > > > > > hid-recorder takes hidraw nodes as parameters, how do I use it to > > > record the initialization by the driver? > > > > You can't. But it doesn't really matter here because I wanted to check > > what your mouse is actually sending after the initialization. > > > > So if I read correctly: the mouse is sending high res data but > > evemu-recorder shows one REL_WHEEL event every 7/8 clicks? > > It is HID++ 1.0, there is no special high res data report, it sends > standard HID mouse wheel report, but more of them. > > To be clear, here is a recording using the modified kernel. I moved > the wheel one step up (8 events are generated), then one step down (8 > events again + a 2-event bump). > > # EVEMU 1.3 [snipped] > E: 1.975014 8 00 00 00 00 00 00 01 00 > > The hi-res events should +/-15 instead of +/-120, and less REL_WHEEL > events should be generated. This looks like the multiplier is set to 1 > instead of 8. > > kernel log shows the multiplier is set but only for one of the two devices: > > input: Logitech G500 as > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input25 > hid-generic 0003:046D:C068.0006: input,hidraw5: USB HID v1.11 Mouse > [Logitech G500] on usb-0000:00:14.0-2/input0 > input: Logitech G500 Keyboard as > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input26 > input: Logitech G500 Consumer Control as > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input27 > hid-generic 0003:046D:C068.0007: input,hiddev97,hidraw6: USB HID v1.11 > Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1 > input: Logitech G500 as > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input30 > logitech-hidpp-device 0003:046D:C068.0006: input,hidraw5: USB HID > v1.11 Mouse [Logitech G500] on usb-0000:00:14.0-2/input0 > logitech-hidpp-device 0003:046D:C068.0007: HID++ 1.0 device connected. > logitech-hidpp-device 0003:046D:C068.0007: multiplier = 8 > input: Logitech G500 as > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input31 > logitech-hidpp-device 0003:046D:C068.0007: input,hiddev97,hidraw6: USB > HID v1.11 Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1 > Oh, now I see. And yes you are correct. I wonder if we should not consider the mouse in hid-logitech-dj then. And let hid-logitech-dj merge the 2 nodes together into one hidpp device, and so we are facing a "regular" HID++ device which is consistent. Unfortunately, I am not sure I'll have the time to work on it this week :/ Cheers, Benjamin > > > > > > > Le mer. 19 déc. 2018 à 21:35, Benjamin Tissoires > > > > > a écrit : > > > > > > > > > > > > On Wed, Dec 19, 2018 at 11:57 AM Clément VUCHENER > > > > > > wrote: > > > > > > > > > > > > > > Le sam. 15 déc. 2018 à 15:45, Clément VUCHENER > > > > > > > a écrit : > > > > > > > > > > > > > > > > Le ven. 14 déc. 2018 à 19:37, Harry Cutts a écrit : > > > > > > > > > > > > > > > > > > Hi Clement, > > > > > > > > > > > > > > > > > > On Fri, 14 Dec 2018 at 05:47, Clément VUCHENER > > > > > > > > > wrote: > > > > > > > > > > Hi, The G500s (and the G500 too, I think) does support the "scrolling > > > > > > > > > > acceleration" bit. If I set it, I get around 8 events for each wheel > > > > > > > > > > "click", this is what this driver expects, right? If I understood > > > > > > > > > > correctly, I should try this patch with the > > > > > > > > > > HIDPP_QUIRK_HI_RES_SCROLL_1P0 quirk set for my mouse. > > > > > > > > > > > > > > > > > > Thanks for the info! Yes, that should work. > > > > > > > > > > > > > > > > Well, it is not that simple. I get "Device not connected" errors for > > > > > > > > both interfaces of the mouse. > > > > > > > > > > > > > > I suspect the device is not responding because the hid device is not > > > > > > > started. When is hid_hw_start supposed to be called? It is called > > > > > > > early for HID_QUIRK_CLASS_G920 but later for other device. So the > > > > > > > device is not started when hidpp_is_connected is called. Is this > > > > > > > because most of the device in this driver are not real HID devices but > > > > > > > DJ devices? How should non-DJ devices be treated? > > > > > > > > > > > > Hi Clement, > > > > > > > > > > > > I have a series I sent last September that allows to support non DJ > > > > > > devices on logitech-hidpp > > > > > > (https://patchwork.kernel.org/project/linux-input/list/?series=16359). > > > > > > > > > > > > In its current form, with the latest upstream kernel, the series will > > > > > > oops during the .event() callback, which is easy enough to fix. > > > > > > However, I am currently trying to make it better as a second or third > > > > > > reading made me realized that there was a bunch of non-sense in it and > > > > > > a proper support would require slightly more work for the non unifying > > > > > > receiver case. > > > > > > > > > > > > I hope I'll be able to send out something by the end of the week. > > > > > > > > > > > > Cheers, > > > > > > Benjamin