[Intel-gfx] [PATCH] drm/i915: Make uapi/i915_drm.h standalone

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 27 10:49:19 UTC 2017


In order for us to be able to simply copy our uapi/i915_drm.h into
userspace it must be compilable as-is by userspace. For which we need
to hide the sparse markup for __user. This does impose the limitation
that we include our uapi/i915_drm.h last so that the attribute is
properly defined inside the kernel.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 include/uapi/drm/i915_drm.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 202790a3e8e2..5b12506683f1 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -29,6 +29,11 @@
 
 #include "drm.h"
 
+/* Disable unused sparse attributes from userspace */
+#ifndef __user
+#define __user
+#endif
+
 #if defined(__cplusplus)
 extern "C" {
 #endif
-- 
2.11.0



More information about the Intel-gfx mailing list