[PATCH 1/3] drm: Make drm.h uapi header safe for C++

2016-04-06 Thread Gabriel Laskar
On Wed, 30 Mar 2016 16:19:42 +0200
Daniel Vetter  wrote:

> virtual is a protected keyword in C++ and can't be used at all. Ugh.
> 
> This aligns the kernel versions of the drm headers with the ones in
> libdrm.
> 
> Cc: Emil Velikov 
> Signed-off-by: Daniel Vetter 
> ---
>  include/uapi/drm/drm.h | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index a0ebfe7c9a28..d299c7749091 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -373,7 +373,11 @@ struct drm_buf_pub {
>   */
>  struct drm_buf_map {
>   int count;  /**< Length of the buffer list */
> +#ifdef __cplusplus
> + void *virt;
> +#else
>   void __user *virtual;   /**< Mmap'd area in
> user-virtual */ +#endif
>   struct drm_buf_pub __user *list;    /**< Buffer
> information */ };
>  

Why not simply rename the field ?

-- 
Gabriel Laskar


[git pull] drm uapi header fixes

2015-12-10 Thread Gabriel Laskar
Hi Dave,

Here is the changes for drm headers, as requested and rebased onto 4.4-rc4

The following changes since commit 527e9316f8ec44bd53d90fb9f611fa752bb9:

  Linux 4.4-rc4 (2015-12-06 15:43:12 -0800)

are available in the git repository at:

  https://github.com/GabrielL/linux.git drm-header-fixes

for you to fetch changes up to d7e12cd7b8c6d7426a401ec03ddcb88382180ced:

  drm: fix inclusion of drm.h in via_drm.h (2015-12-10 12:33:23 +0100)


Gabriel Laskar (19):
  drm: use __u{32,64} instead of uint{32,64}_t in virtgpu_drm.h
  drm: Kbuild: add admgpu_drm.h to the installed headers
  drm: include drm.h in armada_drm.h
  drm: drm_fourcc.h fix includes
  drm: drm_mode.h fix includes
  drm: fix inclusion of drm.h in drm_sarea.h
  drm: fix inclusion of drm.h in exynos_sarea.h
  drm: fix inclusion of drm.h in i810_drm.h
  drm: fix inclusion of drm.h in exynos_sarea.h
  drm: fix inclusion of drm.h in mga_drm.h
  drm: fix inclusion of drm.h in msm_drm.h
  drm: fix inclusion of drm.h in omap_drm.h
  drm: fix inclusion of drm.h in qxl_drm.h
  drm: fix inclusion of drm.h in r128_drm.h
  drm: fix inclusion of drm.h in savage_drm.h
  drm: fix inclusion of drm.h in tegra_drm.h
  drm: fix inclusion of drm.h in virtgpu_drm.h
  drm: fix inclusion of drm.h in vmwgfx_drm.h
  drm: fix inclusion of drm.h in via_drm.h

Mikko Rapeli (11):
  drm.h: use __kernel_size_t instead of size_t
  drm_mode.h: use __u32 and __u64 from linux/types.h
  exynos_drm.h: use __u64 from linux/types.h
  nouveau_drm.h: use __u32 and __u64 from linux/types.h
  radeon_drm.h: use __u32 and __u64 from linux/types.h
  via_drm.h: don't include non-existing via_drmclient.h
  include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from 
linux/types.h
  include/uapi/drm/qxl_drm.h: use __s32, __u32 and __u64 from linux/types.h
  include/uapi/linux/virtio_gpu.h: use __u8 from 
  include/uapi/linux/agpgart.h: include stdlib.h in userspace
  include/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from 

 include/uapi/drm/Kbuild |   1 +
 include/uapi/drm/amdgpu_drm.h   | 290 
 include/uapi/drm/armada_drm.h   |   2 +
 include/uapi/drm/drm.h  |   9 +-
 include/uapi/drm/drm_fourcc.h   |   2 +-
 include/uapi/drm/drm_mode.h |  18 +--
 include/uapi/drm/drm_sarea.h|   2 +-
 include/uapi/drm/exynos_drm.h   |   8 +-
 include/uapi/drm/i810_drm.h |   2 +-
 include/uapi/drm/i915_drm.h |   2 +-
 include/uapi/drm/mga_drm.h  |   2 +-
 include/uapi/drm/msm_drm.h  |   3 +-
 include/uapi/drm/nouveau_drm.h  |  86 ++--
 include/uapi/drm/omap_drm.h |   2 +-
 include/uapi/drm/qxl_drm.h  |  77 ++-
 include/uapi/drm/r128_drm.h |   2 +-
 include/uapi/drm/radeon_drm.h   | 128 +-
 include/uapi/drm/savage_drm.h   |   2 +-
 include/uapi/drm/tegra_drm.h|   2 +-
 include/uapi/drm/via_drm.h  |   5 +-
 include/uapi/drm/virtgpu_drm.h  | 101 +++---
 include/uapi/drm/vmwgfx_drm.h   | 268 ++---
 include/uapi/linux/agpgart.h|   1 +
 include/uapi/linux/virtio_gpu.h |   2 +-
 24 files changed, 508 insertions(+), 509 deletions(-)


[git pull] drm uapi header fixes

2015-12-10 Thread Gabriel Laskar
Hi Dave,

Here is the changes for drm headers, as requested.

The following changes since commit 9a0f76fde9ad2c00c0cf13aaf3dfb9d886dc578c:

  Merge tag 'for-linus-4.4-1' of git://git.code.sf.net/p/openipmi/linux-ipmi 
(2015-12-09 11:57:10 -0800)

are available in the git repository at:

  https://github.com/GabrielL/linux.git drm-header-fixes

for you to fetch changes up to 09b9bde3b0cae62690db242274ee161860795ce4:

  drm: fix inclusion of drm.h in via_drm.h (2015-12-09 23:42:44 +0100)

--------
Gabriel Laskar (19):
  drm: use __u{32,64} instead of uint{32,64}_t in virtgpu_drm.h
  drm: Kbuild: add admgpu_drm.h to the installed headers
  drm: include drm.h in armada_drm.h
  drm: drm_fourcc.h fix includes
  drm: drm_mode.h fix includes
  drm: fix inclusion of drm.h in drm_sarea.h
  drm: fix inclusion of drm.h in exynos_sarea.h
  drm: fix inclusion of drm.h in i810_drm.h
  drm: fix inclusion of drm.h in exynos_sarea.h
  drm: fix inclusion of drm.h in mga_drm.h
  drm: fix inclusion of drm.h in msm_drm.h
  drm: fix inclusion of drm.h in omap_drm.h
  drm: fix inclusion of drm.h in qxl_drm.h
  drm: fix inclusion of drm.h in r128_drm.h
  drm: fix inclusion of drm.h in savage_drm.h
  drm: fix inclusion of drm.h in tegra_drm.h
  drm: fix inclusion of drm.h in virtgpu_drm.h
  drm: fix inclusion of drm.h in vmwgfx_drm.h
  drm: fix inclusion of drm.h in via_drm.h

Mikko Rapeli (11):
  drm.h: use __kernel_size_t instead of size_t
  drm_mode.h: use __u32 and __u64 from linux/types.h
  exynos_drm.h: use __u64 from linux/types.h
  nouveau_drm.h: use __u32 and __u64 from linux/types.h
  radeon_drm.h: use __u32 and __u64 from linux/types.h
  via_drm.h: don't include non-existing via_drmclient.h
  include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from 
linux/types.h
  include/uapi/drm/qxl_drm.h: use __s32, __u32 and __u64 from linux/types.h
  include/uapi/linux/virtio_gpu.h: use __u8 from 
  include/uapi/linux/agpgart.h: include stdlib.h in userspace
  include/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from 

 include/uapi/drm/Kbuild |   1 +
 include/uapi/drm/amdgpu_drm.h   | 290 
 include/uapi/drm/armada_drm.h   |   2 +
 include/uapi/drm/drm.h  |   9 +-
 include/uapi/drm/drm_fourcc.h   |   2 +-
 include/uapi/drm/drm_mode.h |  18 +--
 include/uapi/drm/drm_sarea.h|   2 +-
 include/uapi/drm/exynos_drm.h   |   8 +-
 include/uapi/drm/i810_drm.h |   2 +-
 include/uapi/drm/i915_drm.h |   2 +-
 include/uapi/drm/mga_drm.h  |   2 +-
 include/uapi/drm/msm_drm.h  |   3 +-
 include/uapi/drm/nouveau_drm.h  |  86 ++--
 include/uapi/drm/omap_drm.h |   2 +-
 include/uapi/drm/qxl_drm.h  |  77 ++-
 include/uapi/drm/r128_drm.h |   2 +-
 include/uapi/drm/radeon_drm.h   | 128 +-
 include/uapi/drm/savage_drm.h   |   2 +-
 include/uapi/drm/tegra_drm.h|   2 +-
 include/uapi/drm/via_drm.h  |   5 +-
 include/uapi/drm/virtgpu_drm.h  | 101 +++---
 include/uapi/drm/vmwgfx_drm.h   | 268 ++---
 include/uapi/linux/agpgart.h|   1 +
 include/uapi/linux/virtio_gpu.h |   2 +-
 24 files changed, 508 insertions(+), 509 deletions(-)


[PATCH 01/20] drm: use __u{32,64} instead of uint{32,64}_t in virtgpu_drm.h

2015-12-09 Thread Gabriel Laskar
On Mon, 7 Dec 2015 13:29:41 +
Emil Velikov  wrote:

> On 5 December 2015 at 21:03, Dave Airlie  wrote:
> > On 5 December 2015 at 00:22, Emil Velikov  
> > wrote:  
> >> On 30 November 2015 at 14:10, Gabriel Laskar  
> >> wrote:  
> >>> Signed-off-by: Gabriel Laskar 
> >>> CC: Emil Velikov 
> >>> CC: Mikko Rapeli 
> >>>
> >>> ---
> >>>  include/uapi/drm/virtgpu_drm.h | 98 
> >>> +-
> >>>  1 file changed, 49 insertions(+), 49 deletions(-)
> >>>  
> >> For the series
> >> Reviewed-by: Emil Velikov 
> >>
> >> Dave would you have any comments wrt this and the remainder of Mikko's
> >> series ? Alternatively what can we do to get those merged (would you
> >> like a branch/pull request) ?  
> >
> > Yeah a git pull for these would be good, it's about all I can do to
> > care about them.
> >  
> From your earlier reply I got the impression that you'll pick Mikko's
> work. Either way, glad to see some progress on the topic.
> 
> Mikko, Gabriel,
> 
> Will you guys be so kind to send pull requests or shall I ?

I can send a pull request with the changes from mikko and mine.

-- 
Gabriel Laskar


[PATCH 20/20] drm: via: remove userland header

2015-11-30 Thread Gabriel Laskar
via_drmclient.h comes from userland drivers, it should not be in the
kernel public headers. Moreover, this does not compile if taken outside
of the drivers.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/via_drm.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index fd11a5b..12507e0 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -33,10 +33,6 @@
 #ifndef _VIA_DEFINES_
 #define _VIA_DEFINES_

-#ifndef __KERNEL__
-#include "via_drmclient.h"
-#endif
-
 #define VIA_NR_SAREA_CLIPRECTS 8
 #define VIA_NR_XVMC_PORTS   10
 #define VIA_NR_XVMC_LOCKS   5
-- 
2.6.2



[PATCH 19/20] drm: fix inclusion of drm.h in via_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/via_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 45bc80c..fd11a5b 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -24,7 +24,7 @@
 #ifndef _VIA_DRM_H_
 #define _VIA_DRM_H_

-#include 
+#include "drm.h"

 /* WARNING: These defines must be the same as what the Xserver uses.
  * if you change them, you must change the defines in the Xserver.
-- 
2.6.2



[PATCH 18/20] drm: fix inclusion of drm.h in vmwgfx_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/vmwgfx_drm.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
index 05b2049..2454543 100644
--- a/include/uapi/drm/vmwgfx_drm.h
+++ b/include/uapi/drm/vmwgfx_drm.h
@@ -28,9 +28,7 @@
 #ifndef __VMWGFX_DRM_H__
 #define __VMWGFX_DRM_H__

-#ifndef __KERNEL__
-#include 
-#endif
+#include "drm.h"

 #define DRM_VMW_MAX_SURFACE_FACES 6
 #define DRM_VMW_MAX_MIP_LEVELS 24
-- 
2.6.2



[PATCH 17/20] drm: fix inclusion of drm.h in virtgpu_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/virtgpu_drm.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h
index 4bcfbe6..c74f1f9 100644
--- a/include/uapi/drm/virtgpu_drm.h
+++ b/include/uapi/drm/virtgpu_drm.h
@@ -24,8 +24,7 @@
 #ifndef VIRTGPU_DRM_H
 #define VIRTGPU_DRM_H

-#include 
-#include "drm/drm.h"
+#include "drm.h"

 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
-- 
2.6.2



[PATCH 16/20] drm: fix inclusion of drm.h in tegra_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/tegra_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index 5391780..27d0b05 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -23,7 +23,7 @@
 #ifndef _UAPI_TEGRA_DRM_H_
 #define _UAPI_TEGRA_DRM_H_

-#include 
+#include "drm.h"

 #define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
 #define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
-- 
2.6.2



[PATCH 15/20] drm: fix inclusion of drm.h in savage_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/savage_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/savage_drm.h b/include/uapi/drm/savage_drm.h
index 9dc9dc1..5741474 100644
--- a/include/uapi/drm/savage_drm.h
+++ b/include/uapi/drm/savage_drm.h
@@ -26,7 +26,7 @@
 #ifndef __SAVAGE_DRM_H__
 #define __SAVAGE_DRM_H__

-#include 
+#include "drm.h"

 #ifndef __SAVAGE_SAREA_DEFINES__
 #define __SAVAGE_SAREA_DEFINES__
-- 
2.6.2



[PATCH 14/20] drm: fix inclusion of drm.h in r128_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/r128_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/r128_drm.h b/include/uapi/drm/r128_drm.h
index 76b0aa3..7a44c65 100644
--- a/include/uapi/drm/r128_drm.h
+++ b/include/uapi/drm/r128_drm.h
@@ -33,7 +33,7 @@
 #ifndef __R128_DRM_H__
 #define __R128_DRM_H__

-#include 
+#include "drm.h"

 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the X server file (r128_sarea.h)
-- 
2.6.2



[PATCH 13/20] drm: fix inclusion of drm.h in qxl_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/qxl_drm.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/uapi/drm/qxl_drm.h b/include/uapi/drm/qxl_drm.h
index ebebd36..4387b57 100644
--- a/include/uapi/drm/qxl_drm.h
+++ b/include/uapi/drm/qxl_drm.h
@@ -24,8 +24,7 @@
 #ifndef QXL_DRM_H
 #define QXL_DRM_H

-#include 
-#include "drm/drm.h"
+#include "drm.h"

 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
-- 
2.6.2



[PATCH 12/20] drm: fix inclusion of drm.h in omap_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/omap_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/omap_drm.h b/include/uapi/drm/omap_drm.h
index 1d0b117..0750c01 100644
--- a/include/uapi/drm/omap_drm.h
+++ b/include/uapi/drm/omap_drm.h
@@ -20,7 +20,7 @@
 #ifndef __OMAP_DRM_H__
 #define __OMAP_DRM_H__

-#include 
+#include "drm.h"

 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
-- 
2.6.2



[PATCH 11/20] drm: fix inclusion of drm.h in msm_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/msm_drm.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index 75a232b..e995ffb 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -18,8 +18,7 @@
 #ifndef __MSM_DRM_H__
 #define __MSM_DRM_H__

-#include 
-#include 
+#include "drm.h"

 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints:
-- 
2.6.2



[PATCH 10/20] drm: fix inclusion of drm.h in mga_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/mga_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/mga_drm.h b/include/uapi/drm/mga_drm.h
index 2375bfd..fca8170 100644
--- a/include/uapi/drm/mga_drm.h
+++ b/include/uapi/drm/mga_drm.h
@@ -35,7 +35,7 @@
 #ifndef __MGA_DRM_H__
 #define __MGA_DRM_H__

-#include 
+#include "drm.h"

 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the Xserver file (mga_sarea.h)
-- 
2.6.2



[PATCH 09/20] drm: fix inclusion of drm.h in exynos_sarea.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/i915_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 484a9fb..07dcba2 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -27,7 +27,7 @@
 #ifndef _UAPI_I915_DRM_H_
 #define _UAPI_I915_DRM_H_

-#include 
+#include "drm.h"

 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
-- 
2.6.2



[PATCH 08/20] drm: fix inclusion of drm.h in i810_drm.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for
the libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/i810_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/i810_drm.h b/include/uapi/drm/i810_drm.h
index 34736ef..bdb0287 100644
--- a/include/uapi/drm/i810_drm.h
+++ b/include/uapi/drm/i810_drm.h
@@ -1,7 +1,7 @@
 #ifndef _I810_DRM_H_
 #define _I810_DRM_H_

-#include 
+#include "drm.h"

 /* WARNING: These defines must be the same as what the Xserver uses.
  * if you change them, you must change the defines in the Xserver.
-- 
2.6.2



[PATCH 07/20] drm: fix inclusion of drm.h in exynos_sarea.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/exynos_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index 5575ed1..a5b2dd9 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -15,7 +15,7 @@
 #ifndef _UAPI_EXYNOS_DRM_H_
 #define _UAPI_EXYNOS_DRM_H_

-#include 
+#include "drm.h"

 /**
  * User-desired buffer creation information structure.
-- 
2.6.2



[PATCH 06/20] drm: fix inclusion of drm.h in drm_sarea.h

2015-11-30 Thread Gabriel Laskar
Using `#include "drm.h"` instead of `#include ` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/drm_sarea.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/drm_sarea.h b/include/uapi/drm/drm_sarea.h
index 413a564..1d1a858 100644
--- a/include/uapi/drm/drm_sarea.h
+++ b/include/uapi/drm/drm_sarea.h
@@ -32,7 +32,7 @@
 #ifndef _DRM_SAREA_H_
 #define _DRM_SAREA_H_

-#include 
+#include "drm.h"

 /* SAREA area needs to be at least a page */
 #if defined(__alpha__)
-- 
2.6.2



[PATCH 05/20] drm: drm_mode.h fix includes

2015-11-30 Thread Gabriel Laskar
Instead of using linux/types.h, drm headers should use drm.h, in order
to handle the portability issues in only one place.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/drm_mode.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 6c11ca4..9c9f61d 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -27,7 +27,7 @@
 #ifndef _DRM_MODE_H
 #define _DRM_MODE_H

-#include 
+#include "drm.h"

 #define DRM_DISPLAY_INFO_LEN   32
 #define DRM_CONNECTOR_NAME_LEN 32
-- 
2.6.2



[PATCH 04/20] drm: drm_fourcc.h fix includes

2015-11-30 Thread Gabriel Laskar
Instead of using linux/types.h, drm headers should use drm.h, in order
to handle the portability issues in only one place.

Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/drm_fourcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 8c5e8b9..86abf67 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -24,7 +24,7 @@
 #ifndef DRM_FOURCC_H
 #define DRM_FOURCC_H

-#include 
+#include "drm.h"

 #define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
 ((__u32)(c) << 16) | ((__u32)(d) << 24))
