From owner-freebsd-arch@freebsd.org Thu May 12 10:45:11 2016 Return-Path: Delivered-To: freebsd-arch@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 BDD45B38B3F for ; Thu, 12 May 2016 10:45:11 +0000 (UTC) (envelope-from kmacybsd@gmail.com) 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 9C4941749 for ; Thu, 12 May 2016 10:45:11 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 97F44B38B3E; Thu, 12 May 2016 10:45:11 +0000 (UTC) Delivered-To: arch@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 95476B38B3D for ; Thu, 12 May 2016 10:45:11 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486141746; Thu, 12 May 2016 10:45:11 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-ig0-x22d.google.com with SMTP id m9so50126551ige.1; Thu, 12 May 2016 03:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=6wGGdF6zkL1rsWW6CeCrdHKqhIuQ4sDIn2KXiKN8dEc=; b=kwjkhlvsmtAraZdMZt9CYPeHrZgofgtlvwiuP1ZQ6A87cBWxNMcmI0s74M9QIfPrrW sX8NEw69wLlLyFe5D21GTJbbpbZjKTXvKAYcQz6hV7oA/JNfYvbYTpW3l1FSFZ7tzkQS OWR2VMh2FP98Nk/Q61fk0zDhkbL7vO5rZn2r5ossu/Q9Fk7BFnLUDaWQZyf8H+2U3xu6 +tf7LUFwNvPLpVCdop0rY3UX/0bM8Nt0stBW6XVCI9OzZDrstE0iWZjV/v6oBOHq2qXH Dpy+NHkQd1mDgKrG5k2e0b8OYuLGmc6rUCUDiuw9DQZE9s4QDVPgsQMgu1s3fvdOwVgZ nOaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=6wGGdF6zkL1rsWW6CeCrdHKqhIuQ4sDIn2KXiKN8dEc=; b=jsE4YFiyBWIaYEqPxup2DJzc8VsaJWmt7JXAUwn5Giy47fY6yQ5dgaaPszXx9mO3xH KYqpPlPV+Nr9oZJl8F0vjPwGWo5ojIgdEsIE3fKVchv0LKVEQanVemXf2rclVTbx8vJN DQsicDGqjjcwZ+17zLVP6uncfpU1X+NjwvEHmhg0cumqVzSFsl19LoTu+G56QAdoM8Yj abe4LL9cLMEBqTCJB7dczLiC3/fQWXDF732wI8xJd4dfi2uQ0r62ge2f7stomzYvMZFm TMrgY/94dFUR5zSgyP4a80idBZUPhMOAGnQScgXTCmjIw527OcA6DBbMcaIpOAcK5qIx qVdw== X-Gm-Message-State: AOPr4FVAkUnlJCOyakr7lxOuqeUIUeAuumS9w1rZ28FlgwEK9w2SY9GTLFxWP+hG7zFA9asa5oc6+FpaqDDpBg== MIME-Version: 1.0 X-Received: by 10.50.124.39 with SMTP id mf7mr5450871igb.95.1463049910589; Thu, 12 May 2016 03:45:10 -0700 (PDT) Sender: kmacybsd@gmail.com Received: by 10.107.140.8 with HTTP; Thu, 12 May 2016 03:45:10 -0700 (PDT) In-Reply-To: References: Date: Thu, 12 May 2016 03:45:10 -0700 X-Google-Sender-Auth: uwrdSodKrl-dsLjv_K_Oi6rHTmQ Message-ID: Subject: Re: MMU Notifiers and the quest for graphics feature parity From: "K. Macy" To: =?UTF-8?Q?Ren=C3=A9_Ladan?= Cc: "freebsd-arch@freebsd.org" , Mark Johnston , Ed Maste Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2016 10:45:11 -0000 On Thursday, May 12, 2016, Ren=C3=A9 Ladan wrote: > 2016-05-12 5:37 GMT+02:00 K. Macy >: > > My motivation for writing this email stems from my recent work extendin= g > the > > linuxkpi to facilitate updating graphics support for FreeBSD. I've made > > reasonable progress limiting my changes to the linuxkpi so far. I have > 3D HW > > acceleration working on an essentially unmodified 4.6-rc5 drm and i915 > driver. > > The 4.6 i915 driver supports all of Haswell (3.8 doesn't), Broadwall, > Skylake, > > and the, as of yet, unreleased Kaby Lake processors. Additionally, I am > > expecting a Thinkpad e565 (AMD based) to arrive on Friday which will > allow me > > to bring up amdgpu (the Radeon driver for post 2013 AMD GPU hardware) > this > > weekend. I find this exciting as it means that FreeBSD will be able to > run on > > _all_ x86 graphics hardware. Unfortunately, most if not all ARM GPU > drivers > > are closed source. > > > > This isn't quite everything though. There is a new "userptr" ioctl in > > graphics drivers that allows applications to safely register user memor= y > with > > the driver. This works because if pages are evicted or the process goe= s > away, > > the driver will be notified first. This notification takes place throug= h > the > > "mmu notifier" facility. > > > > MMU Notifiers are essentially just VM callbacks (or in FreeBSD parlance > > eventhandlers). They were first added to Linux to enable KVM to better > > interoperate with the native VM's resident set management: > > > > https://lwn.net/Articles/266320/ > > > > They're now also used by IB, IOMMUs, MPSS (Xeon Phi), and graphics > drivers. > > The API is well enough documented in the header file: > > > > http://lxr.free-electrons.com/source/include/linux/mmu_notifier.h > > > > > > I don't have strong feelings for what these are called or their precise > > location. I do, however, need to be able to support roughly equivalent > > semantics when I register these eventhandlers from the notifer calls in > the > > linuxkpi. > > > > I haven't worked on the VM in a year or two so don't know quite how to > proceed. > > I'm happy to produce patches for review, but fear that they might be > rejected > > out of hand for one reason or another. I'd like feedback on the approac= h > > itself and what I might do to make any proposed patches more palatable. > > > I have a laptop with both an nVidia GeForce 940M and a built-in > graphics card on the Intel i7 6500U CPU: > vgapci0@pci0:0:2:0: class=3D0x030000 card=3D0x09851025 chip=3D0x19168= 086 > rev=3D0x07 hdr=3D0x00 > vendor =3D 'Intel Corporation' > device =3D 'HD Graphics 520' > class =3D display > subclass =3D VGA > > So if I understand correctly this 520 chip might work with your patch? > Stock FreeBSD 11.0 r298793 with xf86-video-intel 2.21.15_9 does not > see the driver. > For now it does run with scfb. Yes. I don't have a Skylake based laptop (I will shortly), so I haven't actually tested it yet. That's part of what I'm waiting on for a CFT. I haven't tested prime support yet at all so switching between the discrete and integrated based on C state or other power management policy is a week or two off - at least. I appreciate your enthusiasm but please let's move all device support and other X11 discussion to the X11 list. Thanks. -M > > Thanks for your work, > Ren=C3=A9 > -- > https://rene-ladan.nl/ >