All of lore.kernel.org
 help / color / mirror / Atom feed
* Add autodetect for libdrm to umr
@ 2017-02-05 15:34 Tom St Denis
       [not found] ` <20170205153414.10838-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Tom St Denis @ 2017-02-05 15:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

While the cmake commits haven't been pushed yet I'd like to get feedback
on this patch which helps find the libdrm headers.

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] autodetect path to libdrm
       [not found] ` <20170205153414.10838-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
@ 2017-02-05 15:34   ` Tom St Denis
       [not found]     ` <20170205153414.10838-2-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Tom St Denis @ 2017-02-05 15:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Tom St Denis

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 CMakeLists.txt      | 4 +++-
 src/lib/query_drm.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bef94fdba788..d2f393f0fa9b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,8 @@ include_directories(${CURSES_INCLUDE_DIRS})
 find_package(PCIAccess REQUIRED)
 include_directories(${PCIACCESS_INCLUDE_DIR})
 
+pkg_check_modules(DRM REQUIRED libdrm)
+
 set(REQUIRED_EXTERNAL_LIBS
   ${CURSES_LIBRARIES}
   ${PCIACCESS_LIBRARIES}
@@ -34,7 +36,7 @@ set(REQUIRED_EXTERNAL_LIBS
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 # CFLAGS += -Wall -W -O2 -g3 -Isrc/ -DPIC -fPIC
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -O2 -g3")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DRM_CFLAGS} -Wall -W -O2 -g3")
 
 add_subdirectory(src)
 add_subdirectory(doc)
diff --git a/src/lib/query_drm.c b/src/lib/query_drm.c
index b9d80a8fc0c8..755c65fbc662 100644
--- a/src/lib/query_drm.c
+++ b/src/lib/query_drm.c
@@ -25,8 +25,8 @@
 #include "umr.h"
 #include <asm/ioctl.h>
 #include <sys/ioctl.h>
-#include <drm/drm.h>
-#include <drm/amdgpu_drm.h>
+#include <drm.h>
+#include <amdgpu_drm.h>
 
 #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
 #define DRM_IOC_WRITE           _IOC_WRITE
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] autodetect path to libdrm
       [not found]     ` <20170205153414.10838-2-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
@ 2017-02-05 21:26       ` Andres Rodriguez
       [not found]         ` <4fd5d1dd-528c-4f5b-ef87-e2edb42f5e63-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Andres Rodriguez @ 2017-02-05 21:26 UTC (permalink / raw)
  To: Tom St Denis, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Tom St Denis

Hey Tom,

Overall in cmake calling pkg_check_modules() directly is usually not a
good practice. The common approach is to have a file in
cmake/modules/Find$(name).cmake that takes care of everything.

For example, you could use this FindLibdrm.cmake from the KDE project:
https://github.com/KDE/kwin/blob/master/cmake/modules/FindLibdrm.cmake

Alternatively a simple modification of the FindPCIAccess.cmake file that
Edward sent out could also work.

Sorry for the late feedback on a Sunday.

Regards,
Andres

On 2/5/2017 10:34 AM, Tom St Denis wrote:
> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
> ---
>  CMakeLists.txt      | 4 +++-
>  src/lib/query_drm.c | 4 ++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index bef94fdba788..d2f393f0fa9b 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -25,6 +25,8 @@ include_directories(${CURSES_INCLUDE_DIRS})
>  find_package(PCIAccess REQUIRED)
>  include_directories(${PCIACCESS_INCLUDE_DIR})
>
> +pkg_check_modules(DRM REQUIRED libdrm)
> +
>  set(REQUIRED_EXTERNAL_LIBS
>    ${CURSES_LIBRARIES}
>    ${PCIACCESS_LIBRARIES}
> @@ -34,7 +36,7 @@ set(REQUIRED_EXTERNAL_LIBS
>  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
>
>  # CFLAGS += -Wall -W -O2 -g3 -Isrc/ -DPIC -fPIC
> -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -O2 -g3")
> +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DRM_CFLAGS} -Wall -W -O2 -g3")
>
>  add_subdirectory(src)
>  add_subdirectory(doc)
> diff --git a/src/lib/query_drm.c b/src/lib/query_drm.c
> index b9d80a8fc0c8..755c65fbc662 100644
> --- a/src/lib/query_drm.c
> +++ b/src/lib/query_drm.c
> @@ -25,8 +25,8 @@
>  #include "umr.h"
>  #include <asm/ioctl.h>
>  #include <sys/ioctl.h>
> -#include <drm/drm.h>
> -#include <drm/amdgpu_drm.h>
> +#include <drm.h>
> +#include <amdgpu_drm.h>
>
>  #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
>  #define DRM_IOC_WRITE           _IOC_WRITE
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] autodetect path to libdrm
       [not found]         ` <4fd5d1dd-528c-4f5b-ef87-e2edb42f5e63-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-02-05 21:53           ` StDenis, Tom
       [not found]             ` <CY4PR12MB1768B2057C6F163C69635B4FF7410-rpdhrqHFk06yjjPBNVDk/QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: StDenis, Tom @ 2017-02-05 21:53 UTC (permalink / raw)
  To: Andres Rodriguez, Tom St Denis,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org


