[Mesa-dev] [PATCH 4/5] ac: remove amdgpu.h dependency

Emil Velikov emil.l.velikov at gmail.com
Mon May 29 13:50:57 UTC 2017


On 26 May 2017 at 17:14, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
> On Friday, 2017-05-26 16:32:52 +0100, Emil Velikov wrote:
>> From: Emil Velikov <emil.velikov at collabora.com>
>>
>> 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.
>>
>> 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>
>> ---
>> Note that I have not extensively tested the series. Will do so in ~two hours.
>>
>>  src/amd/common/ac_gpu_info.h | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h
>> index 3f7ade1a0bb..dabd3b003e1 100644
>> --- a/src/amd/common/ac_gpu_info.h
>> +++ b/src/amd/common/ac_gpu_info.h
>> @@ -28,12 +28,13 @@
>>
>>  #include "amd_family.h"
>>
>> -#include <amdgpu.h>
>> -
>>  #ifdef __cplusplus
>>  extern "C" {
>>  #endif
>>
>> +typedef void * amdgpu_device_handle;
>
> Just FYI: this will cause a 'typedef redefinition' warning if amdgpu.h
> gets included by something that also includes ac_gpu_info.h.
> (This was made legal in C11, but isn't in C99)
>
Indeed it would and there's 3 ways to address it :-)
Since nobody has stated their preference I'd add a comment and leave it as-is.

-Emil


More information about the mesa-dev mailing list