-- 
2.6.2



[PATCH 03/20] drm: include drm.h in armada_drm.h

2015-11-30 Thread Gabriel Laskar
Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/armada_drm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/armada_drm.h b/include/uapi/drm/armada_drm.h
index 8dec3fd..6de7f01 100644
--- a/include/uapi/drm/armada_drm.h
+++ b/include/uapi/drm/armada_drm.h
@@ -9,6 +9,8 @@
 #ifndef DRM_ARMADA_IOCTL_H
 #define DRM_ARMADA_IOCTL_H

+#include "drm.h"
+
 #define DRM_ARMADA_GEM_CREATE  0x00
 #define DRM_ARMADA_GEM_MMAP0x02
 #define DRM_ARMADA_GEM_PWRITE  0x03
-- 
2.6.2



[PATCH 02/20] drm: Kbuild: add admgpu_drm.h to the installed headers

2015-11-30 Thread Gabriel Laskar
Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild
index 38d4370..159551f 100644
--- a/include/uapi/drm/Kbuild
+++ b/include/uapi/drm/Kbuild
@@ -3,6 +3,7 @@ header-y += drm.h
 header-y += drm_fourcc.h
 header-y += drm_mode.h
 header-y += drm_sarea.h
+header-y += amdgpu_drm.h
 header-y += exynos_drm.h
 header-y += i810_drm.h
 header-y += i915_drm.h
