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 <ch...@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vet...@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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to