[-- Attachment #1.1.1: Type: text/plain, Size: 2812 bytes --]

Hi Andres,


Oh I can see how that's much simpler than a Makefile [😊]  (100 lines of "find libdrm" later...).


I'd rather not wholesale rip off KDE since their license (appears to be BSDish) is different.


I may just clone the one Edward provided as you suggested instead.


Tom


________________________________
From: Andres Rodriguez <andresx7@gmail.com>
Sent: Sunday, February 5, 2017 16:26
To: Tom St Denis; amd-gfx@lists.freedesktop.org
Cc: StDenis, Tom
Subject: Re: [PATCH] autodetect path to libdrm

Hey Tom,

Overall in cmake calling pkg_check_modules() directly is usually not a
good practice. The common approach is to have a file in
cmake/modules/Find$(name).cmake that takes care of everything.

For example, you could use this FindLibdrm.cmake from the KDE project:
https://github.com/KDE/kwin/blob/master/cmake/modules/FindLibdrm.cmake
[https://avatars1.githubusercontent.com/u/14312869?v=3&s=400]<https://github.com/KDE/kwin/blob/master/cmake/modules/FindLibdrm.cmake>

KDE/kwin<https://github.com/KDE/kwin/blob/master/cmake/modules/FindLibdrm.cmake>
github.com
kwin - This repository has no description




Alternatively a simple modification of the FindPCIAccess.cmake file that
Edward sent out could also work.

Sorry for the late feedback on a Sunday.

Regards,
Andres

On 2/5/2017 10:34 AM, Tom St Denis wrote:
> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
> ---
>  CMakeLists.txt      | 4 +++-
>  src/lib/query_drm.c | 4 ++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index bef94fdba788..d2f393f0fa9b 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -25,6 +25,8 @@ include_directories(${CURSES_INCLUDE_DIRS})
>  find_package(PCIAccess REQUIRED)
>  include_directories(${PCIACCESS_INCLUDE_DIR})
>
> +pkg_check_modules(DRM REQUIRED libdrm)
> +
>  set(REQUIRED_EXTERNAL_LIBS
>    ${CURSES_LIBRARIES}
>    ${PCIACCESS_LIBRARIES}
> @@ -34,7 +36,7 @@ set(REQUIRED_EXTERNAL_LIBS
>  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
>
>  # CFLAGS += -Wall -W -O2 -g3 -Isrc/ -DPIC -fPIC
> -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -O2 -g3")
> +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DRM_CFLAGS} -Wall -W -O2 -g3")
>
>  add_subdirectory(src)
>  add_subdirectory(doc)
> diff --git a/src/lib/query_drm.c b/src/lib/query_drm.c
> index b9d80a8fc0c8..755c65fbc662 100644
> --- a/src/lib/query_drm.c
> +++ b/src/lib/query_drm.c
> @@ -25,8 +25,8 @@
>  #include "umr.h"
>  #include <asm/ioctl.h>
>  #include <sys/ioctl.h>
> -#include <drm/drm.h>
> -#include <drm/amdgpu_drm.h>
> +#include <drm.h>
> +#include <amdgpu_drm.h>
>
>  #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
>  #define DRM_IOC_WRITE           _IOC_WRITE
>

[-- Attachment #1.1.2: Type: text/html, Size: 7211 bytes --]

[-- Attachment #1.2: OutlookEmoji-😊.png --]
[-- Type: image/png, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] autodetect path to libdrm
       [not found]             ` <CY4PR12MB1768B2057C6F163C69635B4FF7410-rpdhrqHFk06yjjPBNVDk/QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-02-05 22:14               ` Andres Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Andres Rodriguez @ 2017-02-05 22:14 UTC (permalink / raw)
  To: StDenis, Tom, Tom St Denis,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

Yeah that approach should be perfectly fine.

I don't think libdrm needs anything fancier than that.

Regards,
Andres

On 2/5/2017 4:53 PM, StDenis, Tom wrote:
> Hi Andres,
>
>
> Oh I can see how that's much simpler than a Makefile 😊 (100 lines of
> "find libdrm" later...).
>
>
> I'd rather not wholesale rip off KDE since their license (appears to be
> BSDish) is different.
>
>
> I may just clone the one Edward provided as you suggested instead.
>
>
> Tom
>
>
>
> ------------------------------------------------------------------------
> *From:* Andres Rodriguez <andresx7@gmail.com>
> *Sent:* Sunday, February 5, 2017 16:26
> *To:* Tom St Denis; amd-gfx@lists.freedesktop.org
> *Cc:* StDenis, Tom
> *Subject:* Re: [PATCH] autodetect path to libdrm
>
> Hey Tom,
>
> Overall in cmake calling pkg_check_modules() directly is usually not a
> good practice. The common approach is to have a file in
> cmake/modules/Find$(name).cmake that takes care of everything.
>
> For example, you could use this FindLibdrm.cmake from the KDE project:
> https://github.com/KDE/kwin/blob/master/cmake/modules/FindLibdrm.cmake
> <https://github.com/KDE/kwin/blob/master/cmake/modules/FindLibdrm.cmake>
> 	
> KDE/kwin
> <https://github.com/KDE/kwin/blob/master/cmake/modules/FindLibdrm.cmake>
> github.com
> kwin - This repository has no description
>
>
>
>
> Alternatively a simple modification of the FindPCIAccess.cmake file that
> Edward sent out could also work.
>
> Sorry for the late feedback on a Sunday.
>
> Regards,
> Andres
>
> On 2/5/2017 10:34 AM, Tom St Denis wrote:
>> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
>> ---
>>  CMakeLists.txt      | 4 +++-
>>  src/lib/query_drm.c | 4 ++--
>>  2 files changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index bef94fdba788..d2f393f0fa9b 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -25,6 +25,8 @@ include_directories(${CURSES_INCLUDE_DIRS})
>>  find_package(PCIAccess REQUIRED)
>>  include_directories(${PCIACCESS_INCLUDE_DIR})
>>
>> +pkg_check_modules(DRM REQUIRED libdrm)
>> +
>>  set(REQUIRED_EXTERNAL_LIBS
>>    ${CURSES_LIBRARIES}
>>    ${PCIACCESS_LIBRARIES}
>> @@ -34,7 +36,7 @@ set(REQUIRED_EXTERNAL_LIBS
>>  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
>>
>>  # CFLAGS += -Wall -W -O2 -g3 -Isrc/ -DPIC -fPIC
>> -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -O2 -g3")
>> +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DRM_CFLAGS} -Wall -W -O2 -g3")
>>
>>  add_subdirectory(src)
>>  add_subdirectory(doc)
>> diff --git a/src/lib/query_drm.c b/src/lib/query_drm.c
>> index b9d80a8fc0c8..755c65fbc662 100644
>> --- a/src/lib/query_drm.c
>> +++ b/src/lib/query_drm.c
>> @@ -25,8 +25,8 @@
>>  #include "umr.h"
>>  #include <asm/ioctl.h>
>>  #include <sys/ioctl.h>
>> -#include <drm/drm.h>
>> -#include <drm/amdgpu_drm.h>
>> +#include <drm.h>
>> +#include <amdgpu_drm.h>
>>
>>  #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
>>  #define DRM_IOC_WRITE           _IOC_WRITE
>>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-05 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-05 15:34 Add autodetect for libdrm to umr Tom St Denis
     [not found] ` <20170205153414.10838-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-02-05 15:34   ` [PATCH] autodetect path to libdrm Tom St Denis
     [not found]     ` <20170205153414.10838-2-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-02-05 21:26       ` Andres Rodriguez
     [not found]         ` <4fd5d1dd-528c-4f5b-ef87-e2edb42f5e63-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-05 21:53           ` StDenis, Tom
     [not found]             ` <CY4PR12MB1768B2057C6F163C69635B4FF7410-rpdhrqHFk06yjjPBNVDk/QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-02-05 22:14               ` Andres Rodriguez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.