Skip to contentSkip to conversation

Add tokens for kernels with earlier versions of exynos_drm.h.

PATCH In review Vinson Lee 2 participants 3 messages Mar 30, 2013 – Apr 1, 2013

lore
Share & tools
lore

Vinson Lee

author
#0 lore raw

PATCH 1/1 Add tokens for kernels with earlier versions of exynos_drm.h.

This patch fixes these build errors with Linux 3.4 and earlier.

CC ioctls/drm.o
ioctls/drm.c:179: error: ‘DRM_IOCTL_EXYNOS_GEM_GET’ undeclared here (not in a function) ioctls/drm.c:181: error: ‘DRM_IOCTL_EXYNOS_G2D_GET_VER’ undeclared here (not in a function) ioctls/drm.c:182: error: ‘DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST’ undeclared here (not in a function) ioctls/drm.c:183: error: ‘DRM_IOCTL_EXYNOS_G2D_EXEC’ undeclared here (not in a function)
make: *** [ioctls/drm.o] Error 1

---
 include/compat.h |   14 ++++++++++++++
 ioctls/drm.c     |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)
include/compat.h +14 -0
index 934ec78..70cf34c 100644
@@ -487,4 +487,18 @@ struct sockaddr_nfc {
 #define IN_EXCL_UNLINK	0x04000000	/* exclude events on unlinked objects */
 #endif
 
+/* drm/exynos_drm.h */
+#ifndef DRM_IOCTL_EXYNOS_GEM_GET
+#define DRM_IOCTL_EXYNOS_GEM_GET 0x04
+#endif
+#ifndef DRM_IOCTL_EXYNOS_G2D_GET_VER
+#define DRM_IOCTL_EXYNOS_G2D_GET_VER 0x20
+#endif
+#ifndef DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST
+#define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST 0x21
+#endif
+#ifndef DRM_IOCTL_EXYNOS_G2D_EXEC
+#define DRM_IOCTL_EXYNOS_G2D_EXEC 0x22
+#endif
+
 #endif	/* _TRINITY_COMPAT_H */
ioctls/drm.c +1 -0
index afb3147..82b300e 100644
@@ -17,6 +17,7 @@
 
 #include "trinity.h"
 #include "ioctls.h"
+#include "compat.h"
 
 /* Copy-paste relevant stuff from header, as it is buggy. */
 /* #include <drm/sis_drm.h> */
Signature · 1 line
1.7.1
#1 lore raw

2013/3/30 Vinson Lee <[email protected]>

Quoted 28 lines

This patch fixes these build errors with Linux 3.4 and earlier.

CC ioctls/drm.o
ioctls/drm.c:179: error: ‘DRM_IOCTL_EXYNOS_GEM_GET’ undeclared here (not in a function) ioctls/drm.c:181: error: ‘DRM_IOCTL_EXYNOS_G2D_GET_VER’ undeclared here (not in a function) ioctls/drm.c:182: error: ‘DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST’ undeclared here (not in a function) ioctls/drm.c:183: error: ‘DRM_IOCTL_EXYNOS_G2D_EXEC’ undeclared here (not in a function)
make: *** [ioctls/drm.o] Error 1

---
 include/compat.h |   14 ++++++++++++++
 ioctls/drm.c     |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)
