Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5968imu; Thu, 6 Dec 2018 14:59:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/ULmMsrlPArZpfAMWSXKwUX1KT1Mug92ctJoRRYW62YH/OA4gK5aRG90DHxbHjFgJC1pRHf X-Received: by 2002:a62:8096:: with SMTP id j144mr30938226pfd.140.1544137167032; Thu, 06 Dec 2018 14:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544137166; cv=none; d=google.com; s=arc-20160816; b=HtA21CxUkWfSzmK/cvI80NPv8WgOY00OKgisffL7Sm/D3mo5FPviBruI7UmpIRCWaT MV1Yo3ZlIPb9qJFd7ELipUbfA/lsxFhDQS6B2gXqtiCTiXe8tn3Wg4aQAbD3W4sbixBK t2Q8N/9BQTR8pZSOGH9HaTXPMuGhP6BZGcYSzwrPPXJK8E9OZpUygFRe1TLL8a1uOUTw NU9Jw7vwJgjyts9lu5zbt29M7CjYXX+3ZH0dvdimo9X1n8AXTHYKgUyPLHyTSqKttsV4 2uFfe2DCFJwqNk05yHKfaHUk4hQfBYdvQiwOqJjiLlgwFkAii8bKBqSDVoIe9rMbHh9U Zv4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cuuuP3UzJef2SPmfFTopC4S/InN6jVnTmTU6Z8V43u8=; b=rq+zcpeQ+mhK3ZNy8ALUtjdMT7+YCti5KLaLV0kXAK2qDY8sIq1w0Fhwe1/OQgdqqu GnIs/zYDINt7nVpAMkrLDdavU8gkkbMMK6Cgqi9a8zekNBrxcl0Qg7x6bm4JeDqlcjxH dlrz8s2XvRUQkTi6W0pfTC4V9Mllj7vX86q9VAQLj+77IxAx60/JrZNSsAtwdHZRQK8O Ll9aKE77Zdi4vgE21LrmyXryWUYbk7eSgGRnZNoztCjrJnl3uH4ecPMxJ5V4cNNYzCSq zKFNDqSplC/GrKuOS9r5f3uyeb2b1PGEzdgtdWaFiEar6XBdyjXYhx8kBWfMdorcXtd/ 63ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="a6aUun3/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi6si1281620plb.279.2018.12.06.14.59.11; Thu, 06 Dec 2018 14:59:26 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="a6aUun3/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726206AbeLFW4q (ORCPT + 99 others); Thu, 6 Dec 2018 17:56:46 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:32987 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726040AbeLFW4p (ORCPT ); Thu, 6 Dec 2018 17:56:45 -0500 Received: by mail-pf1-f195.google.com with SMTP id c123so912364pfb.0; Thu, 06 Dec 2018 14:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cuuuP3UzJef2SPmfFTopC4S/InN6jVnTmTU6Z8V43u8=; b=a6aUun3/t+oHKtEuBA0UrORX0QkQBvKGTI5LU8XPYHyWLYUzC/HY8zLmtxLsfjLyNF TrdEtZrGx0i/pNHppOSU3V7cYjp3043AWZ7LIR/X3Exj6IElVchr9Xb+awczUqfJ3q7Y JUXW5Qot8yQO7Ow5LvCfXPcdJ81aN75KgYYrIVSXOuIVOiRJo4Xc3bd1dIrdOngMUrZv WJvnu6naXhMRCbckuIiefsKigyfqeVRCACx7+llGhXBuAs/eg0A925lvBDFaRETJtY1s MPtSZsI90AGY5/GQCUOtXSlkzo1vy3vZwxVL8XtwBEHpIloV5AVljsQ1iaI4rIv00hEo RWgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cuuuP3UzJef2SPmfFTopC4S/InN6jVnTmTU6Z8V43u8=; b=nRdtwDPHXnyzgdWH9/gFS2mFnNQQYfSI3Ez0djAOMx2LOzI9qZVG28YilqRHCzo+4F B0d4+2EkCEYzOTK3KqvoCSk/8LKaDEX6qjloSbA+Ugym1xE59AqVoNw/3tQ8UcfaYRNZ w3Uhb8CmhS8iWUy2u/649dJ5QjuzMuRUVUPWc36ZsApAqMyJ1xDLOtoAKZj6cUtwCKZy gZ4nNLA/Em5wCmSBNdljcSTH2/Z2Q95vUvZqpMu007QX1RSyuQZq0aBhXe/5ua1qIve3 KIhJEVe/faNHg9MaHPt048XKQB6oBg102wXJcwDCT21p0S2On1x8DFFAU/dJ79uSFJcP TUsA== X-Gm-Message-State: AA+aEWY/PapgVasNk2xU26MhpxxRpzdRDn7tVksDx9Z2zQ8hbKz/zvOD LE6wba8Q00iJZlztq8ZyC1w= X-Received: by 2002:a62:a1a:: with SMTP id s26mr30579070pfi.31.1544137004631; Thu, 06 Dec 2018 14:56:44 -0800 (PST) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id t29sm2199047pfa.158.2018.12.06.14.56.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 14:56:43 -0800 (PST) Date: Thu, 6 Dec 2018 14:56:41 -0800 From: Dmitry Torokhov To: Peter Hutterer Cc: linux-input@vger.kernel.org, Jiri Kosina , Harry Cutts , torvalds@linux-foundation.org, Nestor Lopez Casado , linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: Re: [PATCH v3 1/8] Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES` Message-ID: <20181206225641.GB34001@dtor-ws> References: <20181205004228.10714-1-peter.hutterer@who-t.net> <20181205004228.10714-2-peter.hutterer@who-t.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181205004228.10714-2-peter.hutterer@who-t.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2018 at 10:42:21AM +1000, Peter Hutterer wrote: > This event code represents scroll reports from high-resolution wheels and > is modelled after the approach Windows uses. The value 120 is one detent > (wheel click) of movement. Mice with higher-resolution scrolling can send > fractions of 120 which must be accumulated in userspace. Userspace can either > wait for a full 120 to accumulate or scroll by fractions of one logical scroll > movement as the events come in. 120 was picked as magic number because it has > a high number of integer fractions that can be used by high-resolution wheels. > > For more information see > https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn613912(v=vs.85) > > These new axes obsolete REL_WHEEL and REL_HWHEEL. The legacy axes are emulated > by the kernel but the most accurate (and most granular) data is available > through the new axes. > > Signed-off-by: Peter Hutterer Acked-by: Dmitry Torokhov > --- > No changes since v1 > > Documentation/input/event-codes.rst | 21 ++++++++++++++++++++- > include/uapi/linux/input-event-codes.h | 2 ++ > 2 files changed, 22 insertions(+), 1 deletion(-) > > diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst > index a8c0873beb95..b24b5343f5eb 100644 > --- a/Documentation/input/event-codes.rst > +++ b/Documentation/input/event-codes.rst > @@ -190,7 +190,26 @@ A few EV_REL codes have special meanings: > * REL_WHEEL, REL_HWHEEL: > > - These codes are used for vertical and horizontal scroll wheels, > - respectively. > + respectively. The value is the number of detents moved on the wheel, the > + physical size of which varies by device. For high-resolution wheels > + this may be an approximation based on the high-resolution scroll events, > + see REL_WHEEL_HI_RES. These event codes are legacy codes and > + REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES should be preferred where > + available. > + > +* REL_WHEEL_HI_RES, REL_HWHEEL_HI_RES: > + > + - High-resolution scroll wheel data. The accumulated value 120 represents > + movement by one detent. For devices that do not provide high-resolution > + scrolling, the value is always a multiple of 120. For devices with > + high-resolution scrolling, the value may be a fraction of 120. > + > + If a vertical scroll wheel supports high-resolution scrolling, this code > + will be emitted in addition to REL_WHEEL or REL_HWHEEL. The REL_WHEEL > + and REL_HWHEEL may be an approximation based on the high-resolution > + scroll events. There is no guarantee that the high-resolution data > + is a multiple of 120 at the time of an emulated REL_WHEEL or REL_HWHEEL > + event. > > EV_ABS > ------ > diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h > index 3eb5a4c3d60a..265ef2028660 100644 > --- a/include/uapi/linux/input-event-codes.h > +++ b/include/uapi/linux/input-event-codes.h > @@ -716,6 +716,8 @@ > * the situation described above. > */ > #define REL_RESERVED 0x0a > +#define REL_WHEEL_HI_RES 0x0b > +#define REL_HWHEEL_HI_RES 0x0c > #define REL_MAX 0x0f > #define REL_CNT (REL_MAX+1) > > -- > 2.19.2 > -- Dmitry