From owner-freebsd-multimedia@freebsd.org Sat Jan 20 18:59:25 2018 Return-Path: Delivered-To: freebsd-multimedia@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CFCFEC04C2 for ; Sat, 20 Jan 2018 18:59:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E13BC3320 for ; Sat, 20 Jan 2018 18:59:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id DD5EDEC04C1; Sat, 20 Jan 2018 18:59:24 +0000 (UTC) Delivered-To: multimedia@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD026EC04C0 for ; Sat, 20 Jan 2018 18:59:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3B82331F for ; Sat, 20 Jan 2018 18:59:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 9EFFD1ECA7 for ; Sat, 20 Jan 2018 18:59:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w0KIxOLf086345 for ; Sat, 20 Jan 2018 18:59:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w0KIxO52086344 for multimedia@FreeBSD.org; Sat, 20 Jan 2018 18:59:24 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" From: bugzilla-noreply@freebsd.org To: multimedia@FreeBSD.org Subject: maintainer-feedback requested: [Bug 225343] multimedia/v4l_compat: Incorrect EVIOCGMTSLOTS ioctl which breaks libevdev Date: Sat, 20 Jan 2018 18:59:24 +0000 X-Bugzilla-Type: request X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: multimedia@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2018 18:59:25 -0000 Jean-S=C3=83=C2=A9bastien P=C3=83=C2=A9dron has reas= signed Bugzilla Automation 's request for maintainer-feedback to multimedia@FreeBSD.org: Bug 225343: multimedia/v4l_compat: Incorrect EVIOCGMTSLOTS ioctl which brea= ks libevdev https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225343 --- Description --- The `EVIOCGMTSLOTS` ioctl is used to query a touchpad's multitouch state. libevdev calls it to initialise its internal state. On Linux, this ioctl is marked as "read". However, this is incorrect on Fre= eBSD because the ioctl takes the multitouch attribute to query as argument. Therefore, the ioctl must be marked as "read+write". Otherwise, the attribu= te doesn't make it to the evdev kernel driver and ioctl(2) returns EINVAL. The visible consequence of this problem is libinput: when you use it as your input DDX in X.Org (the same happens with Wayland probably), some touch eve= nts early in a session are dropped. You have to release and start another touch move do what you wanted in the first place (move the cursor, scroll, ...). The reason is that the multitouch state in libevdev has all fields set to z= ero at first (because the ioctl(2) failed). And when it receives a first touch event which indicate a tracking ID for 0, libevdev thinks there is a bug because the tracking ID is already set to 0, and decides to drop the entire touch action. Here is the message from libevdev: BUG: Device "..." received a double tracking ID 0 in slot 0. When the finger is released, the kernel sends a tracking ID of -1 which fix= es libevdev internal state. Thus, the next touch action does the right thing.