-- 
2.6.2



[PATCH 01/20] drm: use __u{32, 64} instead of uint{32, 64}_t in virtgpu_drm.h

2015-11-30 Thread Gabriel Laskar
Signed-off-by: Gabriel Laskar 
CC: Emil Velikov 
CC: Mikko Rapeli 

---
 include/uapi/drm/virtgpu_drm.h | 98 +-
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h
index fc9e2d6..4bcfbe6 100644
--- a/include/uapi/drm/virtgpu_drm.h
+++ b/include/uapi/drm/virtgpu_drm.h
@@ -30,7 +30,7 @@
 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
  *
- * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel
+ * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
  * compatibility Keep fields aligned to their size
  */

@@ -45,88 +45,88 @@
 #define DRM_VIRTGPU_GET_CAPS  0x09

 struct drm_virtgpu_map {
-   uint64_t offset; /* use for mmap system call */
-   uint32_t handle;
-   uint32_t pad;
+   __u64 offset; /* use for mmap system call */
+   __u32 handle;
+   __u32 pad;
 };

 struct drm_virtgpu_execbuffer {
-   uint32_tflags;  /* for future use */
-   uint32_t size;
-   uint64_t command; /* void* */
-   uint64_t bo_handles;
-   uint32_t num_bo_handles;
-   uint32_t pad;
+   __u32   flags;  /* for future use */
+   __u32 size;
+   __u64 command; /* void* */
+   __u64 bo_handles;
+   __u32 num_bo_handles;
+   __u32 pad;
 };

 #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */

 struct drm_virtgpu_getparam {
-   uint64_t param;
-   uint64_t value;
+   __u64 param;
+   __u64 value;
 };

 /* NO_BO flags? NO resource flag? */
 /* resource flag for y_0_top */
 struct drm_virtgpu_resource_create {
-   uint32_t target;
-   uint32_t format;
-   uint32_t bind;
-   uint32_t width;
-   uint32_t height;
-   uint32_t depth;
-   uint32_t array_size;
-   uint32_t last_level;
-   uint32_t nr_samples;
-   uint32_t flags;
-   uint32_t bo_handle; /* if this is set - recreate a new resource 
attached to this bo ? */
-   uint32_t res_handle;  /* returned by kernel */
-   uint32_t size;/* validate transfer in the host */
-   uint32_t stride;  /* validate transfer in the host */
+   __u32 target;
+   __u32 format;
+   __u32 bind;
+   __u32 width;
+   __u32 height;
+   __u32 depth;
+   __u32 array_size;
+   __u32 last_level;
+   __u32 nr_samples;
+   __u32 flags;
+   __u32 bo_handle; /* if this is set - recreate a new resource attached 
to this bo ? */
+   __u32 res_handle;  /* returned by kernel */
+   __u32 size;/* validate transfer in the host */
+   __u32 stride;  /* validate transfer in the host */
 };

 struct drm_virtgpu_resource_info {
-   uint32_t bo_handle;
-   uint32_t res_handle;
-   uint32_t size;
-   uint32_t stride;
+   __u32 bo_handle;
+   __u32 res_handle;
+   __u32 size;
+   __u32 stride;
 };

 struct drm_virtgpu_3d_box {
-   uint32_t x;
-   uint32_t y;
-   uint32_t z;
-   uint32_t w;
-   uint32_t h;
-   uint32_t d;
+   __u32 x;
+   __u32 y;
+   __u32 z;
+   __u32 w;
+   __u32 h;
+   __u32 d;
 };

 struct drm_virtgpu_3d_transfer_to_host {
-   uint32_t bo_handle;
+   __u32 bo_handle;
struct drm_virtgpu_3d_box box;
-   uint32_t level;
-   uint32_t offset;
+   __u32 level;
+   __u32 offset;
 };

 struct drm_virtgpu_3d_transfer_from_host {
-   uint32_t bo_handle;
+   __u32 bo_handle;
struct drm_virtgpu_3d_box box;
-   uint32_t level;
-   uint32_t offset;
+   __u32 level;
+   __u32 offset;
 };

 #define VIRTGPU_WAIT_NOWAIT 1 /* like it */
 struct drm_virtgpu_3d_wait {
-   uint32_t handle; /* 0 is an invalid handle */
-   uint32_t flags;
+   __u32 handle; /* 0 is an invalid handle */
+   __u32 flags;
 };

 struct drm_virtgpu_get_caps {
-   uint32_t cap_set_id;
-   uint32_t cap_set_ver;
-   uint64_t addr;
-   uint32_t size;
-   uint32_t pad;
+   __u32 cap_set_id;
+   __u32 cap_set_ver;
+   __u64 addr;
+   __u32 size;
+   __u32 pad;
 };

 #define DRM_IOCTL_VIRTGPU_MAP \
-- 
2.6.2



[PATCH 0/9] uapi: drm: fixes for userspace compilation