include/compat.h +4 -0
index 934ec78..70cf34c 100644
@@ -487,4 +487,18 @@ struct sockaddr_nfc {
 #define IN_EXCL_UNLINK 0x04000000      /* exclude events on unlinked objects */
 #endif
 
+/* drm/exynos_drm.h */
+#ifndef DRM_IOCTL_EXYNOS_GEM_GET
+#define DRM_IOCTL_EXYNOS_GEM_GET 0x04
+#endif

include/compat.h struct sockaddr_nfc { · line 503

Quoted 10 lines
include/compat.h +10 -0
+#ifndef DRM_IOCTL_EXYNOS_G2D_GET_VER
+#define DRM_IOCTL_EXYNOS_G2D_GET_VER 0x20
+#endif
+#ifndef DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST
+#define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST 0x21
+#endif
+#ifndef DRM_IOCTL_EXYNOS_G2D_EXEC
+#define DRM_IOCTL_EXYNOS_G2D_EXEC 0x22
+#endif
+

Hi, these are not the complete ioctl commands. In the kernel headers these numbers are passed to DRM_IOWR(), and on my box the results are:

$ ./trinity -I|grep EXYNOS
  - 0xc0106440 : DRM_IOCTL_EXYNOS_GEM_CREATE
  - 0xc0106441 : DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET
  - 0xc0186442 : DRM_IOCTL_EXYNOS_GEM_MMAP
  - 0xc0106444 : DRM_IOCTL_EXYNOS_GEM_GET
  - 0xc0106447 : DRM_IOCTL_EXYNOS_VIDI_CONNECTION
  - 0xc0086460 : DRM_IOCTL_EXYNOS_G2D_GET_VER
  - 0xc0286461 : DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST
  - 0xc0086462 : DRM_IOCTL_EXYNOS_G2D_EXEC

I propose to just #ifdef the missing exynos ioctls one-by-one in ioctls/drm.c as it is done for other potentially missing ioctls.

Thanks,
Tommi

Quoted 21 lines
include/compat.h +0 -0
 #endif /* _TRINITY_COMPAT_H */
ioctls/drm.c +1 -1
index afb3147..82b300e 100644
@@ -17,6 +17,7 @@
 
 #include "trinity.h"
 #include "ioctls.h"
+#include "compat.h"
 
 /* Copy-paste relevant stuff from header, as it is buggy. */
 /* #include <drm/sis_drm.h> */
--

1.7.1

--
To unsubscribe from this list: send the line "unsubscribe trinity" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw

PATCH v2 1/1 Add #ifdefs around missing exynos ioctls on earlier kernels.

This patch fixes these build errors with Linux 3.4 and earlier.

CC ioctls/drm.o
ioctls/drm.c:179: error: ‘DRM_IOCTL_EXYNOS_GEM_GET’ undeclared here (not in a function) ioctls/drm.c:181: error: ‘DRM_IOCTL_EXYNOS_G2D_GET_VER’ undeclared here (not in a function) ioctls/drm.c:182: error: ‘DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST’ undeclared here (not in a function) ioctls/drm.c:183: error: ‘DRM_IOCTL_EXYNOS_G2D_EXEC’ undeclared here (not in a function)
make: *** [ioctls/drm.o] Error 1

---
 ioctls/drm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
ioctls/drm.c +8 -0
index afb3147..8f3dfd0 100644
@@ -176,12 +176,20 @@ static const struct ioctl drm_ioctls[] = {
 	IOCTL(DRM_IOCTL_EXYNOS_GEM_CREATE),
 	IOCTL(DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET),
 	IOCTL(DRM_IOCTL_EXYNOS_GEM_MMAP),
+#ifdef DRM_IOCTL_EXYNOS_GEM_GET
 	IOCTL(DRM_IOCTL_EXYNOS_GEM_GET),
+#endif
 	IOCTL(DRM_IOCTL_EXYNOS_VIDI_CONNECTION),
+#ifdef DRM_IOCTL_EXYNOS_G2D_GET_VER
 	IOCTL(DRM_IOCTL_EXYNOS_G2D_GET_VER),
+#endif
+#ifdef DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST
 	IOCTL(DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST),
+#endif
+#ifdef DRM_IOCTL_EXYNOS_G2D_EXEC
 	IOCTL(DRM_IOCTL_EXYNOS_G2D_EXEC),
 #endif
+#endif
 
 	/* i810_drm.h */
 	IOCTL(DRM_IOCTL_I810_INIT),
Signature · 1 line
1.7.1