[PATCH] drm.h: Handle DragonFly like Linux

Francois Tigeot ftigeot at wolfpond.org
Mon May 16 16:24:31 UTC 2016


Hi Emil,

Emil Velikov wrote:
>
> On 14 May 2016 at 08:13, François Tigeot <ftigeot at wolfpond.org> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm.h-Handle-DragonFly-like-Linux.patch
Type: text/x-patch
Size: 1002 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160516/93cc8e27/attachment.bin>


More information about the dri-devel mailing list