Skip to contentSkip to conversation

xf86drm: correct the OpenBSD DRM_MAJOR define

PATCH Superseded Jonathan Gray 2 participants 5 messages Jul 18, 2015 – Jul 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xf86drm: correct the OpenBSD DRM_MAJOR define

As far as I can tell no OpenBSD platform ever used 81 for a drm major. While the value was added to libdrm in 2003 or earlier drm didn't appear in OpenBSD till 2007.

Of the OpenBSD platforms that support drm amd64/macppc/sparc64 use a major of 87, i386 uses 88.

---
 xf86drm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
xf86drm.c +5 -3
index 7d7f9c7..a2c549c 100644
@@ -72,9 +72,11 @@
 #define DRM_MAJOR 34
 #endif
 
-# ifdef __OpenBSD__
-#  define DRM_MAJOR 81
-# endif
+#if defined(__OpenBSD__) && defined(__i386__)
+#define DRM_MAJOR 88
+#elif defined(__OpenBSD__)
+#define DRM_MAJOR 87
+#endif
 
 #ifndef DRM_MAJOR
 #define DRM_MAJOR 226		/* Linux */
Signature · 6 lines
2.4.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 19 lines · Jonathan Gray

As far as I can tell no OpenBSD platform ever used 81 for a drm major. While the value was added to libdrm in 2003 or earlier drm didn't appear in OpenBSD till 2007.

Of the OpenBSD platforms that support drm amd64/macppc/sparc64 use a major of 87, i386 uses 88.

---
 xf86drm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
xf86drm.c +0 -0
index 7d7f9c7..a2c549c 100644
@@ -72,9 +72,11 @@
 #define DRM_MAJOR 34
 #endif

xf86drm.c line 80

Quoted 10 lines
xf86drm.c +5 -3
 
-# ifdef __OpenBSD__
-#  define DRM_MAJOR 81
-# endif
+#if defined(__OpenBSD__) && defined(__i386__)
+#define DRM_MAJOR 88
+#elif defined(__OpenBSD__)
+#define DRM_MAJOR 87
+#endif
 

Bikeshed: any objections if we cascade the ifdef statements ?

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 21 lines · Emil Velikov
Quoted 20 lines · Jonathan Gray

As far as I can tell no OpenBSD platform ever used 81 for a drm major. While the value was added to libdrm in 2003 or earlier drm didn't appear in OpenBSD till 2007.

Of the OpenBSD platforms that support drm amd64/macppc/sparc64 use a major of 87, i386 uses 88.

---
 xf86drm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
xf86drm.c +0 -0
index 7d7f9c7..a2c549c 100644
@@ -72,9 +72,11 @@
 #define DRM_MAJOR 34
 #endif
 
Quoted 10 lines

xf86drm.c line 80

Quoted 9 lines
xf86drm.c +5 -3
-# ifdef __OpenBSD__
-#  define DRM_MAJOR 81
-# endif
+#if defined(__OpenBSD__) && defined(__i386__)
+#define DRM_MAJOR 88
+#elif defined(__OpenBSD__)
+#define DRM_MAJOR 87
+#endif
 

Bikeshed: any objections if we cascade the ifdef statements ?

Do you mean indent the defines or have the entire block undef ifdef __OpenBSD__? Either way would be fine with me.
_______________________________________________
dri-devel mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 33 lines · Jonathan Gray
Quoted 21 lines · Emil Velikov
Quoted 20 lines · Jonathan Gray

As far as I can tell no OpenBSD platform ever used 81 for a drm major. While the value was added to libdrm in 2003 or earlier drm didn't appear in OpenBSD till 2007.

Of the OpenBSD platforms that support drm amd64/macppc/sparc64 use a major of 87, i386 uses 88.

---
 xf86drm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
xf86drm.c +0 -0
index 7d7f9c7..a2c549c 100644
@@ -72,9 +72,11 @@
 #define DRM_MAJOR 34
 #endif
 
Quoted 10 lines

xf86drm.c line 80

Quoted 9 lines
xf86drm.c +5 -3
-# ifdef __OpenBSD__
-#  define DRM_MAJOR 81
-# endif
+#if defined(__OpenBSD__) && defined(__i386__)
+#define DRM_MAJOR 88
+#elif defined(__OpenBSD__)
+#define DRM_MAJOR 87
+#endif
 

Bikeshed: any objections if we cascade the ifdef statements ?

Quoted 2 lines

Do you mean indent the defines or have the entire block undef ifdef __OpenBSD__? Either way would be fine with me.

Cascade seems like the wrong term here - here is what I meant:

#ifdef __OpenBSD__
+#ifdef __i386__
+#define DRM_MAJOR 88
+#else
+#define DRM_MAJOR 87
#endif
+#endif /* __OpenBSD__ */

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

PATCH v2 1/1 xf86drm: correct the OpenBSD DRM_MAJOR define

In reply to Emil Velikov

As far as I can tell no OpenBSD platform ever used 81 for a drm major. While the value was added to libdrm in 2003 or earlier drm didn't appear in OpenBSD till 2007.

Of the OpenBSD platforms that support drm amd64/macppc/sparc64 use a major of 87, i386 uses 88.

v2: rearrange ifdefs as suggested by Emil.

---
 xf86drm.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
xf86drm.c +7 -3
index c365778..47b2af3 100644
@@ -82,9 +82,13 @@
 #define DRM_MAJOR 34
 #endif
 
-# ifdef __OpenBSD__
-#  define DRM_MAJOR 81
-# endif
+#ifdef __OpenBSD__
+#ifdef __i386__
+#define DRM_MAJOR 88
+#else
+#define DRM_MAJOR 87
+#endif
+#endif /* __OpenBSD__ */
 
 #ifndef DRM_MAJOR
 #define DRM_MAJOR 226		/* Linux */
Signature · 6 lines
2.4.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel