On Wed, 3 Feb 2021 at 17:58, Xiong, Jianxin <jianxin.xi...@intel.com> wrote:
>
> > -----Original Message-----
> > From: Daniel Vetter <dan...@ffwll.ch>
> > Sent: Wednesday, February 03, 2021 9:53 AM
> > To: Xiong, Jianxin <jianxin.xi...@intel.com>
> > Cc: Leon Romanovsky <l...@kernel.org>; Jason Gunthorpe <j...@ziepe.ca>; Gal 
> > Pressman <galpr...@amazon.com>; Yishai Hadas
> > <yish...@nvidia.com>; linux-rdma <linux-r...@vger.kernel.org>; Edward 
> > Srouji <edwa...@nvidia.com>; dri-devel <dri-
> > de...@lists.freedesktop.org>; Christian Koenig <christian.koe...@amd.com>; 
> > Doug Ledford <dledf...@redhat.com>; Vetter, Daniel
> > <daniel.vet...@intel.com>
> > Subject: Re: [PATCH rdma-core v7 4/6] pyverbs: Add dma-buf based MR support
> >
> > On Wed, Feb 3, 2021 at 5:57 PM Xiong, Jianxin <jianxin.xi...@intel.com> 
> > wrote:
> > >
> > > > -----Original Message-----
> > > > From: Leon Romanovsky <l...@kernel.org>
> > > > Sent: Tuesday, February 02, 2021 10:03 PM
> > > > To: Daniel Vetter <dan...@ffwll.ch>
> > > > Cc: Xiong, Jianxin <jianxin.xi...@intel.com>; Jason Gunthorpe
> > > > <j...@ziepe.ca>; Gal Pressman <galpr...@amazon.com>; Yishai Hadas
> > > > <yish...@nvidia.com>; linux-rdma <linux-r...@vger.kernel.org>;
> > > > Edward Srouji <edwa...@nvidia.com>; dri-devel <dri-
> > > > de...@lists.freedesktop.org>; Christian Koenig
> > > > <christian.koe...@amd.com>; Doug Ledford <dledf...@redhat.com>;
> > > > Vetter, Daniel <daniel.vet...@intel.com>
> > > > Subject: Re: [PATCH rdma-core v7 4/6] pyverbs: Add dma-buf based MR
> > > > support
> > > >
> > >
> > > <...>
> > >
> > > > > > > > > > > +#include <drm/drm.h>
> > > > > > > > > > > +#include <drm/i915_drm.h> #include <drm/amdgpu_drm.h>
> > > > > > > > > > > +#include <drm/radeon_drm.h>
> > > > > > > > > >
> > > > > > > > > > I assume these should come from the kernel headers package, 
> > > > > > > > > > right?
> > > > > > > > >
> > > > > > > > > This is gross, all kernel headers should be placed in
> > > > > > > > > kernel-headers/* and "update" script needs to be extended to 
> > > > > > > > > take drm/* files too :(.
> > > > > > > >
> > > > > > > > drm kernel headers are in the libdrm package. You need that
> > > > > > > > anyway for doing the ioctls (if you don't hand-roll the 
> > > > > > > > restarting yourself).
> > > > > > > >
> > > > > > > > Also our userspace has gone over to just outright copying
> > > > > > > > the driver headers. Not the generic headers, but for the
> > > > > > > > rendering side of gpus, which is the topic here, there's really 
> > > > > > > > not much generic stuff.
> > > > > > > >
> > > > > > > > > Jianxin, are you fixing it?
> > > > > > > >
> > > > > > > > So fix is either to depend upon libdrm for building, or have
> > > > > > > > copies of the headers included in the package for the
> > > > > > > > i915/amdgpu/radeon headers (drm/drm.h probably not so good 
> > > > > > > > idea).
> > > > > > >
> > > > > > > We should have a cmake test to not build the drm parts if it 
> > > > > > > can't be built, and pyverbs should skip the tests.
> > > > > > >
> > > > > >
> > > > > > Yes, I will add a test for that. Also, on SLES, the headers
> > > > > > could be under /usr/include/libdrm instead of /usr/include/drm.
> > > > > > The make test
> > > > should check that and use proper path.
> > > > >
> > > > > Please use pkgconfig for this, libdrm installs a .pc file to make
> > > > > sure you can find the right headers.
> > > >
> > > > rdma-core uses cmake build system and in our case cmake find_library() 
> > > > is preferable over pkgconfig.
> > >
> > > Only the headers are needed, and they could be installed via either the 
> > > libdrm-devel package or the kernel-headers package. The cmake
> > find_path() command is more suitable here.
> >
> > Except if your distro is buggy (or doesn't support any gpu drivers at
> > all) they will never be installed as part of kernel-headers.
>
> Right, that's why we want to check for the existence of the header file 
> (find_path() does just that) instead of the existence of the package(s).
>
Fwiw the .pc file does not list "packages", but the location of the
headers and/or libraries.
Last time I tried find_path() wasn't that great, since it had no way
to detect non-standard (aka outside of /usr/include) installs.

HTH
-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to