From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francois Tigeot Subject: Re: [PATCH] drm.h: Handle DragonFly like Linux Date: Mon, 16 May 2016 18:24:31 +0200 Message-ID: <5739F43F.3060801@wolfpond.org> References: <1463210005-5048-1-git-send-email-ftigeot@wolfpond.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000003020708070506000000" Return-path: Received: from ivry12.zefyris.com (ivry12.zefyris.com [IPv6:2a02:ec0:211::12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6C7D66E564 for ; Mon, 16 May 2016 16:24:41 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Emil Velikov Cc: ML dri-devel List-Id: dri-devel@lists.freedesktop.org This is a multi-part message in MIME format. --------------000003020708070506000000 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Emil, Emil Velikov wrote: > > On 14 May 2016 at 08:13, Fran=C3=A7ois Tigeot wr= ote: >> The drm code in DragonFly uses a local Linux implementation which does= n't >> define the __linux__ macro. >> >> Use __DragonFly__ instead in order to not try to compile non-Linux cod= e. > 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=20 kernel compilation. FreeBSD is currently using an old copy of drm.h but is also planning to=20 use some Linux wrappers with the relevant types defined in OpenBSD uses a modified copy of drm.h and removed the whole #else path=20 except for a "typedef unsigned long drm_handle_t;" line. NetBSD is also using a modified copy of this file with its own #ifdef=20 __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=20 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=20 want to be too intrusive in my patch but it's probably best to just=20 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 bran= ch. --=20 Francois Tigeot --------------000003020708070506000000 Content-Type: text/x-patch; name="0001-drm.h-Handle-DragonFly-like-Linux.patch" Content-Disposition: attachment; filename="0001-drm.h-Handle-DragonFly-like-Linux.patch" Content-Transfer-Encoding: quoted-printable >>From def927d26e72dfdaa929c9b66507598d4e666709 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Fran=3DC3=3DA7ois=3D20Tigeot?=3D 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=3DUTF-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=C3=A7ois Tigeot --- 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 typedef unsigned int drm_handle_t; =20 -#elif defined(__linux__) +#elif defined(__linux__) || defined(__DragonFly__) =20 #include #include --=20 2.7.2 --------------000003020708070506000000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --------------000003020708070506000000--