diff mbox

[intel-gpu-tools] configure: Don't bail if libdrm_nouveau isn't available.

Message ID 1381463805-10521-1-git-send-email-mattst88@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Matt Turner Oct. 11, 2013, 3:56 a.m. UTC
We were seriously *requiring* libdrm_nouveau unless explicitly disabled?
---
 configure.ac | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Ben Widawsky Oct. 11, 2013, 4 a.m. UTC | #1
On Thu, Oct 10, 2013 at 08:56:45PM -0700, Matt Turner wrote:
> We were seriously *requiring* libdrm_nouveau unless explicitly disabled?

Acked-by: Ben Widawsky <ben@bwidawsk.net>

> ---
>  configure.ac | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f65942f..43740f9 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -92,8 +92,11 @@ AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes])
>  # -----------------------------------------------------------------------------
>  # for dma-buf tests
>  AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
> -	      [Enable use of nouveau API for prime tests (default: enabled)]),
> -	      [NOUVEAU=$enableval], [NOUVEAU=yes])
> +	      [Enable use of nouveau API for prime tests (default: auto)]),
> +	      [NOUVEAU=$enableval], [NOUVEAU=auto])
> +if test "x$NOUVEAU" = xauto; then
> +	PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no])
> +fi
>  if test "x$NOUVEAU" = xyes; then
>  	PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
>  	AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
> -- 
> 1.8.3.2
>
Daniel Vetter Oct. 11, 2013, 7:40 a.m. UTC | #2
On Fri, Oct 11, 2013 at 5:56 AM, Matt Turner <mattst88@gmail.com> wrote:
> We were seriously *requiring* libdrm_nouveau unless explicitly disabled?

I've had a bit of hilarious fail with optional testcases that
automatically get disabled when depencies aren't around. Hence why
they're all required by default with the optional switch to disable
them.
-Daniel
Matt Turner Oct. 11, 2013, 7:51 p.m. UTC | #3
On Fri, Oct 11, 2013 at 12:40 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Oct 11, 2013 at 5:56 AM, Matt Turner <mattst88@gmail.com> wrote:
>> We were seriously *requiring* libdrm_nouveau unless explicitly disabled?
>
> I've had a bit of hilarious fail with optional testcases that
> automatically get disabled when depencies aren't around. Hence why
> they're all required by default with the optional switch to disable
> them.

You've had this problem in general, or with nouveau?

I mean, this is kind of how autotools is supposed to work. If you
explicitly want to ensure something is built you add --enable-thing.
Daniel Vetter Oct. 11, 2013, 9:24 p.m. UTC | #4
On Fri, Oct 11, 2013 at 12:51:34PM -0700, Matt Turner wrote:
> On Fri, Oct 11, 2013 at 12:40 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Fri, Oct 11, 2013 at 5:56 AM, Matt Turner <mattst88@gmail.com> wrote:
> >> We were seriously *requiring* libdrm_nouveau unless explicitly disabled?
> >
> > I've had a bit of hilarious fail with optional testcases that
> > automatically get disabled when depencies aren't around. Hence why
> > they're all required by default with the optional switch to disable
> > them.
> 
> You've had this problem in general, or with nouveau?

In general.

> I mean, this is kind of how autotools is supposed to work. If you
> explicitly want to ensure something is built you add --enable-thing.

Yeah, but otoh I'm positively incompetent ;-) And since the main use case
for i-g-t is to distribute the tests autoconf doesn't quite work like it
usually does.
-Daniel
Matt Turner Oct. 11, 2013, 9:29 p.m. UTC | #5
On Fri, Oct 11, 2013 at 2:24 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Oct 11, 2013 at 12:51:34PM -0700, Matt Turner wrote:
>> On Fri, Oct 11, 2013 at 12:40 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>> > On Fri, Oct 11, 2013 at 5:56 AM, Matt Turner <mattst88@gmail.com> wrote:
>> >> We were seriously *requiring* libdrm_nouveau unless explicitly disabled?
>> >
>> > I've had a bit of hilarious fail with optional testcases that
>> > automatically get disabled when depencies aren't around. Hence why
>> > they're all required by default with the optional switch to disable
>> > them.
>>
>> You've had this problem in general, or with nouveau?
>
> In general.