2015-11-17 Thread Gabriel Laskar
On Tue, 17 Nov 2015 11:08:12 +
Emil Velikov  wrote:

> With the above said:
>  - I was thinking about hiding the UAPI ones, although Dave suggested
> against it.
>  - Doing s|drm/drm.h|drm.h| will break compilation:
>+ for the kernel - as we don't add the foo/drm/ to the include directive,
>+ for any hacked up userspace - very unlikely that they have the
> include, considering that things work without it.

We are not suggesting doing s|drm/drm.h|drm.h| but by replacing

#include 

by

#include "drm.h"

The header will be picked-up correclty in kernel, and in userland.


Is it possible to also resynchronize both headers, in order for them to
be the same in libdrm and the kernel ?

-- 
Gabriel Laskar


[PATCH 0/9] uapi: drm: fixes for userspace compilation

2015-11-13 Thread Gabriel Laskar
On Fri, 13 Nov 2015 20:38:51 +
Emil Velikov  wrote:

> On 13 November 2015 at 19:31, Gabriel Laskar  wrote:
> > On Fri, 13 Nov 2015 20:24:30 +0100
> > Gabriel Laskar  wrote:
> >  
> > Sorry for the noise, I had just saw the first version.
> >  
> Heh I was wondering what's happening. I guess I should have been more
> helpful and given you a link, rather than just throwing you a name.
> Sorry about that.

No worries, I will check a little more next time.

> From a very quick look I believe that the only part that is not
> covered by Mikko is virtgpu_drm.h as it landed recently. Other than
> that - with the explicit include of drm.h from the respective headers,
> and the stdint to __foo type conversion things should actually work.

I will resend that patch.

There is still some issues on the headers, like the inclusion of drm.h.

AFAIK, we should include "drm.h", in order to minimize the changes
between linux/libdrm when importing, as the folders are not always the
same (on Archlinux for example, drm.h is installed
in /usr/include/libdrm/drm.h). This is not always the case in some of
the headers:

