<div dir="ltr"><div dir="ltr">Hello,<div><br></div><div>Is there something I can do to help move this patch along?</div><div><br></div><div>Thanks,</div><div>James Park</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 10, 2020 at 1:13 AM James Park <<a href="mailto:jpark37@lagfreegames.com">jpark37@lagfreegames.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Create drm_basic_types.h to define types previously defined by drm.h.<br>
<br>
Use DRM_FOURCC_STANDALONE to include drm_fourcc.h without drm.h.<br>
<br>
This will allow Mesa to port code to Windows more easily.<br>
<br>
Signed-off-by: James Park <<a href="mailto:jpark37@lagfreegames.com" target="_blank">jpark37@lagfreegames.com</a>><br>
Acked-by: Simon Ser <<a href="mailto:contact@emersion.fr" target="_blank">contact@emersion.fr</a>><br>
Reviewed-by: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.com" target="_blank">pekka.paalanen@collabora.com</a>><br>
---<br>
include/uapi/drm/drm.h | 12 ++-------<br>
include/uapi/drm/drm_basic_types.h | 52 ++++++++++++++++++++++++++++++++++++++<br>
include/uapi/drm/drm_fourcc.h | 4 +++<br>
3 files changed, 58 insertions(+), 10 deletions(-)<br>
create mode 100644 include/uapi/drm/drm_basic_types.h<br>
<br>
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h<br>
index 808b48a..d9ba922 100644<br>
--- a/include/uapi/drm/drm.h<br>
+++ b/include/uapi/drm/drm.h<br>
@@ -36,6 +36,8 @@<br>
#ifndef _DRM_H_<br>
#define _DRM_H_<br>
<br>
+#include "drm_basic_types.h"<br>
+<br>
#if defined(__KERNEL__)<br>
<br>
#include <linux/types.h><br>
@@ -50,18 +52,8 @@ typedef unsigned int drm_handle_t;<br>
<br>
#else /* One of the BSDs */<br>
<br>
-#include <stdint.h><br>
#include <sys/ioccom.h><br>
#include <sys/types.h><br>
-typedef int8_t __s8;<br>
-typedef uint8_t __u8;<br>
-typedef int16_t __s16;<br>
-typedef uint16_t __u16;<br>
-typedef int32_t __s32;<br>
-typedef uint32_t __u32;<br>
-typedef int64_t __s64;<br>
-typedef uint64_t __u64;<br>
-typedef size_t __kernel_size_t;<br>
typedef unsigned long drm_handle_t;<br>
<br>
#endif<br>
diff --git a/include/uapi/drm/drm_basic_types.h b/include/uapi/drm/drm_basic_types.h<br>
new file mode 100644<br>
index 0000000..da1f2c0<br>
--- /dev/null<br>
+++ b/include/uapi/drm/drm_basic_types.h<br>
@@ -0,0 +1,52 @@<br>
+/*<br>
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.<br>
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.<br>
+ * All rights reserved.<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice (including the next<br>
+ * paragraph) shall be included in all copies or substantial portions of the<br>
+ * Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
+ * OTHER DEALINGS IN THE SOFTWARE.<br>
+ */<br>
+<br>
+#ifndef _DRM_BASIC_TYPES_H_<br>
+#define _DRM_BASIC_TYPES_H_<br>
+<br>
+#if defined(__KERNEL__)<br>
+<br>
+#include <linux/types.h><br>
+<br>
+#elif defined(__linux__)<br>
+<br>
+#include <linux/types.h><br>
+<br>
+#else /* Not Linux */<br>
+<br>
+#include <stdint.h><br>
+typedef int8_t __s8;<br>
+typedef uint8_t __u8;<br>
+typedef int16_t __s16;<br>
+typedef uint16_t __u16;<br>
+typedef int32_t __s32;<br>
+typedef uint32_t __u32;<br>
+typedef int64_t __s64;<br>
+typedef uint64_t __u64;<br>
+typedef size_t __kernel_size_t;<br>
+<br>
+#endif<br>
+<br>
+#endif<br>
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h<br>
index 82f3278..539870f 100644<br>
--- a/include/uapi/drm/drm_fourcc.h<br>
+++ b/include/uapi/drm/drm_fourcc.h<br>
@@ -24,7 +24,11 @@<br>
#ifndef DRM_FOURCC_H<br>
#define DRM_FOURCC_H<br>
<br>
+#include "drm_basic_types.h"<br>
+<br>
+#ifndef DRM_FOURCC_STANDALONE<br>
#include "drm.h"<br>
+#endif<br>
<br>
#if defined(__cplusplus)<br>
extern "C" {<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div></div>