Re: [PATCH] drm.h: Handle DragonFly like Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Emil,

Emil Velikov wrote:

On 14 May 2016 at 08:13, François Tigeot <ftigeot@xxxxxxxxxxxx> wrote:
The drm code in DragonFly uses a local Linux implementation which doesn't
define the __linux__ macro.

Use __DragonFly__ instead in order to not try to compile non-Linux code.
Does that meant that the workarounds in the else statements don't work
? I doubt that anyone will mind if we update/correct them.

The #else code path is not being used on DragonFly and actually breaks kernel compilation.

FreeBSD is currently using an old copy of drm.h but is also planning to use some Linux wrappers with the relevant types defined in <linux/types.h>

OpenBSD uses a modified copy of drm.h and removed the whole #else path except for a "typedef unsigned long drm_handle_t;" line.

NetBSD is also using a modified copy of this file with its own #ifdef __NetBSD__ checks and another definition of drm_handle_t...

Alternatively if one insists on using the __linux__ route here, imho
it's better to just set the define it in your build.

It's not really possible for me to patch gcc here since some software depends on the operating system not advertising itself as Linux.

On the other hand, the non-Linux code path really is unused. I didn't want to be too intrusive in my patch but it's probably best to just remove it.

All that aside, for next revision/future work please check the
documentation [1] and add your s-o-b line. Also, please base your work
against Dave's drm-next branch [2]

Sorry about that, this new patch is signed and based on the drm-next branch.

--
Francois Tigeot
>From def927d26e72dfdaa929c9b66507598d4e666709 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Tigeot?= <ftigeot@xxxxxxxxxxxx>
Date: Mon, 16 May 2016 18:17:04 +0200
Subject: [PATCH] drm.h: Handle DragonFly like Linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The drm code in DragonFly uses a local Linux implementation which doesn't
define the __linux__ macro.

Use __DragonFly__ instead in order to not try to compile non-Linux code.

Signed-off-by: François Tigeot <ftigeot@xxxxxxxxxxxx>
---
 include/uapi/drm/drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 3683250..fe04907 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -42,7 +42,7 @@
 #include <asm/ioctl.h>
 typedef unsigned int drm_handle_t;
 
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__DragonFly__)
 
 #include <linux/types.h>
 #include <asm/ioctl.h>
-- 
2.7.2

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux