[Libva] [PATCH intel-driver v2 3/3] extbuf: add support for userptr imports.

Emil Velikov emil.l.velikov at gmail.com
Thu Apr 2 15:37:53 PDT 2015


Hi gents,

Just a small suggestion

On 2 April 2015 at 22:29, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> On Thu, Apr 02, 2015 at 04:30:24PM +0200, Gwenole Beauchesne wrote:
...
>> diff --git a/configure.ac b/configure.ac
>> index d71a3cc..3c19cd2 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -76,6 +76,25 @@ LIBDRM_VERSION=libdrm_version
>>  PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
>>  AC_SUBST(LIBDRM_VERSION)
>>
>> +AC_CACHE_CHECK([whether libdrm supports userptr allocations],
>> +    [ac_cv_libdrm_has_userptr],
>> +    [saved_CPPFLAGS="$CPPFLAGS"
>> +     saved_CFLAGS="$CFLAGS"
>> +     CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"
>> +     LIBS="$LIBS $DRM_LIBS -ldrm_intel"
>> +     AC_TRY_LINK(
>> +         [#include <intel_bufmgr.h>],
>> +         [drm_intel_bo_alloc_userptr(NULL, NULL, NULL, 0, 0, 0, 0)],
>> +         [ac_cv_libdrm_has_userptr="yes"],
>> +         [ac_cv_libdrm_has_userptr="no"])
>> +     CPPFLAGS="$saved_CPPFLAGS"
>> +     LIBS="$saved_LIBS"]
>> +)
>> +if test "$ac_cv_libdrm_has_userptr" = "yes"; then
>> +    AC_DEFINE([HAVE_DRM_INTEL_USERPTR], [1],
>> +        [Defined to 1 if libdrm supports userptr allocations])
>> +fi
>
> Did you consider
>
> if pkg-config --exists 'libdrm_intel >= 2.4.57'; then
>     AC_DEFINE([HAVE_DRM_INTEL_USERPTR], [1],
>         [Defined to 1 if libdrm supports userptr allocations])
> fi
>
Normally hard coding pkg-config is considered a bad idea. Please try
PKG_CHECK_EXISTS - it would work like a charm when cross-compiling.

Cheers
Emil


More information about the Libva mailing list