Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/i915: Add i915_drm_local.h
@ 2021-07-28  5:17 Ashutosh Dixit
  2021-07-28  6:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ashutosh Dixit @ 2021-07-28  5:17 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

It is necessary on occasion to add uapi declarations to IGT before they
appear in imported kernel uapi headers. This is typically done at present
using LOCAL declarations (or #ifndef's) which are dispersed across multiple
source and header files. Such declarations sometimes linger on in the code
for months or years till someone thinks of cleaning them up.

As opposed to this, provide a central location (in i915_drm_local.h) for
such early uapi declarations in IGT. These declarations will be added to
i915_drm_local.h exactly as they are expected to appear in the kernel uapi
headers, i.e. without the LOCAL_ or local_ prefix. They can be cleaned up
when the uapi headers are sync'd or they can live on (if they don't
conflict with the kernel headers) but at least they will be in a single
place and more visible. At least that is the hope.

Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/i915/i915_drm_local.h | 27 +++++++++++++++++++++++++++
 lib/igt_gt.h              |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 lib/i915/i915_drm_local.h

diff --git a/lib/i915/i915_drm_local.h b/lib/i915/i915_drm_local.h
new file mode 100644
index 00000000000..dd646aedf49
--- /dev/null
+++ b/lib/i915/i915_drm_local.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2021 Intel Corporation
+ */
+#ifndef _I915_DRM_LOCAL_H_
+#define _I915_DRM_LOCAL_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ * It is necessary on occasion to add uapi declarations to IGT before they
+ * appear in imported kernel uapi headers. This header is provided for this
+ * purpose.
+
+ * Early uapi declarations should be added here exactly as they are
+ * expected to appear in the kernel uapi headers, i.e. without the LOCAL_
+ * or local_ prefix and without any #ifndef's. Attempt should be made to
+ * clean these up when kernel uapi headers are sync'd.
+ */
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* _I915_DRM_LOCAL_H_ */
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 2ea360cc48a..d87fae2d39c 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -28,6 +28,7 @@
 #include "igt_dummyload.h"
 #include "igt_core.h"
 
+#include "i915/i915_drm_local.h"
 #include "i915_drm.h"
 
 void igt_require_hang_ring(int fd, int ring);
-- 
2.31.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-30  1:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-28  5:17 [igt-dev] [PATCH i-g-t] lib/i915: Add i915_drm_local.h Ashutosh Dixit
2021-07-28  6:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-07-28  9:28 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2021-07-28 15:05 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-07-29  8:25 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2021-07-30  1:09   ` Dixit, Ashutosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox