[RFC PATCH] drm.h: Fix DRM compilation with bare-metal toolchain.

Paul Sokolovsky paul.sokolovsky at linaro.org
Tue Apr 16 02:48:28 PDT 2013


Hello,

On Fri, 12 Apr 2013 18:28:26 -0500
Nishanth Menon <nm at ti.com> wrote:

> From: Paul Sokolovsky <paul.sokolovsky at linaro.org>
> 
> An ifdef in drm.h expects to be compiled with full-fledged Linux
> toolchain, but it's common to compile kernel with just bare-metal
> toolchain which doesn't define __linux__. So, also add __KERNEL__
> check.
> 
> [nm at ti.com: port forward to 3.9-rc6 and post to dri devel for
> feedback as RFC] Signed-off-by: Paul Sokolovsky
> <paul.sokolovsky at linaro.org> ---
> Paul, Dri devel list,
> I picked up this patch from linaro tree:
> https://git.linaro.org/gitweb?p=people/asac/android/kernel/lt-ti.git;a=patch;h=719fbc876740cf75e82dd082ae5a00dfcf6fff7a
> Discussion thread:
> http://lists.linaro.org/pipermail/linaro-dev/2011-June/thread.html#4874
> Seems to me as a valid fix even for upstream perhaps? 

Yes, IIRC, per the discussion you quote above, I sent this patch for
review of our (Linaro's) kernel folks to see if it's ok (the patch is
simple, story why it's needed may be not such, though I was positive
it's needed). It might be forgotten somehow, thanks for picking it up!


> Regards, Nishanth Menon
> 
>  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 8d1e2bb..73a99e4 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -36,7 +36,7 @@
>  #ifndef _DRM_H_
>  #define _DRM_H_
>  
> -#if defined(__linux__)
> +#if defined(__KERNEL__) || defined(__linux__)
>  
>  #include <linux/types.h>
>  #include <asm/ioctl.h>



-- 
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


More information about the dri-devel mailing list