Mesa (master): ac: remove amdgpu.h dependency

Emil Velikov evelikov at kemper.freedesktop.org
Fri Jun 16 11:46:48 UTC 2017


Module: Mesa
Branch: master
Commit: 81945ded0dc3d25d55eaf682dce220fa4c2de9fe
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=81945ded0dc3d25d55eaf682dce220fa4c2de9fe

Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Mon May 29 14:50:47 2017 +0100

ac: remove amdgpu.h dependency

Add a couple of forward declarations and drop the amdgpu.h requirement.

With this we can build the r300 and r600 drivers without the need for
amdgpu.

v2:
 - Add amdgpu.h include in the C file (Marek)
 - Add a comment about pre C11 typedef redeclaration warning (Eric)

Cc: Nicolai Hähnle <nicolai.haehnle at amd.com>
Cc: Marek Olšák <marek.olsak at amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101189
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/amd/common/ac_gpu_info.c | 2 ++
 src/amd/common/ac_gpu_info.h | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index 7d6f6e7d8a..3f39a089ec 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -34,6 +34,8 @@
 #include <xf86drm.h>
 #include <amdgpu_drm.h>
 
+#include <amdgpu.h>
+
 #define CIK_TILE_MODE_COLOR_2D			14
 
 #define CIK__GB_TILE_MODE__PIPE_CONFIG(x)        (((x) >> 6) & 0x1f)
diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h
index 3f7ade1a0b..a72ab58f9a 100644
--- a/src/amd/common/ac_gpu_info.h
+++ b/src/amd/common/ac_gpu_info.h
@@ -28,12 +28,14 @@
 
 #include "amd_family.h"
 
-#include <amdgpu.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+/* Prior to C11 the following may trigger a typedef redeclaration warning */
+typedef void * amdgpu_device_handle;
+struct amdgpu_gpu_info;
+
 struct radeon_info {
 	/* PCI info: domain:bus:dev:func */
 	uint32_t                    pci_domain;




More information about the mesa-commit mailing list