From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: [PATCH] gnu: mesa: Add libva input. Date: Wed, 29 Apr 2015 16:59:40 +0800 Message-ID: <87oam7e2df.fsf@gmail.com> References: <87zj5se6o0.fsf@taylan.uni.cx> <87383kbah1.fsf@gmail.com> <87r3r4dmwq.fsf@taylan.uni.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnNpo-00047L-Pt for guix-devel@gnu.org; Wed, 29 Apr 2015 04:59:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnNpl-0000pu-6z for guix-devel@gnu.org; Wed, 29 Apr 2015 04:59:12 -0400 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]:34948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnNpk-0000p2-UY for guix-devel@gnu.org; Wed, 29 Apr 2015 04:59:09 -0400 Received: by pabtp1 with SMTP id tp1so22176243pab.2 for ; Wed, 29 Apr 2015 01:59:07 -0700 (PDT) In-Reply-To: <87r3r4dmwq.fsf@taylan.uni.cx> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?Q?Taylan_Ulrich_Bay=C4=B1rl=C4=B1=2FKammer?= Cc: guix-devel@gnu.org "Taylan Ulrich Bay=C4=B1rl=C4=B1/Kammer" writes: > =E5=AE=8B=E6=96=87=E6=AD=A6 writes: > >> Look good to me, but how does it work? >> According to archlinux, it will build 'gallium_drv_video.so', >> described as VA-API implementation for gallium. >> IIUC, libva may dlopen this gallium_drv_video.so? > > I had to tinker and research for several hours to be able to answer your > question, but good thing you asked. :-) > > Firstly: > > I grepped the libva sources for 'dlopen' and found three places it's > used: > > - to open libatiadlxx.so, which AFAIUI is a proprietary ATI driver which > we wouldn't support anyway, > > - to open libva-x11.so, which it installs in $prefix/lib; I patched the > .c file to use the absolute path to this .so, and > > - to open drivers found in $LIBVA_DRIVERS_PATH, falling back to the CPP > macro VA_DRIVERS_PATH, which should both contain absolute directory > names so it's fine. > > Secondly: > > The default value for VA_DRIVERS_PATH is $prefix/lib/dri (where $prefix > is that of libva), which contains only some dummy driver installed by > libva; most drivers are instead in $mesa_prefix/lib/dri. So it's > probably best to set VA_DRIVERS_PATH to $mesa_prefix/lib/dri. So I > added --with-drivers-path to libva's configure flags (plus added a make > flag to solve a certain problem; see patch). OK. > > By the way: > > If a package wants to use libva with a driver that doesn't come with > mesa, then they will have to set LIBVA_DRIVERS_PATH. A user may also > add ~/.guix-profile/lib/dri to LIBVA_DRIVERS_PATH, and install any > number of packages installing graphics drivers there. Yes, it's reasonable. > > Thirdly, and I can finally answer your question: > > Comes out "gallium_drv_video.so", found in Arch's "libva-mesa" package, > is actually Mesa's Gallium-based implementation of VA API, alternative > to stock libva. (Arch also has a regular libva package, containing the > real libva.) The gallium_drv_video.so driver is installed in mesa's > $prefix/lib/dri when building it is enabled, so all is fine. So, it's a 'backend' just like libva-intel-driver, get it. > > Also, Mesa needs libva's header files for building it, and this actually > seems to be the sole reason Mesa depends on libva. I considered making > a "libva-headers" package (like the mesa-headers package), but Mesa uses > pkg-config to test libva's presence so I'm not sure if that would work, > and libva is small anyway so building it twice should be OK. No problem, and if mesa only use the header, the libva-no-mesa won't be included as dependencies when user download it from hydra. Thanks for your detailed explanation!