* [PATCH rdma-core] configure: Check the existence of all needed DRM headers
@ 2021-03-22 20:20 Jianxin Xiong
2021-03-23 2:09 ` liweihang
2021-03-25 13:20 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Jianxin Xiong @ 2021-03-22 20:20 UTC (permalink / raw)
To: linux-rdma
Cc: Jianxin Xiong, Doug Ledford, Jason Gunthorpe, Leon Romanovsky, liweihang
Some vendor specific DRM headers may be missing on systems with old
kernels. Make sure that all headers needed by pyverbs/dmabuf_alloc.c
are present before enabling that module.
Remove unused reference of "radeon_drm.h" from pyverbs/dmabuf_alloc.c.
Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
---
CMakeLists.txt | 6 +++++-
pyverbs/dmabuf_alloc.c | 1 -
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a2f49..1208ab6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -526,7 +526,11 @@ if (NOT DRM_INCLUDE_DIRS)
endif()
if (DRM_INCLUDE_DIRS)
- include_directories(${DRM_INCLUDE_DIRS})
+ if (EXISTS ${DRM_INCLUDE_DIRS}/i915_drm.h AND EXISTS ${DRM_INCLUDE_DIRS}/amdgpu_drm.h)
+ include_directories(${DRM_INCLUDE_DIRS})
+ else()
+ unset(DRM_INCLUDE_DIRS CACHE)
+ endif()
endif()
#-------------------------
diff --git a/pyverbs/dmabuf_alloc.c b/pyverbs/dmabuf_alloc.c
index 9978a5b..e3ea0a4 100644
--- a/pyverbs/dmabuf_alloc.c
+++ b/pyverbs/dmabuf_alloc.c
@@ -14,7 +14,6 @@
#include <drm.h>
#include <i915_drm.h>
#include <amdgpu_drm.h>
-#include <radeon_drm.h>
#include "dmabuf_alloc.h"
/*
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-core] configure: Check the existence of all needed DRM headers
2021-03-22 20:20 [PATCH rdma-core] configure: Check the existence of all needed DRM headers Jianxin Xiong
@ 2021-03-23 2:09 ` liweihang
2021-03-25 13:20 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: liweihang @ 2021-03-23 2:09 UTC (permalink / raw)
To: Jianxin Xiong, linux-rdma; +Cc: Doug Ledford, Jason Gunthorpe, Leon Romanovsky
On 2021/3/23 4:05, Jianxin Xiong wrote:
> Some vendor specific DRM headers may be missing on systems with old
> kernels. Make sure that all headers needed by pyverbs/dmabuf_alloc.c
> are present before enabling that module.
>
> Remove unused reference of "radeon_drm.h" from pyverbs/dmabuf_alloc.c.
>
> Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
> ---
> CMakeLists.txt | 6 +++++-
> pyverbs/dmabuf_alloc.c | 1 -
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index e9a2f49..1208ab6 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -526,7 +526,11 @@ if (NOT DRM_INCLUDE_DIRS)
> endif()
>
> if (DRM_INCLUDE_DIRS)
> - include_directories(${DRM_INCLUDE_DIRS})
> + if (EXISTS ${DRM_INCLUDE_DIRS}/i915_drm.h AND EXISTS ${DRM_INCLUDE_DIRS}/amdgpu_drm.h)
> + include_directories(${DRM_INCLUDE_DIRS})
> + else()
> + unset(DRM_INCLUDE_DIRS CACHE)
> + endif()
> endif()
>
> #-------------------------
> diff --git a/pyverbs/dmabuf_alloc.c b/pyverbs/dmabuf_alloc.c
> index 9978a5b..e3ea0a4 100644
> --- a/pyverbs/dmabuf_alloc.c
> +++ b/pyverbs/dmabuf_alloc.c
> @@ -14,7 +14,6 @@
> #include <drm.h>
> #include <i915_drm.h>
> #include <amdgpu_drm.h>
> -#include <radeon_drm.h>
> #include "dmabuf_alloc.h"
>
> /*
>
Tested-by: Weihang Li <liweihang@huawei.com>
It solves the issue I met on my server with ubuntu 14.04 ,thank you.
Weihang
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-core] configure: Check the existence of all needed DRM headers
2021-03-22 20:20 [PATCH rdma-core] configure: Check the existence of all needed DRM headers Jianxin Xiong
2021-03-23 2:09 ` liweihang
@ 2021-03-25 13:20 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-03-25 13:20 UTC (permalink / raw)
To: Jianxin Xiong; +Cc: linux-rdma, Doug Ledford, Leon Romanovsky, liweihang
On Mon, Mar 22, 2021 at 01:20:21PM -0700, Jianxin Xiong wrote:
> Some vendor specific DRM headers may be missing on systems with old
> kernels. Make sure that all headers needed by pyverbs/dmabuf_alloc.c
> are present before enabling that module.
>
> Remove unused reference of "radeon_drm.h" from pyverbs/dmabuf_alloc.c.
>
> Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
> CMakeLists.txt | 6 +++++-
> pyverbs/dmabuf_alloc.c | 1 -
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index e9a2f49..1208ab6 100644
> +++ b/CMakeLists.txt
> @@ -526,7 +526,11 @@ if (NOT DRM_INCLUDE_DIRS)
> endif()
>
> if (DRM_INCLUDE_DIRS)
> - include_directories(${DRM_INCLUDE_DIRS})
> + if (EXISTS ${DRM_INCLUDE_DIRS}/i915_drm.h AND EXISTS ${DRM_INCLUDE_DIRS}/amdgpu_drm.h)
> + include_directories(${DRM_INCLUDE_DIRS})
It should be in a compile test not coded like this.
The whole thing is getting complex, it should probably go into a
find_package() subroutine
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-25 13:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 20:20 [PATCH rdma-core] configure: Check the existence of all needed DRM headers Jianxin Xiong
2021-03-23 2:09 ` liweihang
2021-03-25 13:20 ` Jason Gunthorpe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.