ac: remove amdgpu.h dependency
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 29 May 2017 13:50:47 +0000 (14:50 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 16 Jun 2017 11:41:44 +0000 (12:41 +0100)
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@amd.com>
Cc: Marek Olšák <marek.olsak@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101189
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h

index 7d6f6e7d8acda4a29837d569036cf0407edeffb0..3f39a089ecb59a2ca22473d456c6a9fec9bcbc30 100644 (file)
@@ -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)
index 3f7ade1a0bb18304c8740773afec0290450d2b6b..a72ab58f9a32fc1004ef6452d196fe6d2fca7d57 100644 (file)
 
 #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;