From owner-freebsd-hackers@freebsd.org Sat Nov 9 10:43:17 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 948991A59BD for ; Sat, 9 Nov 2019 10:43:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 479DJ45XfSz4bk4 for ; Sat, 9 Nov 2019 10:43:15 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A2C4F26021C; Sat, 9 Nov 2019 11:43:07 +0100 (CET) Subject: Re: Linux PCI drivers in user space To: Rozhuk Ivan , freebsd-hackers@freebsd.org, Johannes Lundberg References: <20191109080032.231cd203@rimwks> From: Hans Petter Selasky Message-ID: Date: Sat, 9 Nov 2019 11:42:11 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20191109080032.231cd203@rimwks> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 479DJ45XfSz4bk4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.92 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.62)[ip: (-9.16), ipnet: 2a01:4f8::/29(-2.26), asn: 24940(-1.68), country: DE(-0.01)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 10:43:17 -0000 On 2019-11-09 06:00, Rozhuk Ivan wrote: > Hi! > > > Im frustrating with amdgpu on 12.1... > Current status DRM with linuxkpi - it hard to use and hard to support. > FreeBSD stable have no fresh drivers, FreeBSD current - unstable. > > But we have webcamd: > + almost all time fresh drivers from linux > + easy to pull drivers from linux > + easy to debug > + on crash - system continue work > + more secure - driver limited to process memory > - probably a bit slower > > > If add some kernel module that will export all pci devices and > allow to mmap() pci device memory to user space and somehow proxy > IRQ (like events to poll()/kqueue()), IO ports and registers then > webcamd will can work with this like it now works with USB devices, > and fbsd users can use latest DRM and some other drivers. > Also adding sysctl settings to webcamd devices will be very useful. > > Porting and updating drivers in user space webcamd easy then do same > in kernel. > Also all latest drivers will work on all actual FreeBSD versions. Hi, This is how X11 / X.org used to work. The biggest problem is sharing memory between applications if you put everything in user-space. I've been using the new DRM for a while, i915, and there aren't so many issues if you know what you are doing. The biggest problem is keeping the ports-modules up-to-date with the kernel re-builds. What might make life easier is to include the graphics drivers in base, though that might be a bit controversial .... Webcamd is a great tool for drivers, but is mostly focused around USB device. It could probably support PCI devices too, but then I guess libpci would need to be extended. And I would appreciate if more people would be interested contributing to webcamd, now on github :-) --HPS