* drm_sarea.h
* exynos_drm.h
* i810_drm.h
* i915_drm.h
* mga_drm.h
* msm_drm.h
* nouveau_drm.h
* omap_drm.h
* r128_drm.h
* savage_drm.h
* tegra_drm.h
* via_drm.h
* vmwgfx_drm.h (with #ifndef __KERNEL__ guards around it)

* there is still some headers that are including stddef.h for no
  visible reasons (msm_drm.h and qxl_drm.h).
* drm_fourcc.h and drm_mode.h are still using linux/types.h

I can send patches for them too, I just need to know if this is useful,
and not just nitpicking for you.

-- 
Gabriel Laskar


[PATCH 0/9] uapi: drm: fixes for userspace compilation

2015-11-13 Thread Gabriel Laskar
On Fri, 13 Nov 2015 20:24:30 +0100
Gabriel Laskar  wrote:

> On Thu, 12 Nov 2015 19:34:18 +
> Emil Velikov  wrote:
> 
> > That aside I'm a strong supporter of this type of work and I'm curious
> > why Dave hasn't picked up the existing series ? Last time I've asked
> > he did not have any objections.  

Ok, I am re-reading the patchsets now, and I didn't have seen the last
versions, sorry for the noise, this is just not yet synchronized
across all trees.

Sorry for the noise, I had just saw the first version.

-- 
Gabriel Laskar


[PATCH 0/9] uapi: drm: fixes for userspace compilation

2015-11-13 Thread Gabriel Laskar
On Thu, 12 Nov 2015 19:34:18 +
Emil Velikov  wrote:

> Hi Gabriel,
> 
> Interestingly enough we had a person (gaby) asking about this over at
> #dri-devel, and I forwarded him to the work of Mikko Rapeli. You don't
> happen to be that person do you ?

Yes, that's me.

> On 12 November 2015 at 18:14, Gabriel Laskar  wrote:
> > Public headers should use types from include/uapi/linux/types.h.
> >  
> Please don't do this. As mentioned to Mikko, these headers are meant
> to be used in more places than just Linux. All the compatibility is
> handled in drm.h so we might as well use it.

So, I have take a deeper look, and I think I now get it. On bsd, the
headers are taken from linux, and drm is ported from that, so we need,
in order to be nice to them to limit the linux specific parts to a
minimum.

So no more inclusion of linux/types.h inside all the drm headers, and
just in drm.h.

> That aside I'm a strong supporter of this type of work and I'm curious
> why Dave hasn't picked up the existing series ? Last time I've asked
> he did not have any objections.

Last patches send my Mikko were not picked, at least not these parts,
and I think this way is better, although it is a bigger change.

When including a drm header, even with drm.h used before, we have
errors related to the usage of types from stdint.h.

$ cat test-drm.c 
#include 
#include 

int main(void)
{
return 0;
}
$ gcc -I /usr/include/libdrm -fsyntax-only test-drm.c 
In file included from test-drm.c:1:0:
/usr/include/libdrm/drm.h:132:2: error: unknown type name
‘size_t’ size_t name_len;   /**< Length of name buffer */
  ^
/usr/include/libdrm/drm.h:134:2: error: unknown type name
‘size_t’ size_t date_len;   /**< Length of date buffer */
  ^
/usr/include/libdrm/drm.h:136:2: error: unknown type name
‘size_t’ size_t desc_len;   /**< Length of desc buffer */
  ^
/usr/include/libdrm/drm.h:146:2: error: unknown type name
‘size_t’ size_t unique_len;   /**< Length of unique */
  ^
In file included from test-drm.c:2:0:
/usr/include/libdrm/qxl_drm.h:51:2: error: unknown type name
‘uint32_t’ uint32_t size;
  ^
/usr/include/libdrm/qxl_drm.h:52:2: error: unknown type name
‘uint32_t’ uint32_t handle; /* 0 is an invalid handle */
  ^
/usr/include/libdrm/qxl_drm.h:56:2: error: unknown type name
‘uint64_t’ uint64_t offset; /* use for mmap system call */
  ^
/usr/include/libdrm/qxl_drm.h:57:2: error: unknown type name
‘uint32_t’ uint32_t handle;
  ^
[...]

There is 2 way to avoid that:

* include stdint.h in drm.h
* rename all the types to use __u{32,64} types that are already defined
  for the bsd guys inside drm.h

The first way is a small change, but we use the libc headers inside the
headers from the kernel. As we should have no dependencies, this is not
ideal.

On the other side, we rename the types, and it is working the same way
for bsd.

I realize that I have forgot to include one of my patches (Mikko
probably has the same, I don't remember, I'll check, and if that's the
case, I'll add his name to the commit) that fix the usage of size_t
into __kernel_size_t (and defines it for the bas path).

With those changes, do you think it'll be better?

tl;dr:

I will send a new patchset with no more inclusion of linux/types.h,
types changed from uint32_t to __u32 (and its friends) and size_t
changed into __kernel_size_t. And I'll retake a look on the other
patches to give credit for Mikko.

-- 
Gabriel Laskar


[PATCH 9/9] include/uapi/drm/omap_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/omap_drm.h | 39 ---
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/include/uapi/drm/omap_drm.h b/include/uapi/drm/omap_drm.h
index 1d0b117..926e42a 100644
--- a/include/uapi/drm/omap_drm.h
+++ b/include/uapi/drm/omap_drm.h
@@ -21,6 +21,7 @@
 #define __OMAP_DRM_H__

 #include 
+#include 

 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
@@ -29,8 +30,8 @@
 #define OMAP_PARAM_CHIPSET_ID  1   /* ie. 0x3430, 0x4430, etc */

 struct drm_omap_param {
-   uint64_t param; /* in */
-   uint64_t value; /* in (set_param), out (get_param) */
+   __u64 param;/* in */
+   __u64 value;/* in (set_param), out (get_param) */
 };

 #define OMAP_BO_SCANOUT0x0001  /* scanout capable 
(phys contiguous) */
@@ -49,18 +50,18 @@ struct drm_omap_param {
 #define OMAP_BO_TILED  (OMAP_BO_TILED_8 | OMAP_BO_TILED_16 | 
OMAP_BO_TILED_32)

 union omap_gem_size {
-   uint32_t bytes; /* (for non-tiled formats) */
+   __u32 bytes;/* (for non-tiled formats) */
struct {
-   uint16_t width;
-   uint16_t height;
+   __u16 width;
+   __u16 height;
} tiled;/* (for tiled formats) */
 };

 struct drm_omap_gem_new {
union omap_gem_size size;   /* in */
-   uint32_t flags; /* in */
-   uint32_t handle;/* out */
-   uint32_t __pad;
+   __u32 flags;/* in */
+   __u32 handle;   /* out */
+   __u32 __pad;
 };

 /* mask of operations: */
@@ -70,33 +71,33 @@ enum omap_gem_op {
 };

 struct drm_omap_gem_cpu_prep {
-   uint32_t handle;/* buffer handle (in) */
-   uint32_t op;/* mask of omap_gem_op (in) */
+   __u32 handle;   /* buffer handle (in) */
+   __u32 op;   /* mask of omap_gem_op (in) */
 };

 struct drm_omap_gem_cpu_fini {
-   uint32_t handle;/* buffer handle (in) */
-   uint32_t op;/* mask of omap_gem_op (in) */
+   __u32 handle;   /* buffer handle (in) */
+   __u32 op;   /* mask of omap_gem_op (in) */
/* TODO maybe here we pass down info about what regions are touched
 * by sw so we can be clever about cache ops?  For now a placeholder,
 * set to zero and we just do full buffer flush..
 */
-   uint32_t nregions;
-   uint32_t __pad;
+   __u32 nregions;
+   __u32 __pad;
 };

 struct drm_omap_gem_info {
-   uint32_t handle;/* buffer handle (in) */
-   uint32_t pad;
-   uint64_t offset;/* mmap offset (out) */
+   __u32 handle;   /* buffer handle (in) */
+   __u32 pad;
+   __u64 offset;   /* mmap offset (out) */
/* note: in case of tiled buffers, the user virtual size can be
 * different from the physical size (ie. how many pages are needed
 * to back the object) which is returned in DRM_IOCTL_GEM_OPEN..
 * This size here is the one that should be used if you want to
 * mmap() the buffer:
 */
-   uint32_t size;  /* virtual size for mmap'ing (out) */
-   uint32_t __pad;
+   __u32 size; /* virtual size for mmap'ing (out) */
+   __u32 __pad;
 };

 #define DRM_OMAP_GET_PARAM 0x00
-- 
2.6.2



[PATCH 8/9] include/uapi/drm/vmwgfx_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/vmwgfx_drm.h | 264 +-
 1 file changed, 132 insertions(+), 132 deletions(-)

diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
index 05b2049..ef31f44 100644
--- a/include/uapi/drm/vmwgfx_drm.h
+++ b/include/uapi/drm/vmwgfx_drm.h
@@ -111,9 +111,9 @@ enum drm_vmw_handle_type {
  */

 struct drm_vmw_getparam_arg {
-   uint64_t value;
-   uint32_t param;
-   uint32_t pad64;
+   __u64 value;
+   __u32 param;
+   __u32 pad64;
 };

 /*/
@@ -134,8 +134,8 @@ struct drm_vmw_getparam_arg {
  */

 struct drm_vmw_context_arg {
-   int32_t cid;
-   uint32_t pad64;
+   __s32 cid;
+   __u32 pad64;
 };

 /*/
@@ -165,7 +165,7 @@ struct drm_vmw_context_arg {
  * @mip_levels: Number of mip levels for each face.
  * An unused face should have 0 encoded.
  * @size_addr: Address of a user-space array of sruct drm_vmw_size
- * cast to an uint64_t for 32-64 bit compatibility.
+ * cast to an __u64 for 32-64 bit compatibility.
  * The size of the array should equal the total number of mipmap levels.
  * @shareable: Boolean whether other clients (as identified by file 
descriptors)
  * may reference this surface.
@@ -177,12 +177,12 @@ struct drm_vmw_context_arg {
  */

 struct drm_vmw_surface_create_req {
-   uint32_t flags;
-   uint32_t format;
-   uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES];
-   uint64_t size_addr;
-   int32_t shareable;
-   int32_t scanout;
+   __u32 flags;
+   __u32 format;
+   __u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
+   __u64 size_addr;
+   __s32 shareable;
+   __s32 scanout;
 };

 /**
@@ -197,7 +197,7 @@ struct drm_vmw_surface_create_req {
  */

 struct drm_vmw_surface_arg {
-   int32_t sid;
+   __s32 sid;
enum drm_vmw_handle_type handle_type;
 };

@@ -213,10 +213,10 @@ struct drm_vmw_surface_arg {
  */

 struct drm_vmw_size {
-   uint32_t width;
-   uint32_t height;
-   uint32_t depth;
-   uint32_t pad64;
+   __u32 width;
+   __u32 height;
+   __u32 depth;
+   __u32 pad64;
 };

 /**
@@ -284,13 +284,13 @@ union drm_vmw_surface_reference_arg {
 /**
  * struct drm_vmw_execbuf_arg
  *
- * @commands: User-space address of a command buffer cast to an uint64_t.
+ * @commands: User-space address of a command buffer cast to an __u64.
  * @command-size: Size in bytes of the command buffer.
  * @throttle-us: Sleep until software is less than @throttle_us
  * microseconds ahead of hardware. The driver may round this value
  * to the nearest kernel tick.
  * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
- * uint64_t.
+ * __u64.
  * @version: Allows expanding the execbuf ioctl parameters without breaking
  * backwards compatibility, since user-space will always tell the kernel
  * which version it uses.
@@ -302,14 +302,14 @@ union drm_vmw_surface_reference_arg {
 #define DRM_VMW_EXECBUF_VERSION 2

 struct drm_vmw_execbuf_arg {
-   uint64_t commands;
-   uint32_t command_size;
-   uint32_t throttle_us;
-   uint64_t fence_rep;
-   uint32_t version;
-   uint32_t flags;
-   uint32_t context_handle;
-   uint32_t pad64;
+   __u64 commands;
+   __u32 command_size;
+   __u32 throttle_us;
+   __u64 fence_rep;
+   __u32 version;
+   __u32 flags;
+   __u32 context_handle;
+   __u32 pad64;
 };

 /**
@@ -338,12 +338,12 @@ struct drm_vmw_execbuf_arg {
  */

 struct drm_vmw_fence_rep {
-   uint32_t handle;
-   uint32_t mask;
-   uint32_t seqno;
-   uint32_t passed_seqno;
-   uint32_t pad64;
-   int32_t error;
+   __u32 handle;
+   __u32 mask;
+   __u32 seqno;
+   __u32 passed_seqno;
+   __u32 pad64;
+   __s32 error;
 };

 /*/
@@ -373,8 +373,8 @@ struct drm_vmw_fence_rep {
  */

 struct drm_vmw_alloc_dmabuf_req {
-   uint32_t size;
-   uint32_t pad64;
+   __u32 size;
+   __u32 pad64;
 };

 /**
@@ -391,11 +391,11 @@ struct drm_vmw_alloc_dmabuf_req {
  */

 struct drm_vmw_dmabuf_rep {
-   uint64_t map_handle;
-   uint32_t handle;
-   uint32_t cur_gmr_id;
-   uint32_t cur_gmr_offset;
-   uint32_t pad64;
+   __u64 map_handle;
+   __u32 handle;
+   __u32 cur_gmr_id;
+   __u32 cur_gmr_offset;
+   __u32 pad64;
 };

 /**
@@ -428,8 +428,8 @@ union drm_vmw_alloc_dmabuf_arg {
  */

 struct drm_vmw_unref_dmabuf_arg {
-   uint32_t handle;
-   uint32_t pad64;
+   __u32 handle;
+   __u32 pad64;
 };

 /*/
@@ -452,10 +452,10 @@ struct drm_vmw_unref_dmabuf_arg

[PATCH 7/9] include/uapi/drm/drm_mode.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/drm_mode.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 6c11ca4..44ad794 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -526,14 +526,14 @@ struct drm_mode_crtc_page_flip {

 /* create a dumb scanout buffer */
 struct drm_mode_create_dumb {
-   uint32_t height;
-   uint32_t width;
-   uint32_t bpp;
-   uint32_t flags;
+   __u32 height;
+   __u32 width;
+   __u32 bpp;
+   __u32 flags;
/* handle, pitch, size will be returned */
-   uint32_t handle;
-   uint32_t pitch;
-   uint64_t size;
+   __u32 handle;
+   __u32 pitch;
+   __u64 size;
 };

 /* set up for mmap of a dumb scanout buffer */
@@ -550,7 +550,7 @@ struct drm_mode_map_dumb {
 };

 struct drm_mode_destroy_dumb {
-   uint32_t handle;
+   __u32 handle;
 };

 /* page-flip flags are valid, plus: */
-- 
2.6.2



[PATCH 6/9] include/uapi/drm/armada_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/radeon_drm.h | 130 +-
 1 file changed, 66 insertions(+), 64 deletions(-)

diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 01aa2a8..84a32ce 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -35,6 +35,8 @@

 #include "drm.h"

+#include 
+
 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the X server file (radeon_sarea.h)
  */
@@ -793,9 +795,9 @@ typedef struct drm_radeon_surface_free {
 #define RADEON_GEM_DOMAIN_VRAM 0x4

 struct drm_radeon_gem_info {
-   uint64_tgart_size;
-   uint64_tvram_size;
-   uint64_tvram_visible;
+   __u64   gart_size;
+   __u64   vram_size;
+   __u64   vram_visible;
 };

 #define RADEON_GEM_NO_BACKING_STORE(1 << 0)
@@ -807,11 +809,11 @@ struct drm_radeon_gem_info {
 #define RADEON_GEM_NO_CPU_ACCESS   (1 << 4)

 struct drm_radeon_gem_create {
-   uint64_tsize;
-   uint64_talignment;
-   uint32_thandle;
-   uint32_tinitial_domain;
-   uint32_tflags;
+   __u64   size;
+   __u64   alignment;
+   __u32   handle;
+   __u32   initial_domain;
+   __u32   flags;
 };

 /*
@@ -825,10 +827,10 @@ struct drm_radeon_gem_create {
 #define RADEON_GEM_USERPTR_REGISTER(1 << 3)

 struct drm_radeon_gem_userptr {
-   uint64_taddr;
-   uint64_tsize;
-   uint32_tflags;
-   uint32_thandle;
+   __u64   addr;
+   __u64   size;
+   __u32   flags;
+   __u32   handle;
 };

 #define RADEON_TILING_MACRO0x1
@@ -850,72 +852,72 @@ struct drm_radeon_gem_userptr {
 #define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK   0xf

 struct drm_radeon_gem_set_tiling {
-   uint32_thandle;
-   uint32_ttiling_flags;
-   uint32_tpitch;
+   __u32   handle;
+   __u32   tiling_flags;
+   __u32   pitch;
 };

 struct drm_radeon_gem_get_tiling {
-   uint32_thandle;
-   uint32_ttiling_flags;
-   uint32_tpitch;
+   __u32   handle;
+   __u32   tiling_flags;
+   __u32   pitch;
 };

 struct drm_radeon_gem_mmap {
-   uint32_thandle;
-   uint32_tpad;
-   uint64_toffset;
-   uint64_tsize;
-   uint64_taddr_ptr;
+   __u32   handle;
+   __u32   pad;
+   __u64   offset;
+   __u64   size;
+   __u64   addr_ptr;
 };

 struct drm_radeon_gem_set_domain {
-   uint32_thandle;
-   uint32_tread_domains;
-   uint32_twrite_domain;
+   __u32   handle;
+   __u32   read_domains;
+   __u32   write_domain;
 };

 struct drm_radeon_gem_wait_idle {
-   uint32_thandle;
-   uint32_tpad;
+   __u32   handle;
+   __u32   pad;
 };

 struct drm_radeon_gem_busy {
-   uint32_thandle;
-   uint32_tdomain;
+   __u32   handle;
+   __u32domain;
 };

 struct drm_radeon_gem_pread {
/** Handle for the object being read. */
-   uint32_t handle;
-   uint32_t pad;
+   __u32 handle;
+   __u32 pad;
/** Offset into the object to read from */
-   uint64_t offset;
+   __u64 offset;
/** Length of data to read */
-   uint64_t size;
+   __u64 size;
/** Pointer to write the data into. */
/* void *, but pointers are not 32/64 compatible */
-   uint64_t data_ptr;
+   __u64 data_ptr;
 };

 struct drm_radeon_gem_pwrite {
/** Handle for the object being written to. */
-   uint32_t handle;
-   uint32_t pad;
+   __u32 handle;
+   __u32 pad;
/** Offset into the object to write to */
-   uint64_t offset;
+   __u64 offset;
/** Length of data to write */
-   uint64_t size;
+   __u64 size;
/** Pointer to read the data from. */
/* void *, but pointers are not 32/64 compatible */
-   uint64_t data_ptr;
+   __u64 data_ptr;
 };

 /* Sets or returns a value associated with a buffer. */
 struct drm_radeon_gem_op {
-   uint32_thandle; /* buffer */
-   uint32_top; /* RADEON_GEM_OP_* */
-   uint64_tvalue;  /* input or return value */
+   __u32   handle; /* buffer */
+   __u32   op; /* RADEON_GEM_OP_* */
+   __u64   value;  /* input or return value */
 };

 #define RADEON_GEM_OP_GET_INITIAL_DOMAIN   0
@@ -935,11 +937,11 @@ struct drm_radeon_gem_op {
 #define RADEON_VM_PAGE_SNOOPED (1 << 4)

 struct drm_radeon_gem_va {
-   uint32_thandle;
-   uint32_toperation;
-   uint32_t 

[PATCH 5/9] include/uapi/drm/amdgpu_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/amdgpu_drm.h | 292 +-
 1 file changed, 147 insertions(+), 145 deletions(-)

diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index e52933a..7f169c3 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -34,6 +34,8 @@

 #include "drm.h"

+#include 
+
 #define DRM_AMDGPU_GEM_CREATE  0x00
 #define DRM_AMDGPU_GEM_MMAP0x01
 #define DRM_AMDGPU_CTX 0x02
@@ -76,19 +78,19 @@

 struct drm_amdgpu_gem_create_in  {
/** the requested memory size */
-   uint64_t bo_size;
+   __u64 bo_size;
/** physical start_addr alignment in bytes for some HW requirements */
-   uint64_t alignment;
+   __u64 alignment;
/** the requested memory domains */
-   uint64_t domains;
+   __u64 domains;
/** allocation flags */
-   uint64_t domain_flags;
+   __u64 domain_flags;
 };

 struct drm_amdgpu_gem_create_out  {
/** returned GEM object handle */
-   uint32_t handle;
-   uint32_t _pad;
+   __u32 handle;
+   __u32 _pad;
 };

 union drm_amdgpu_gem_create {
@@ -105,28 +107,28 @@ union drm_amdgpu_gem_create {

 struct drm_amdgpu_bo_list_in {
/** Type of operation */
-   uint32_t operation;
+   __u32 operation;
/** Handle of list or 0 if we want to create one */
-   uint32_t list_handle;
+   __u32 list_handle;
/** Number of BOs in list  */
-   uint32_t bo_number;
+   __u32 bo_number;
/** Size of each element describing BO */
-   uint32_t bo_info_size;
+   __u32 bo_info_size;
/** Pointer to array describing BOs */
-   uint64_t bo_info_ptr;
+   __u64 bo_info_ptr;
 };

 struct drm_amdgpu_bo_list_entry {
/** Handle of BO */
-   uint32_t bo_handle;
+   __u32 bo_handle;
/** New (if specified) BO priority to be used during migration */
-   uint32_t bo_priority;
+   __u32 bo_priority;
 };

 struct drm_amdgpu_bo_list_out {
/** Handle of resource list  */
-   uint32_t list_handle;
-   uint32_t _pad;
+   __u32 list_handle;
+   __u32 _pad;
 };

 union drm_amdgpu_bo_list {
@@ -150,26 +152,26 @@ union drm_amdgpu_bo_list {

 struct drm_amdgpu_ctx_in {
/** AMDGPU_CTX_OP_* */
-   uint32_top;
+   __u32   op;
/** For future use, no flags defined so far */
-   uint32_tflags;
-   uint32_tctx_id;
-   uint32_t_pad;
+   __u32   flags;
+   __u32   ctx_id;
+   __u32   _pad;
 };

 union drm_amdgpu_ctx_out {
struct {
-   uint32_tctx_id;
-   uint32_t_pad;
+   __u32   ctx_id;
+   __u32   _pad;
} alloc;

struct {
/** For future use, no flags defined so far */
-   uint64_tflags;
+   __u64   flags;
/** Number of resets caused by this context so far. */
-   uint32_thangs;
+   __u32   hangs;
/** Reset status since the last call of the ioctl. */
-   uint32_treset_status;
+   __u32   reset_status;
} state;
 };

@@ -189,12 +191,12 @@ union drm_amdgpu_ctx {
 #define AMDGPU_GEM_USERPTR_REGISTER(1 << 3)

 struct drm_amdgpu_gem_userptr {
-   uint64_taddr;
-   uint64_tsize;
+   __u64   addr;
+   __u64   size;
/* AMDGPU_GEM_USERPTR_* */
-   uint32_tflags;
+   __u32   flags;
/* Resulting GEM handle */
-   uint32_thandle;
+   __u32   handle;
 };

 /* same meaning as the GB_TILE_MODE and GL_MACRO_TILE_MODE fields */
@@ -226,28 +228,28 @@ struct drm_amdgpu_gem_userptr {
 /** The same structure is shared for input/output */
 struct drm_amdgpu_gem_metadata {
/** GEM Object handle */
-   uint32_thandle;
+   __u32   handle;
/** Do we want get or set metadata */
-   uint32_top;
+   __u32   op;
struct {
/** For future use, no flags defined so far */
-   uint64_tflags;
+   __u64   flags;
/** family specific tiling info */
-   uint64_ttiling_info;
-   uint32_tdata_size_bytes;
-   uint32_tdata[64];
+   __u64   tiling_info;
+   __u32   data_size_bytes;
+   __u32   data[64];
} data;
 };

 struct drm_amdgpu_gem_mmap_in {
/** the GEM object handle */
-   uint32_t handle;
-   uint32_t _pad;
+   __u32 handle;
+ 

[PATCH 4/9] include/uapi/drm/nouveau_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/nouveau_drm.h | 84 +-
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h
index fd594cc..722b6a6 100644
--- a/include/uapi/drm/nouveau_drm.h
+++ b/include/uapi/drm/nouveau_drm.h
@@ -41,34 +41,34 @@
 #define NOUVEAU_GEM_TILE_NONCONTIG   0x0008

 struct drm_nouveau_gem_info {
-   uint32_t handle;
-   uint32_t domain;
-   uint64_t size;
-   uint64_t offset;
-   uint64_t map_handle;
-   uint32_t tile_mode;
-   uint32_t tile_flags;
+   __u32 handle;
+   __u32 domain;
+   __u64 size;
+   __u64 offset;
+   __u64 map_handle;
+   __u32 tile_mode;
+   __u32 tile_flags;
 };

 struct drm_nouveau_gem_new {
struct drm_nouveau_gem_info info;
-   uint32_t channel_hint;
-   uint32_t align;
+   __u32 channel_hint;
+   __u32 align;
 };

 #define NOUVEAU_GEM_MAX_BUFFERS 1024
 struct drm_nouveau_gem_pushbuf_bo_presumed {
-   uint32_t valid;
-   uint32_t domain;
-   uint64_t offset;
+   __u32 valid;
+   __u32 domain;
+   __u64 offset;
 };

 struct drm_nouveau_gem_pushbuf_bo {
-   uint64_t user_priv;
-   uint32_t handle;
-   uint32_t read_domains;
-   uint32_t write_domains;
-   uint32_t valid_domains;
+   __u64 user_priv;
+   __u32 handle;
+   __u32 read_domains;
+   __u32 write_domains;
+   __u32 valid_domains;
struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
 };

@@ -77,46 +77,46 @@ struct drm_nouveau_gem_pushbuf_bo {
 #define NOUVEAU_GEM_RELOC_OR   (1 << 2)
 #define NOUVEAU_GEM_MAX_RELOCS 1024
 struct drm_nouveau_gem_pushbuf_reloc {
-   uint32_t reloc_bo_index;
-   uint32_t reloc_bo_offset;
-   uint32_t bo_index;
-   uint32_t flags;
-   uint32_t data;
-   uint32_t vor;
-   uint32_t tor;
+   __u32 reloc_bo_index;
+   __u32 reloc_bo_offset;
+   __u32 bo_index;
+   __u32 flags;
+   __u32 data;
+   __u32 vor;
+   __u32 tor;
 };

 #define NOUVEAU_GEM_MAX_PUSH 512
 struct drm_nouveau_gem_pushbuf_push {
-   uint32_t bo_index;
-   uint32_t pad;
-   uint64_t offset;
-   uint64_t length;
+   __u32 bo_index;
+   __u32 pad;
+   __u64 offset;
+   __u64 length;
 };

 struct drm_nouveau_gem_pushbuf {
-   uint32_t channel;
-   uint32_t nr_buffers;
-   uint64_t buffers;
-   uint32_t nr_relocs;
-   uint32_t nr_push;
-   uint64_t relocs;
-   uint64_t push;
-   uint32_t suffix0;
-   uint32_t suffix1;
-   uint64_t vram_available;
-   uint64_t gart_available;
+   __u32 channel;
+   __u32 nr_buffers;
+   __u64 buffers;
+   __u32 nr_relocs;
+   __u32 nr_push;
+   __u64 relocs;
+   __u64 push;
+   __u32 suffix0;
+   __u32 suffix1;
+   __u64 vram_available;
+   __u64 gart_available;
 };

 #define NOUVEAU_GEM_CPU_PREP_NOWAIT  0x0001
 #define NOUVEAU_GEM_CPU_PREP_WRITE   0x0004
 struct drm_nouveau_gem_cpu_prep {
-   uint32_t handle;
-   uint32_t flags;
+   __u32 handle;
+   __u32 flags;
 };

 struct drm_nouveau_gem_cpu_fini {
-   uint32_t handle;
+   __u32 handle;
 };

 #define DRM_NOUVEAU_GETPARAM   0x00 /* deprecated */
-- 
2.6.2



[PATCH 3/9] include/uapi/drm/qxl_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/qxl_drm.h | 74 +++---
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/include/uapi/drm/qxl_drm.h b/include/uapi/drm/qxl_drm.h
index ebebd36..2aa6376 100644
--- a/include/uapi/drm/qxl_drm.h
+++ b/include/uapi/drm/qxl_drm.h
@@ -30,7 +30,7 @@
 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
  *
- * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel
+ * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
  * compatibility Keep fields aligned to their size
  */

@@ -48,14 +48,14 @@
 #define DRM_QXL_ALLOC_SURF  0x06

 struct drm_qxl_alloc {
-   uint32_t size;
-   uint32_t handle; /* 0 is an invalid handle */
+   __u32 size;
+   __u32 handle; /* 0 is an invalid handle */
 };

 struct drm_qxl_map {
-   uint64_t offset; /* use for mmap system call */
-   uint32_t handle;
-   uint32_t pad;
+   __u64 offset; /* use for mmap system call */
+   __u32 handle;
+   __u32 pad;
 };

 /*
@@ -68,59 +68,59 @@ struct drm_qxl_map {
 #define QXL_RELOC_TYPE_SURF 2

 struct drm_qxl_reloc {
-   uint64_t src_offset; /* offset into src_handle or src buffer */
-   uint64_t dst_offset; /* offset in dest handle */
-   uint32_t src_handle; /* dest handle to compute address from */
-   uint32_t dst_handle; /* 0 if to command buffer */
-   uint32_t reloc_type;
-   uint32_t pad;
+   __u64 src_offset; /* offset into src_handle or src buffer */
+   __u64 dst_offset; /* offset in dest handle */
+   __u32 src_handle; /* dest handle to compute address from */
+   __u32 dst_handle; /* 0 if to command buffer */
+   __u32 reloc_type;
+   __u32 pad;
 };

 struct drm_qxl_command {
-   uint64_t __user command; /* void* */
-   uint64_t __user relocs; /* struct drm_qxl_reloc* */
-   uint32_ttype;
-   uint32_tcommand_size;
-   uint32_trelocs_num;
-   uint32_tpad;
+   __u64__user command; /* void* */
+   __u64__user relocs; /* struct drm_qxl_reloc* */
+   __u32   type;
+   __u32   command_size;
+   __u32   relocs_num;
+   __u32   pad;
 };

 /* XXX: call it drm_qxl_commands? */
 struct drm_qxl_execbuffer {
-   uint32_tflags;  /* for future use */
-   uint32_tcommands_num;
-   uint64_t __user commands;   /* struct drm_qxl_command* */
+   __u32   flags;  /* for future use */
+   __u32   commands_num;
+   __u64__user commands;   /* struct drm_qxl_command* */
 };

 struct drm_qxl_update_area {
-   uint32_t handle;
-   uint32_t top;
-   uint32_t left;
-   uint32_t bottom;
-   uint32_t right;
-   uint32_t pad;
+   __u32 handle;
+   __u32 top;
+   __u32 left;
+   __u32 bottom;
+   __u32 right;
+   __u32 pad;
 };

 #define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */
 #define QXL_PARAM_MAX_RELOCS 2
 struct drm_qxl_getparam {
-   uint64_t param;
-   uint64_t value;
+   __u64 param;
+   __u64 value;
 };

 /* these are one bit values */
 struct drm_qxl_clientcap {
-   uint32_t index;
-   uint32_t pad;
+   __u32 index;
+   __u32 pad;
 };

 struct drm_qxl_alloc_surf {
-   uint32_t format;
-   uint32_t width;
-   uint32_t height;
-   int32_t stride;
-   uint32_t handle;
-   uint32_t pad;
+   __u32 format;
+   __u32 width;
+   __u32 height;
+   __s32 stride;
+   __u32 handle;
+   __u32 pad;
 };

 #define DRM_IOCTL_QXL_ALLOC \
-- 
2.6.2



[PATCH 2/9] include/uapi/drm/virtgpu_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/virtgpu_drm.h | 99 +-
 1 file changed, 50 insertions(+), 49 deletions(-)

diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h
index fc9e2d6..60b11e7 100644
--- a/include/uapi/drm/virtgpu_drm.h
+++ b/include/uapi/drm/virtgpu_drm.h
@@ -25,12 +25,13 @@
 #define VIRTGPU_DRM_H

 #include 
+#include 
 #include "drm/drm.h"

 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
  *
- * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel
+ * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
  * compatibility Keep fields aligned to their size
  */

@@ -45,88 +46,88 @@
 #define DRM_VIRTGPU_GET_CAPS  0x09

 struct drm_virtgpu_map {
-   uint64_t offset; /* use for mmap system call */
-   uint32_t handle;
-   uint32_t pad;
+   __u64 offset; /* use for mmap system call */
+   __u32 handle;
+   __u32 pad;
 };

 struct drm_virtgpu_execbuffer {
-   uint32_tflags;  /* for future use */
-   uint32_t size;
-   uint64_t command; /* void* */
-   uint64_t bo_handles;
-   uint32_t num_bo_handles;
-   uint32_t pad;
+   __u32   flags;  /* for future use */
+   __u32 size;
+   __u64 command; /* void* */
+   __u64 bo_handles;
+   __u32 num_bo_handles;
+   __u32 pad;
 };

 #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */

 struct drm_virtgpu_getparam {
-   uint64_t param;
-   uint64_t value;
+   __u64 param;
+   __u64 value;
 };

 /* NO_BO flags? NO resource flag? */
 /* resource flag for y_0_top */
 struct drm_virtgpu_resource_create {
-   uint32_t target;
-   uint32_t format;
-   uint32_t bind;
-   uint32_t width;
-   uint32_t height;
-   uint32_t depth;
-   uint32_t array_size;
-   uint32_t last_level;
-   uint32_t nr_samples;
-   uint32_t flags;
-   uint32_t bo_handle; /* if this is set - recreate a new resource 
attached to this bo ? */
-   uint32_t res_handle;  /* returned by kernel */
-   uint32_t size;/* validate transfer in the host */
-   uint32_t stride;  /* validate transfer in the host */
+   __u32 target;
+   __u32 format;
+   __u32 bind;
+   __u32 width;
+   __u32 height;
+   __u32 depth;
+   __u32 array_size;
+   __u32 last_level;
+   __u32 nr_samples;
+   __u32 flags;
+   __u32 bo_handle; /* if this is set - recreate a new resource attached 
to this bo ? */
+   __u32 res_handle;  /* returned by kernel */
+   __u32 size;/* validate transfer in the host */
+   __u32 stride;  /* validate transfer in the host */
 };

 struct drm_virtgpu_resource_info {
-   uint32_t bo_handle;
-   uint32_t res_handle;
-   uint32_t size;
-   uint32_t stride;
+   __u32 bo_handle;
+   __u32 res_handle;
+   __u32 size;
+   __u32 stride;
 };

 struct drm_virtgpu_3d_box {
-   uint32_t x;
-   uint32_t y;
-   uint32_t z;
-   uint32_t w;
-   uint32_t h;
-   uint32_t d;
+   __u32 x;
+   __u32 y;
+   __u32 z;
+   __u32 w;
+   __u32 h;
+   __u32 d;
 };

 struct drm_virtgpu_3d_transfer_to_host {
-   uint32_t bo_handle;
+   __u32 bo_handle;
struct drm_virtgpu_3d_box box;
-   uint32_t level;
-   uint32_t offset;
+   __u32 level;
+   __u32 offset;
 };

 struct drm_virtgpu_3d_transfer_from_host {
-   uint32_t bo_handle;
+   __u32 bo_handle;
struct drm_virtgpu_3d_box box;
-   uint32_t level;
-   uint32_t offset;
+   __u32 level;
+   __u32 offset;
 };

 #define VIRTGPU_WAIT_NOWAIT 1 /* like it */
 struct drm_virtgpu_3d_wait {
-   uint32_t handle; /* 0 is an invalid handle */
-   uint32_t flags;
+   __u32 handle; /* 0 is an invalid handle */
+   __u32 flags;
 };

 struct drm_virtgpu_get_caps {
-   uint32_t cap_set_id;
-   uint32_t cap_set_ver;
-   uint64_t addr;
-   uint32_t size;
-   uint32_t pad;
+   __u32 cap_set_id;
+   __u32 cap_set_ver;
+   __u64 addr;
+   __u32 size;
+   __u32 pad;
 };

 #define DRM_IOCTL_VIRTGPU_MAP \
-- 
2.6.2



[PATCH 1/9] include/uapi/drm/armada_drm.h: use __u{32, 64} types instead of uint{32, 64}_t

2015-11-12 Thread Gabriel Laskar
Kernel headers should use linux/types.h

Signed-off-by: Gabriel Laskar 
---
 include/uapi/drm/armada_drm.h | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/include/uapi/drm/armada_drm.h b/include/uapi/drm/armada_drm.h
index 8dec3fd..77184b7 100644
--- a/include/uapi/drm/armada_drm.h
+++ b/include/uapi/drm/armada_drm.h
@@ -9,6 +9,8 @@
 #ifndef DRM_ARMADA_IOCTL_H
 #define DRM_ARMADA_IOCTL_H

+#include 
+
 #define DRM_ARMADA_GEM_CREATE  0x00
 #define DRM_ARMADA_GEM_MMAP0x02
 #define DRM_ARMADA_GEM_PWRITE  0x03
@@ -17,27 +19,27 @@
DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)

 struct drm_armada_gem_create {
-   uint32_t handle;
-   uint32_t size;
+   __u32 handle;
+   __u32 size;
 };
 #define DRM_IOCTL_ARMADA_GEM_CREATE \
ARMADA_IOCTL(IOWR, GEM_CREATE, gem_create)

 struct drm_armada_gem_mmap {
-   uint32_t handle;
-   uint32_t pad;
-   uint64_t offset;
-   uint64_t size;
-   uint64_t addr;
+   __u32 handle;
+   __u32 pad;
+   __u64 offset;
+   __u64 size;
+   __u64 addr;
 };
 #define DRM_IOCTL_ARMADA_GEM_MMAP \
ARMADA_IOCTL(IOWR, GEM_MMAP, gem_mmap)

 struct drm_armada_gem_pwrite {
-   uint64_t ptr;
-   uint32_t handle;
-   uint32_t offset;
-   uint32_t size;
+   __u64 ptr;
+   __u32 handle;
+   __u32 offset;
+   __u32 size;
 };
 #define DRM_IOCTL_ARMADA_GEM_PWRITE \
ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
-- 
2.6.2



[PATCH 0/9] uapi: drm: fixes for userspace compilation

2015-11-12 Thread Gabriel Laskar
Public headers should use types from include/uapi/linux/types.h.

This series fixes that, and allow out-of-the-box compilation of thoses headers
from userspace.

Some programs need to parse and use these headers, in order to gather
informations about the public kernel API, for example strace generation
scripts, some abi checkers, and so on.

Gabriel Laskar (9):
  include/uapi/drm/armada_drm.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/virtgpu_drm.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/qxl_drm.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/nouveau_drm.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/amdgpu_drm.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/armada_drm.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/drm_mode.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/vmwgfx_drm.h: use __u{32,64} types instead of
uint{32,64}_t
  include/uapi/drm/omap_drm.h: use __u{32,64} types instead of
uint{32,64}_t

 include/uapi/drm/amdgpu_drm.h  | 292 +
 include/uapi/drm/armada_drm.h  |  24 ++--
 include/uapi/drm/drm_mode.h|  16 +--
 include/uapi/drm/nouveau_drm.h |  84 ++--
 include/uapi/drm/omap_drm.h|  39 +++---
 include/uapi/drm/qxl_drm.h |  74 +--
 include/uapi/drm/radeon_drm.h  | 130 +-
 include/uapi/drm/virtgpu_drm.h |  99 +++---
 include/uapi/drm/vmwgfx_drm.h  | 264 ++---
 9 files changed, 515 insertions(+), 507 deletions(-)

-- 
2.6.2