[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION
From: |
Chen Gang |
Subject: |
Re: [PATCH v3] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION |
Date: |
Sun, 31 May 2020 06:08:52 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 2020/5/28 下午6:25, Laurent Vivier wrote:
>> diff --git a/configure b/configure
>> index e225a1e3ff..2c2c489d1e 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3912,6 +3912,24 @@ EOF
>> fi
>> fi
>>
>> +#########################################
>> +# libdrm check
>> +
>> +cat > $TMPC << EOF
>> +#include <libdrm/drm.h>
>> +#include <sys/ioctl.h>
>> +int main(void)
>> +{
>> + struct drm_version version;
>> + ioctl(-1, DRM_IOCTL_VERSION, &version);
>> + return 0;
>> +}
>> +EOF
>> +if ! compile_prog "" ; then
>> + error_exit "libdrm check failed" \
>> + "Make sure to have the libdrm/drm.h installed."
>> +fi
>
> You break the build of qemu if libdrm is not available, not a good idea.
>
> In fact, you should only check for the include with something like
> "check_include libdrm/drm.h" and then define a HAVE_DRM_H to use it
> around the new code:
>
> #ifdef HAVE_DRM_H
> #include <libdrm/drm.h>
> #endif
>
> ...
> #ifdef HAVE_DRM_H
> static inline abi_long target_to_host_drmversion(...
> ...
> #endif
> ...
>
> #ifdef HAVE_DRM_H
> IOCTL_SPECIAL(DRM_IOCTL_VERSION,...
> ...
> #endif
>
OK, thanks. I'll send patch v4
Chen Gang