So I think what I'm saying is that the nouveau support in
intel-gpu-tools isn't the project's primary purpose, so we should
allow it to build without nouveau support if you don't have nouveau
installed. If you don't have nouveau installed, you're not making a
mistake by not building intel-gpu-tools without support. And if you
have nouveau installed, you still get nouveau support.
Chad Versace Oct. 11, 2013, 10:51 p.m. UTC | #6
On 10/11/2013 02:29 PM, Matt Turner wrote:
> On Fri, Oct 11, 2013 at 2:24 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Fri, Oct 11, 2013 at 12:51:34PM -0700, Matt Turner wrote:
>>> On Fri, Oct 11, 2013 at 12:40 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>>> On Fri, Oct 11, 2013 at 5:56 AM, Matt Turner <mattst88@gmail.com> wrote:
>>>>> We were seriously *requiring* libdrm_nouveau unless explicitly disabled?
>>>>
>>>> I've had a bit of hilarious fail with optional testcases that
>>>> automatically get disabled when depencies aren't around. Hence why
>>>> they're all required by default with the optional switch to disable
>>>> them.
>>>
>>> You've had this problem in general, or with nouveau?
>>
>> In general.
>
> So I think what I'm saying is that the nouveau support in
> intel-gpu-tools isn't the project's primary purpose, so we should
> allow it to build without nouveau support if you don't have nouveau
> installed. If you don't have nouveau installed, you're not making a
> mistake by not building intel-gpu-tools without support. And if you
> have nouveau installed, you still get nouveau support.

I completely agree with Matt.

If the system doesn't already have nouveau installed, then it there is very
low likelihood that it makes any sense to install nouveau onto that system.
It very likely does not have NVidia hardware at all. So why require it?
Let's just autodetect it and behave sanely.

Requiring libdrm_nouveau is a nuisance for developers working on platforms
where libdrm doesn't get built with NVidia support.
Chad Versace Oct. 11, 2013, 10:52 p.m. UTC | #7
On 10/11/2013 03:51 PM, Chad Versace wrote:
> On 10/11/2013 02:29 PM, Matt Turner wrote:
>> On Fri, Oct 11, 2013 at 2:24 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>> On Fri, Oct 11, 2013 at 12:51:34PM -0700, Matt Turner wrote:
>>>> On Fri, Oct 11, 2013 at 12:40 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>>>> On Fri, Oct 11, 2013 at 5:56 AM, Matt Turner <mattst88@gmail.com> wrote:
>>>>>> We were seriously *requiring* libdrm_nouveau unless explicitly disabled?
>>>>>
>>>>> I've had a bit of hilarious fail with optional testcases that
>>>>> automatically get disabled when depencies aren't around. Hence why
>>>>> they're all required by default with the optional switch to disable
>>>>> them.
>>>>
>>>> You've had this problem in general, or with nouveau?
>>>
>>> In general.
>>
>> So I think what I'm saying is that the nouveau support in
>> intel-gpu-tools isn't the project's primary purpose, so we should
>> allow it to build without nouveau support if you don't have nouveau
>> installed. If you don't have nouveau installed, you're not making a
>> mistake by not building intel-gpu-tools without support. And if you
>> have nouveau installed, you still get nouveau support.
>
> I completely agree with Matt.
>
> If the system doesn't already have nouveau installed, then it there is very
> low likelihood that it makes any sense to install nouveau onto that system.
> It very likely does not have NVidia hardware at all. So why require it?
> Let's just autodetect it and behave sanely.
>
> Requiring libdrm_nouveau is a nuisance for developers working on platforms
> where libdrm doesn't get built with NVidia support.

And, this patch gets
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index f65942f..43740f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,8 +92,11 @@  AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes])
 # -----------------------------------------------------------------------------
 # for dma-buf tests
 AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
-	      [Enable use of nouveau API for prime tests (default: enabled)]),
-	      [NOUVEAU=$enableval], [NOUVEAU=yes])
+	      [Enable use of nouveau API for prime tests (default: auto)]),
+	      [NOUVEAU=$enableval], [NOUVEAU=auto])
+if test "x$NOUVEAU" = xauto; then
+	PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no])
+fi
 if test "x$NOUVEAU" = xyes; then
 	PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
 	AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])