* [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
@ 2015-05-30 15:37 ` Mikko Rapeli
2015-06-03 17:19 ` Emil Velikov
2015-05-30 15:37 ` [PATCH 07/98] radeon_drm.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
` (6 subsequent siblings)
7 siblings, 1 reply; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:37 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, David Airlie, dri-devel, linux-api
Fixes userspace compilation error:
drm/drm.h:132:2: error: unknown type name ‘size_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/drm/drm.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index ff6ef62..b197650 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -129,11 +129,11 @@ struct drm_version {
int version_major; /**< Major version */
int version_minor; /**< Minor version */
int version_patchlevel; /**< Patch level */
- size_t name_len; /**< Length of name buffer */
+ __kernel_size_t name_len; /**< Length of name buffer */
char __user *name; /**< Name of driver */
- size_t date_len; /**< Length of date buffer */
+ __kernel_size_t date_len; /**< Length of date buffer */
char __user *date; /**< User-space buffer to hold date */
- size_t desc_len; /**< Length of desc buffer */
+ __kernel_size_t desc_len; /**< Length of desc buffer */
char __user *desc; /**< User-space buffer to hold desc */
};
@@ -143,7 +143,7 @@ struct drm_version {
* \sa drmGetBusid() and drmSetBusId().
*/
struct drm_unique {
- size_t unique_len; /**< Length of unique */
+ __kernel_size_t unique_len; /**< Length of unique */
char __user *unique; /**< Unique name for driver instantiation */
};
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 04/98] drm_mode.h: use __u32 and __u64 from linux/types.h
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2015-05-30 15:37 ` Mikko Rapeli
[not found] ` <1433000370-19509-5-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:37 ` [PATCH 05/98] exynos_drm.h: use " Mikko Rapeli
` (5 subsequent siblings)
6 siblings, 1 reply; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:37 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Mikko Rapeli, David Airlie,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA
Fixes userspace compilation error:
drm/drm_mode.h:472:2: error: unknown type name ‘uint32_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
---
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 dbeba94..03e4d75 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -508,14 +508,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 */
@@ -532,7 +532,7 @@ struct drm_mode_map_dumb {
};
struct drm_mode_destroy_dumb {
- uint32_t handle;
+ __u32 handle;
};
/* page-flip flags are valid, plus: */
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:37 ` [PATCH 04/98] drm_mode.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
@ 2015-05-30 15:37 ` Mikko Rapeli
[not found] ` <1433000370-19509-6-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:37 ` [PATCH 06/98] nouveau_drm.h: use __u32 and " Mikko Rapeli
` (4 subsequent siblings)
6 siblings, 1 reply; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:37 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Mikko Rapeli, Inki Dae, Joonyoung Shim, Seung-Woo Kim,
Kyungmin Park, David Airlie, Kukjin Kim, Krzysztof Kozlowski,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA
Fixes userspace compilation error:
drm/exynos_drm.h:30:2: error: unknown type name ‘uint64_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
---
include/uapi/drm/exynos_drm.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index 5575ed1..c4468f9 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -15,6 +15,7 @@
#ifndef _UAPI_EXYNOS_DRM_H_
#define _UAPI_EXYNOS_DRM_H_
+#include <linux/types.h>
#include <drm/drm.h>
/**
@@ -27,7 +28,7 @@
* - this handle will be set by gem module of kernel side.
*/
struct drm_exynos_gem_create {
- uint64_t size;
+ __u64 size;
unsigned int flags;
unsigned int handle;
};
@@ -44,7 +45,7 @@ struct drm_exynos_gem_create {
struct drm_exynos_gem_info {
unsigned int handle;
unsigned int flags;
- uint64_t size;
+ __u64 size;
};
/**
@@ -58,7 +59,7 @@ struct drm_exynos_gem_info {
struct drm_exynos_vidi_connection {
unsigned int connection;
unsigned int extensions;
- uint64_t edid;
+ __u64 edid;
};
/* memory type definitions. */
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 06/98] nouveau_drm.h: use __u32 and __u64 from linux/types.h
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:37 ` [PATCH 04/98] drm_mode.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
2015-05-30 15:37 ` [PATCH 05/98] exynos_drm.h: use " Mikko Rapeli
@ 2015-05-30 15:37 ` Mikko Rapeli
2015-05-30 15:38 ` [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
` (3 subsequent siblings)
6 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:37 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Mikko Rapeli, David Airlie,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA
Fixes userspace compilation errors like:
drm/nouveau_drm.h:41:2: error: unknown type name ‘uint32_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
---
include/uapi/drm/nouveau_drm.h | 86 +++++++++++++++++++++---------------------
1 file changed, 44 insertions(+), 42 deletions(-)
diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h
index 5507eea..638aa50 100644
--- a/include/uapi/drm/nouveau_drm.h
+++ b/include/uapi/drm/nouveau_drm.h
@@ -35,6 +35,8 @@
#define NOUVEAU_ABI16_DEVICE 0xdddddddd
#define NOUVEAU_ABI16_CHAN(n) (0xcccc0000 | (n))
+#include <linux/types.h>
+
#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
@@ -49,34 +51,34 @@
#define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008
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;
};
@@ -85,46 +87,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 0x00000001
#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
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.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 07/98] radeon_drm.h: use __u32 and __u64 from linux/types.h
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
2015-05-30 15:37 ` [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t Mikko Rapeli
@ 2015-05-30 15:37 ` Mikko Rapeli
2015-05-30 15:38 ` [PATCH 08/98] r128_drm.h: include drm/drm.h Mikko Rapeli
` (5 subsequent siblings)
7 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:37 UTC (permalink / raw)
To: linux-kernel
Cc: Mikko Rapeli, Alex Deucher, Christian König, David Airlie,
dri-devel, linux-api
Fixes userspace compiler error:
drm/radeon_drm.h:794:2: error: unknown type name ‘uint64_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/drm/radeon_drm.h | 129 +++++++++++++++++++++---------------------
1 file changed, 65 insertions(+), 64 deletions(-)
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 871e73f..5127092 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -33,6 +33,7 @@
#ifndef __RADEON_DRM_H__
#define __RADEON_DRM_H__
+#include <linux/types.h>
#include <drm/drm.h>
/* WARNING: If you change any of these defines, make sure to change the
@@ -793,9 +794,9 @@ typedef struct drm_radeon_surface_free {
#define RADEON_GEM_DOMAIN_VRAM 0x4
struct drm_radeon_gem_info {
- uint64_t gart_size;
- uint64_t vram_size;
- uint64_t vram_visible;
+ __u64 gart_size;
+ __u64 vram_size;
+ __u64 vram_visible;
};
#define RADEON_GEM_NO_BACKING_STORE (1 << 0)
@@ -807,11 +808,11 @@ struct drm_radeon_gem_info {
#define RADEON_GEM_NO_CPU_ACCESS (1 << 4)
struct drm_radeon_gem_create {
- uint64_t size;
- uint64_t alignment;
- uint32_t handle;
- uint32_t initial_domain;
- uint32_t flags;
+ __u64 size;
+ __u64 alignment;
+ __u32 handle;
+ __u32 initial_domain;
+ __u32 flags;
};
/*
@@ -825,10 +826,10 @@ struct drm_radeon_gem_create {
#define RADEON_GEM_USERPTR_REGISTER (1 << 3)
struct drm_radeon_gem_userptr {
- uint64_t addr;
- uint64_t size;
- uint32_t flags;
- uint32_t handle;
+ __u64 addr;
+ __u64 size;
+ __u32 flags;
+ __u32 handle;
};
#define RADEON_TILING_MACRO 0x1
@@ -850,72 +851,72 @@ struct drm_radeon_gem_userptr {
#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK 0xf
struct drm_radeon_gem_set_tiling {
- uint32_t handle;
- uint32_t tiling_flags;
- uint32_t pitch;
+ __u32 handle;
+ __u32 tiling_flags;
+ __u32 pitch;
};
struct drm_radeon_gem_get_tiling {
- uint32_t handle;
- uint32_t tiling_flags;
- uint32_t pitch;
+ __u32 handle;
+ __u32 tiling_flags;
+ __u32 pitch;
};
struct drm_radeon_gem_mmap {
- uint32_t handle;
- uint32_t pad;
- uint64_t offset;
- uint64_t size;
- uint64_t addr_ptr;
+ __u32 handle;
+ __u32 pad;
+ __u64 offset;
+ __u64 size;
+ __u64 addr_ptr;
};
struct drm_radeon_gem_set_domain {
- uint32_t handle;
- uint32_t read_domains;
- uint32_t write_domain;
+ __u32 handle;
+ __u32 read_domains;
+ __u32 write_domain;
};
struct drm_radeon_gem_wait_idle {
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
};
struct drm_radeon_gem_busy {
- uint32_t handle;
- uint32_t domain;
+ __u32 handle;
+ __u32 domain;
};
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_t handle; /* buffer */
- uint32_t op; /* RADEON_GEM_OP_* */
- uint64_t value; /* 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 +936,11 @@ struct drm_radeon_gem_op {
#define RADEON_VM_PAGE_SNOOPED (1 << 4)
struct drm_radeon_gem_va {
- uint32_t handle;
- uint32_t operation;
- uint32_t vm_id;
- uint32_t flags;
- uint64_t offset;
+ __u32 handle;
+ __u32 operation;
+ __u32 vm_id;
+ __u32 flags;
+ __u64 offset;
};
#define RADEON_CHUNK_ID_RELOCS 0x01
@@ -961,29 +962,29 @@ struct drm_radeon_gem_va {
/* 0 = normal, + = higher priority, - = lower priority */
struct drm_radeon_cs_chunk {
- uint32_t chunk_id;
- uint32_t length_dw;
- uint64_t chunk_data;
+ __u32 chunk_id;
+ __u32 length_dw;
+ __u64 chunk_data;
};
/* drm_radeon_cs_reloc.flags */
#define RADEON_RELOC_PRIO_MASK (0xf << 0)
struct drm_radeon_cs_reloc {
- uint32_t handle;
- uint32_t read_domains;
- uint32_t write_domain;
- uint32_t flags;
+ __u32 handle;
+ __u32 read_domains;
+ __u32 write_domain;
+ __u32 flags;
};
struct drm_radeon_cs {
- uint32_t num_chunks;
- uint32_t cs_id;
- /* this points to uint64_t * which point to cs chunks */
- uint64_t chunks;
+ __u32 num_chunks;
+ __u32 cs_id;
+ /* this points to __u64 * which point to cs chunks */
+ __u64 chunks;
/* updates to the limits after this CS ioctl */
- uint64_t gart_limit;
- uint64_t vram_limit;
+ __u64 gart_limit;
+ __u64 vram_limit;
};
#define RADEON_INFO_DEVICE_ID 0x00
@@ -1040,9 +1041,9 @@ struct drm_radeon_cs {
#define RADEON_INFO_READ_REG 0x24
struct drm_radeon_info {
- uint32_t request;
- uint32_t pad;
- uint64_t value;
+ __u32 request;
+ __u32 pad;
+ __u64 value;
};
/* Those correspond to the tile index to use, this is to explicitly state
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 08/98] r128_drm.h: include drm/drm.h
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
2015-05-30 15:37 ` [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-05-30 15:37 ` [PATCH 07/98] radeon_drm.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
` (4 subsequent siblings)
7 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, David Airlie, dri-devel, linux-api
Fixes compile error:
drm/r128_drm.h:156:23: error: array type has incomplete element type
struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/drm/r128_drm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/drm/r128_drm.h b/include/uapi/drm/r128_drm.h
index 8d8878b..76b0aa3 100644
--- a/include/uapi/drm/r128_drm.h
+++ b/include/uapi/drm/r128_drm.h
@@ -33,6 +33,8 @@
#ifndef __R128_DRM_H__
#define __R128_DRM_H__
+#include <drm/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.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
` (2 preceding siblings ...)
2015-05-30 15:37 ` [PATCH 06/98] nouveau_drm.h: use __u32 and " Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
2015-06-03 17:16 ` Emil Velikov
2015-05-30 15:38 ` [PATCH 10/98] via_drm.h: hide struct via_file_private in userspace Mikko Rapeli
` (2 subsequent siblings)
6 siblings, 1 reply; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Mikko Rapeli, David Airlie,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA
Fixes compiler error:
drm/via_drm.h:36:27: fatal error: via_drmclient.h: No such file or directory
Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
---
include/uapi/drm/via_drm.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 8b0533c..791531e 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -24,6 +24,7 @@
#ifndef _VIA_DRM_H_
#define _VIA_DRM_H_
+#include <linux/types.h>
#include <drm/drm.h>
/* WARNING: These defines must be the same as what the Xserver uses.
@@ -33,9 +34,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
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 10/98] via_drm.h: hide struct via_file_private in userspace
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
` (3 preceding siblings ...)
2015-05-30 15:38 ` [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
[not found] ` <1433000370-19509-11-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:38 ` [PATCH 12/98] sis_drm.h: hide sis_file_private " Mikko Rapeli
2015-05-30 15:38 ` [PATCH 13/98] drm/i810_drm.h: include drm/drm.h Mikko Rapeli
6 siblings, 1 reply; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Mikko Rapeli, David Airlie,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA
Fixes compiler error since list_head is not exported to userspace headers.
Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
---
include/uapi/drm/via_drm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 791531e..34ce658 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -272,8 +272,10 @@ typedef struct drm_via_dmablit {
drm_via_blitsync_t sync;
} drm_via_dmablit_t;
+#ifdef __KERNEL__
struct via_file_private {
struct list_head obj_list;
};
+#endif
#endif /* _VIA_DRM_H_ */
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 11/98] savage_drm.h: include <drm/drm.h>
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
` (3 preceding siblings ...)
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2015-05-30 15:38 ` Mikko Rapeli
2015-05-30 15:38 ` [PATCH 14/98] include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h Mikko Rapeli
` (2 subsequent siblings)
7 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, David Airlie, dri-devel, linux-api
Fixes compiler error:
drm/savage_drm.h:50:24: error: array type has incomplete element type
struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/drm/savage_drm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/drm/savage_drm.h b/include/uapi/drm/savage_drm.h
index 818d49b..9dc9dc1 100644
--- a/include/uapi/drm/savage_drm.h
+++ b/include/uapi/drm/savage_drm.h
@@ -26,6 +26,8 @@
#ifndef __SAVAGE_DRM_H__
#define __SAVAGE_DRM_H__
+#include <drm/drm.h>
+
#ifndef __SAVAGE_SAREA_DEFINES__
#define __SAVAGE_SAREA_DEFINES__
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 12/98] sis_drm.h: hide sis_file_private in userspace
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
` (4 preceding siblings ...)
2015-05-30 15:38 ` [PATCH 10/98] via_drm.h: hide struct via_file_private in userspace Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
2015-05-30 15:38 ` [PATCH 13/98] drm/i810_drm.h: include drm/drm.h Mikko Rapeli
6 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Mikko Rapeli, David Airlie,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA
Fixes compiler error:
drm/sis_drm.h:68:19: error: field ‘obj_list’ has incomplete type
struct list_head obj_list;
Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
---
include/uapi/drm/sis_drm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/drm/sis_drm.h b/include/uapi/drm/sis_drm.h
index df37632..3d0903f 100644
--- a/include/uapi/drm/sis_drm.h
+++ b/include/uapi/drm/sis_drm.h
@@ -64,8 +64,10 @@ typedef struct {
unsigned long offset, size;
} drm_sis_fb_t;
+#ifdef __KERNEL__
struct sis_file_private {
struct list_head obj_list;
};
+#endif
#endif /* __SIS_DRM_H__ */
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 13/98] drm/i810_drm.h: include drm/drm.h
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
` (5 preceding siblings ...)
2015-05-30 15:38 ` [PATCH 12/98] sis_drm.h: hide sis_file_private " Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
6 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Mikko Rapeli, David Airlie,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA
Fixes userspace compilation error:
error: array type has incomplete element type
struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];
Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
---
include/uapi/drm/i810_drm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/drm/i810_drm.h b/include/uapi/drm/i810_drm.h
index 7a10bb6..34736ef 100644
--- a/include/uapi/drm/i810_drm.h
+++ b/include/uapi/drm/i810_drm.h
@@ -1,6 +1,8 @@
#ifndef _I810_DRM_H_
#define _I810_DRM_H_
+#include <drm/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.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 14/98] include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
` (4 preceding siblings ...)
2015-05-30 15:38 ` [PATCH 11/98] savage_drm.h: include <drm/drm.h> Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
2015-05-30 15:38 ` [PATCH 15/98] include/uapi/drm/qxl_drm.h: " Mikko Rapeli
2015-05-30 15:38 ` [PATCH 16/98] include/uapi/drm/msm_drm.h: use __s32, __s64, " Mikko Rapeli
7 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, David Airlie, dri-devel, linux-api
Fixes userspace compilation errors like:
error: unknown type name ‘uint32_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/drm/vmwgfx_drm.h | 260 +++++++++++++++++++++---------------------
1 file changed, 130 insertions(+), 130 deletions(-)
diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
index c472bedb..9190697 100644
--- a/include/uapi/drm/vmwgfx_drm.h
+++ b/include/uapi/drm/vmwgfx_drm.h
@@ -108,9 +108,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;
};
/*************************************************************************/
@@ -131,8 +131,8 @@ struct drm_vmw_getparam_arg {
*/
struct drm_vmw_context_arg {
- int32_t cid;
- uint32_t pad64;
+ __s32 cid;
+ __u32 pad64;
};
/*************************************************************************/
@@ -162,7 +162,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.
@@ -174,12 +174,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;
};
/**
@@ -194,7 +194,7 @@ struct drm_vmw_surface_create_req {
*/
struct drm_vmw_surface_arg {
- int32_t sid;
+ __s32 sid;
enum drm_vmw_handle_type handle_type;
};
@@ -210,10 +210,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;
};
/**
@@ -281,13 +281,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.
@@ -299,12 +299,12 @@ union drm_vmw_surface_reference_arg {
#define DRM_VMW_EXECBUF_VERSION 1
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;
+ __u64 commands;
+ __u32 command_size;
+ __u32 throttle_us;
+ __u64 fence_rep;
+ __u32 version;
+ __u32 flags;
};
/**
@@ -333,12 +333,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;
};
/*************************************************************************/
@@ -368,8 +368,8 @@ struct drm_vmw_fence_rep {
*/
struct drm_vmw_alloc_dmabuf_req {
- uint32_t size;
- uint32_t pad64;
+ __u32 size;
+ __u32 pad64;
};
/**
@@ -386,11 +386,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;
};
/**
@@ -423,8 +423,8 @@ union drm_vmw_alloc_dmabuf_arg {
*/
struct drm_vmw_unref_dmabuf_arg {
- uint32_t handle;
- uint32_t pad64;
+ __u32 handle;
+ __u32 pad64;
};
/*************************************************************************/
@@ -447,10 +447,10 @@ struct drm_vmw_unref_dmabuf_arg {
*/
struct drm_vmw_rect {
- int32_t x;
- int32_t y;
- uint32_t w;
- uint32_t h;
+ __s32 x;
+ __s32 y;
+ __u32 w;
+ __u32 h;
};
/**
@@ -472,21 +472,21 @@ struct drm_vmw_rect {
*/
struct drm_vmw_control_stream_arg {
- uint32_t stream_id;
- uint32_t enabled;
+ __u32 stream_id;
+ __u32 enabled;
- uint32_t flags;
- uint32_t color_key;
+ __u32 flags;
+ __u32 color_key;
- uint32_t handle;
- uint32_t offset;
- int32_t format;
- uint32_t size;
- uint32_t width;
- uint32_t height;
- uint32_t pitch[3];
+ __u32 handle;
+ __u32 offset;
+ __s32 format;
+ __u32 size;
+ __u32 width;
+ __u32 height;
+ __u32 pitch[3];
- uint32_t pad64;
+ __u32 pad64;
struct drm_vmw_rect src;
struct drm_vmw_rect dst;
};
@@ -514,12 +514,12 @@ struct drm_vmw_control_stream_arg {
*/
struct drm_vmw_cursor_bypass_arg {
- uint32_t flags;
- uint32_t crtc_id;
- int32_t xpos;
- int32_t ypos;
- int32_t xhot;
- int32_t yhot;
+ __u32 flags;
+ __u32 crtc_id;
+ __s32 xpos;
+ __s32 ypos;
+ __s32 xhot;
+ __s32 yhot;
};
/*************************************************************************/
@@ -537,8 +537,8 @@ struct drm_vmw_cursor_bypass_arg {
*/
struct drm_vmw_stream_arg {
- uint32_t stream_id;
- uint32_t pad64;
+ __u32 stream_id;
+ __u32 pad64;
};
/*************************************************************************/
@@ -560,7 +560,7 @@ struct drm_vmw_stream_arg {
/**
* struct drm_vmw_get_3d_cap_arg
*
- * @buffer: Pointer to a buffer for capability data, cast to an uint64_t
+ * @buffer: Pointer to a buffer for capability data, cast to an __u64
* @size: Max size to copy
*
* Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
@@ -568,9 +568,9 @@ struct drm_vmw_stream_arg {
*/
struct drm_vmw_get_3d_cap_arg {
- uint64_t buffer;
- uint32_t max_size;
- uint32_t pad64;
+ __u64 buffer;
+ __u32 max_size;
+ __u32 pad64;
};
/*************************************************************************/
@@ -619,14 +619,14 @@ struct drm_vmw_get_3d_cap_arg {
*/
struct drm_vmw_fence_wait_arg {
- uint32_t handle;
- int32_t cookie_valid;
- uint64_t kernel_cookie;
- uint64_t timeout_us;
- int32_t lazy;
- int32_t flags;
- int32_t wait_options;
- int32_t pad64;
+ __u32 handle;
+ __s32 cookie_valid;
+ __u64 kernel_cookie;
+ __u64 timeout_us;
+ __s32 lazy;
+ __s32 flags;
+ __s32 wait_options;
+ __s32 pad64;
};
/*************************************************************************/
@@ -650,12 +650,12 @@ struct drm_vmw_fence_wait_arg {
*/
struct drm_vmw_fence_signaled_arg {
- uint32_t handle;
- uint32_t flags;
- int32_t signaled;
- uint32_t passed_seqno;
- uint32_t signaled_flags;
- uint32_t pad64;
+ __u32 handle;
+ __u32 flags;
+ __s32 signaled;
+ __u32 passed_seqno;
+ __u32 signaled_flags;
+ __u32 pad64;
};
/*************************************************************************/
@@ -676,8 +676,8 @@ struct drm_vmw_fence_signaled_arg {
*/
struct drm_vmw_fence_arg {
- uint32_t handle;
- uint32_t pad64;
+ __u32 handle;
+ __u32 pad64;
};
@@ -698,9 +698,9 @@ struct drm_vmw_fence_arg {
struct drm_vmw_event_fence {
struct drm_event base;
- uint64_t user_data;
- uint32_t tv_sec;
- uint32_t tv_usec;
+ __u64 user_data;
+ __u32 tv_sec;
+ __u32 tv_usec;
};
/*
@@ -712,17 +712,17 @@ struct drm_vmw_event_fence {
/**
* struct drm_vmw_fence_event_arg
*
- * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if
+ * @fence_rep: Pointer to fence_rep structure cast to __u64 or 0 if
* the fence is not supposed to be referenced by user-space.
* @user_info: Info to be delivered with the event.
* @handle: Attach the event to this fence only.
* @flags: A set of flags as defined above.
*/
struct drm_vmw_fence_event_arg {
- uint64_t fence_rep;
- uint64_t user_data;
- uint32_t handle;
- uint32_t flags;
+ __u64 fence_rep;
+ __u64 user_data;
+ __u32 handle;
+ __u32 flags;
};
@@ -742,7 +742,7 @@ struct drm_vmw_fence_event_arg {
* @sid: Surface id to present from.
* @dest_x: X placement coordinate for surface.
* @dest_y: Y placement coordinate for surface.
- * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
+ * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
* @num_clips: Number of cliprects given relative to the framebuffer origin,
* in the same coordinate space as the frame buffer.
* @pad64: Unused 64-bit padding.
@@ -751,13 +751,13 @@ struct drm_vmw_fence_event_arg {
*/
struct drm_vmw_present_arg {
- uint32_t fb_id;
- uint32_t sid;
- int32_t dest_x;
- int32_t dest_y;
- uint64_t clips_ptr;
- uint32_t num_clips;
- uint32_t pad64;
+ __u32 fb_id;
+ __u32 sid;
+ __s32 dest_x;
+ __s32 dest_y;
+ __u64 clips_ptr;
+ __u32 num_clips;
+ __u32 pad64;
};
@@ -775,16 +775,16 @@ struct drm_vmw_present_arg {
* struct drm_vmw_present_arg
* @fb_id: fb_id to present / read back from.
* @num_clips: Number of cliprects.
- * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
- * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t.
+ * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
+ * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an __u64.
* If this member is NULL, then the ioctl should not return a fence.
*/
struct drm_vmw_present_readback_arg {
- uint32_t fb_id;
- uint32_t num_clips;
- uint64_t clips_ptr;
- uint64_t fence_rep;
+ __u32 fb_id;
+ __u32 num_clips;
+ __u64 clips_ptr;
+ __u64 fence_rep;
};
/*************************************************************************/
@@ -800,14 +800,14 @@ struct drm_vmw_present_readback_arg {
* struct drm_vmw_update_layout_arg
*
* @num_outputs: number of active connectors
- * @rects: pointer to array of drm_vmw_rect cast to an uint64_t
+ * @rects: pointer to array of drm_vmw_rect cast to an __u64
*
* Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
*/
struct drm_vmw_update_layout_arg {
- uint32_t num_outputs;
- uint32_t pad64;
- uint64_t rects;
+ __u32 num_outputs;
+ __u32 pad64;
+ __u64 rects;
};
@@ -845,10 +845,10 @@ enum drm_vmw_shader_type {
*/
struct drm_vmw_shader_create_arg {
enum drm_vmw_shader_type shader_type;
- uint32_t size;
- uint32_t buffer_handle;
- uint32_t shader_handle;
- uint64_t offset;
+ __u32 size;
+ __u32 buffer_handle;
+ __u32 shader_handle;
+ __u64 offset;
};
/*************************************************************************/
@@ -867,8 +867,8 @@ struct drm_vmw_shader_create_arg {
* Input argument to the DRM_VMW_UNREF_SHADER ioctl.
*/
struct drm_vmw_shader_arg {
- uint32_t handle;
- uint32_t pad64;
+ __u32 handle;
+ __u32 pad64;
};
/*************************************************************************/
@@ -912,14 +912,14 @@ enum drm_vmw_surface_flags {
* Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
*/
struct drm_vmw_gb_surface_create_req {
- uint32_t svga3d_flags;
- uint32_t format;
- uint32_t mip_levels;
+ __u32 svga3d_flags;
+ __u32 format;
+ __u32 mip_levels;
enum drm_vmw_surface_flags drm_surface_flags;
- uint32_t multisample_count;
- uint32_t autogen_filter;
- uint32_t buffer_handle;
- uint32_t pad64;
+ __u32 multisample_count;
+ __u32 autogen_filter;
+ __u32 buffer_handle;
+ __u32 pad64;
struct drm_vmw_size base_size;
};
@@ -938,11 +938,11 @@ struct drm_vmw_gb_surface_create_req {
* Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
*/
struct drm_vmw_gb_surface_create_rep {
- uint32_t handle;
- uint32_t backup_size;
- uint32_t buffer_handle;
- uint32_t buffer_size;
- uint64_t buffer_map_handle;
+ __u32 handle;
+ __u32 backup_size;
+ __u32 buffer_handle;
+ __u32 buffer_size;
+ __u64 buffer_map_handle;
};
/**
@@ -1055,8 +1055,8 @@ enum drm_vmw_synccpu_op {
struct drm_vmw_synccpu_arg {
enum drm_vmw_synccpu_op op;
enum drm_vmw_synccpu_flags flags;
- uint32_t handle;
- uint32_t pad64;
+ __u32 handle;
+ __u32 pad64;
};
#endif
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 15/98] include/uapi/drm/qxl_drm.h: use __s32, __u32 and __u64 from linux/types.h
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
` (5 preceding siblings ...)
2015-05-30 15:38 ` [PATCH 14/98] include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
2015-05-30 15:38 ` [PATCH 16/98] include/uapi/drm/msm_drm.h: use __s32, __s64, " Mikko Rapeli
7 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, David Airlie, dri-devel, linux-api
Fixes userspace compilation errors like:
error: unknown type name ‘uint32_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
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..dface36 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_t type;
- uint32_t command_size;
- uint32_t relocs_num;
- uint32_t pad;
+ __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_t flags; /* for future use */
- uint32_t commands_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.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 16/98] include/uapi/drm/msm_drm.h: use __s32, __s64, __u32 and __u64 from linux/types.h
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
` (6 preceding siblings ...)
2015-05-30 15:38 ` [PATCH 15/98] include/uapi/drm/qxl_drm.h: " Mikko Rapeli
@ 2015-05-30 15:38 ` Mikko Rapeli
7 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-05-30 15:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, David Airlie, dri-devel, linux-api
Fixes userspace compilation errors like:
error: unknown type name ‘uint32_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/drm/msm_drm.h | 76 +++++++++++++++++++++++-----------------------
1 file changed, 38 insertions(+), 38 deletions(-)
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index 0664c31..75a232b 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -23,7 +23,7 @@
/* Please note that modifications to all structs defined here are
* subject to backwards-compatibility constraints:
- * 1) Do not use pointers, use uint64_t instead for 32 bit / 64 bit
+ * 1) Do not use pointers, use __u64 instead for 32 bit / 64 bit
* user/kernel compatibility
* 2) Keep fields aligned to their size
* 3) Because of how drm_ioctl() works, we can add new fields at
@@ -44,8 +44,8 @@
* same as 'struct timespec' but 32/64b ABI safe.
*/
struct drm_msm_timespec {
- int64_t tv_sec; /* seconds */
- int64_t tv_nsec; /* nanoseconds */
+ __s64 tv_sec; /* seconds */
+ __s64 tv_nsec; /* nanoseconds */
};
#define MSM_PARAM_GPU_ID 0x01
@@ -53,9 +53,9 @@ struct drm_msm_timespec {
#define MSM_PARAM_CHIP_ID 0x03
struct drm_msm_param {
- uint32_t pipe; /* in, MSM_PIPE_x */
- uint32_t param; /* in, MSM_PARAM_x */
- uint64_t value; /* out (get_param) or in (set_param) */
+ __u32 pipe; /* in, MSM_PIPE_x */
+ __u32 param; /* in, MSM_PARAM_x */
+ __u64 value; /* out (get_param) or in (set_param) */
};
/*
@@ -77,15 +77,15 @@ struct drm_msm_param {
MSM_BO_UNCACHED)
struct drm_msm_gem_new {
- uint64_t size; /* in */
- uint32_t flags; /* in, mask of MSM_BO_x */
- uint32_t handle; /* out */
+ __u64 size; /* in */
+ __u32 flags; /* in, mask of MSM_BO_x */
+ __u32 handle; /* out */
};
struct drm_msm_gem_info {
- uint32_t handle; /* in */
- uint32_t pad;
- uint64_t offset; /* out, offset to pass to mmap() */
+ __u32 handle; /* in */
+ __u32 pad;
+ __u64 offset; /* out, offset to pass to mmap() */
};
#define MSM_PREP_READ 0x01
@@ -95,13 +95,13 @@ struct drm_msm_gem_info {
#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
struct drm_msm_gem_cpu_prep {
- uint32_t handle; /* in */
- uint32_t op; /* in, mask of MSM_PREP_x */
+ __u32 handle; /* in */
+ __u32 op; /* in, mask of MSM_PREP_x */
struct drm_msm_timespec timeout; /* in */
};
struct drm_msm_gem_cpu_fini {
- uint32_t handle; /* in */
+ __u32 handle; /* in */
};
/*
@@ -120,11 +120,11 @@ struct drm_msm_gem_cpu_fini {
* otherwise EINVAL.
*/
struct drm_msm_gem_submit_reloc {
- uint32_t submit_offset; /* in, offset from submit_bo */
- uint32_t or; /* in, value OR'd with result */
- int32_t shift; /* in, amount of left shift (can be negative) */
- uint32_t reloc_idx; /* in, index of reloc_bo buffer */
- uint64_t reloc_offset; /* in, offset from start of reloc_bo */
+ __u32 submit_offset; /* in, offset from submit_bo */
+ __u32 or; /* in, value OR'd with result */
+ __s32 shift; /* in, amount of left shift (can be negative) */
+ __u32 reloc_idx; /* in, index of reloc_bo buffer */
+ __u64 reloc_offset; /* in, offset from start of reloc_bo */
};
/* submit-types:
@@ -139,13 +139,13 @@ struct drm_msm_gem_submit_reloc {
#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
struct drm_msm_gem_submit_cmd {
- uint32_t type; /* in, one of MSM_SUBMIT_CMD_x */
- uint32_t submit_idx; /* in, index of submit_bo cmdstream buffer */
- uint32_t submit_offset; /* in, offset into submit_bo */
- uint32_t size; /* in, cmdstream size */
- uint32_t pad;
- uint32_t nr_relocs; /* in, number of submit_reloc's */
- uint64_t __user relocs; /* in, ptr to array of submit_reloc's */
+ __u32 type; /* in, one of MSM_SUBMIT_CMD_x */
+ __u32 submit_idx; /* in, index of submit_bo cmdstream buffer */
+ __u32 submit_offset; /* in, offset into submit_bo */
+ __u32 size; /* in, cmdstream size */
+ __u32 pad;
+ __u32 nr_relocs; /* in, number of submit_reloc's */
+ __u64 __user relocs; /* in, ptr to array of submit_reloc's */
};
/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
@@ -165,9 +165,9 @@ struct drm_msm_gem_submit_cmd {
#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
struct drm_msm_gem_submit_bo {
- uint32_t flags; /* in, mask of MSM_SUBMIT_BO_x */
- uint32_t handle; /* in, GEM handle */
- uint64_t presumed; /* in/out, presumed buffer address */
+ __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */
+ __u32 handle; /* in, GEM handle */
+ __u64 presumed; /* in/out, presumed buffer address */
};
/* Each cmdstream submit consists of a table of buffers involved, and
@@ -175,12 +175,12 @@ struct drm_msm_gem_submit_bo {
* (context-restore), and IB buffers needed for per tile/bin draw cmds.
*/
struct drm_msm_gem_submit {
- uint32_t pipe; /* in, MSM_PIPE_x */
- uint32_t fence; /* out */
- uint32_t nr_bos; /* in, number of submit_bo's */
- uint32_t nr_cmds; /* in, number of submit_cmd's */
- uint64_t __user bos; /* in, ptr to array of submit_bo's */
- uint64_t __user cmds; /* in, ptr to array of submit_cmd's */
+ __u32 pipe; /* in, MSM_PIPE_x */
+ __u32 fence; /* out */
+ __u32 nr_bos; /* in, number of submit_bo's */
+ __u32 nr_cmds; /* in, number of submit_cmd's */
+ __u64 __user bos; /* in, ptr to array of submit_bo's */
+ __u64 __user cmds; /* in, ptr to array of submit_cmd's */
};
/* The normal way to synchronize with the GPU is just to CPU_PREP on
@@ -191,8 +191,8 @@ struct drm_msm_gem_submit {
* APIs without requiring a dummy bo to synchronize on.
*/
struct drm_msm_wait_fence {
- uint32_t fence; /* in */
- uint32_t pad;
+ __u32 fence; /* in */
+ __u32 pad;
struct drm_msm_timespec timeout; /* in */
};
--
2.1.4
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
[not found] ` <1433000370-19509-6-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2015-05-30 16:46 ` Russell King - ARM Linux
2015-06-01 8:20 ` Christian König
2015-06-02 18:59 ` Mikko Rapeli
0 siblings, 2 replies; 31+ messages in thread
From: Russell King - ARM Linux @ 2015-05-30 16:46 UTC (permalink / raw)
To: Mikko Rapeli
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Krzysztof Kozlowski,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Joonyoung Shim,
David Airlie, Seung-Woo Kim,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Inki Dae,
Kyungmin Park, Kukjin Kim, linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Sat, May 30, 2015 at 05:37:57PM +0200, Mikko Rapeli wrote:
> Fixes userspace compilation error:
>
> drm/exynos_drm.h:30:2: error: unknown type name ‘uint64_t’
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
This is another thing which we need to address. We should not be using
unsigned int/unsigned long/uintXX_t/etc in here, but the __uXX and __sXX
types.
The lesson learned from other DRM developers is that using these types
simplifies the API especially when it comes to the differences between
32-bit and 64-bit machines, and compat applications.
Note that drm/drm.h is all that should need to be included - drm/drm.h
takes care of including linux/types.h when building on Linux platforms.
(note: if your compiler doesn't set __linux__ then you're probably not
using the proper compiler...)
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 04/98] drm_mode.h: use __u32 and __u64 from linux/types.h
[not found] ` <1433000370-19509-5-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2015-05-30 19:58 ` Frans Klaver
0 siblings, 0 replies; 31+ messages in thread
From: Frans Klaver @ 2015-05-30 19:58 UTC (permalink / raw)
To: Mikko Rapeli
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, David Airlie,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-api-u79uwXL29TY76Z2rM5mHXA
On Sat, May 30, 2015 at 05:37:56PM +0200, Mikko Rapeli wrote:
> Fixes userspace compilation error:
>
> drm/drm_mode.h:472:2: error: unknown type name ‘uint32_t’
It's even more or less required by the coding style. Chapter 5
(typedefs) says:
(e) Types safe for use in userspace.
In certain structures which are visible to userspace, we cannot
require C99 types and cannot use the 'u32' form above. Thus, we
use __u32 and similar types in all structures which are shared
with userspace.
So this is probably an improvement in any case.
Thanks,
Frans
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
> ---
> 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 dbeba94..03e4d75 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -508,14 +508,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 */
> @@ -532,7 +532,7 @@ struct drm_mode_map_dumb {
> };
>
> struct drm_mode_destroy_dumb {
> - uint32_t handle;
> + __u32 handle;
> };
>
> /* page-flip flags are valid, plus: */
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
2015-05-30 16:46 ` Russell King - ARM Linux
@ 2015-06-01 8:20 ` Christian König
[not found] ` <556C15BA.7000909-5C7GfCeVMHo@public.gmane.org>
2015-06-02 18:59 ` Mikko Rapeli
1 sibling, 1 reply; 31+ messages in thread
From: Christian König @ 2015-06-01 8:20 UTC (permalink / raw)
To: Russell King - ARM Linux, Mikko Rapeli
Cc: Krzysztof Kozlowski, linux-samsung-soc, linux-api, Seung-Woo Kim,
linux-kernel, dri-devel, Kyungmin Park, Kukjin Kim,
linux-arm-kernel
On 30.05.2015 18:46, Russell King - ARM Linux wrote:
> On Sat, May 30, 2015 at 05:37:57PM +0200, Mikko Rapeli wrote:
>> Fixes userspace compilation error:
>>
>> drm/exynos_drm.h:30:2: error: unknown type name ‘uint64_t’
>>
>> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> This is another thing which we need to address. We should not be using
> unsigned int/unsigned long/uintXX_t/etc in here, but the __uXX and __sXX
> types.
>
> The lesson learned from other DRM developers is that using these types
> simplifies the API especially when it comes to the differences between
> 32-bit and 64-bit machines, and compat applications.
>
> Note that drm/drm.h is all that should need to be included - drm/drm.h
> takes care of including linux/types.h when building on Linux platforms.
> (note: if your compiler doesn't set __linux__ then you're probably not
> using the proper compiler...)
>
Using types that differs on 32-bit and 64-bit machines for a kernel
interface is indeed a rather bad idea. This not only includes longs, but
pointers as well.
But the int8_t, int16_t int32_t, int64_t and their unsigned counterparts
are defined in stdint.h which is part of the ISO/IEC 9899:1999 standard,
similar is true for size_t.
The __uXX, __sXX and _kernel_size_t types are linux specific as far as I
know.
For best interoperability and standard conformance I think that
definitions from the C standard we use should out-rule linux specific
definitions.
Additional to that "linux/types.h" is not part of the uapi as far as I
know, so including it in a header which is part of the uapi should be
forbidden.
So this is a NAK from my side for the whole series, userspace programs
should include <stdint.h> for the definition of the ISO/IEC 9899:1999
standard types if necessary.
Regards,
Christian.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
[not found] ` <556C15BA.7000909-5C7GfCeVMHo@public.gmane.org>
@ 2015-06-01 8:56 ` Russell King - ARM Linux
[not found] ` <20150601085605.GN2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-06-01 9:15 ` Mikko Rapeli
1 sibling, 1 reply; 31+ messages in thread
From: Russell King - ARM Linux @ 2015-06-01 8:56 UTC (permalink / raw)
To: Christian König
Cc: Mikko Rapeli, Krzysztof Kozlowski,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, Seung-Woo Kim,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Kyungmin Park,
Kukjin Kim, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Mon, Jun 01, 2015 at 10:20:10AM +0200, Christian König wrote:
> Using types that differs on 32-bit and 64-bit machines for a kernel
> interface is indeed a rather bad idea. This not only includes longs, but
> pointers as well.
[cut standard stdint.h types argument which we've heard before]
You need to read Linus' rant on this subject:
From: Linus Torvalds <torvalds-3NddpPZAyC0@public.gmane.org>
Subject: Re: [RFC] Splitting kernel headers and deprecating __KERNEL__
Date: Mon, 29 Nov 2004 01:30:46 GMT
Ok, this discussion has gone on for too long anyway, but let's make it
easier for everybody. The kernel uses u8/u16/u32 because:
- the kernel should not depend on, or pollute user-space naming.
YOU MUST NOT USE "uint32_t" when that may not be defined, and
user-space rules for when it is defined are arcane and totally
arbitrary.
- since the kernel cannot use those types for anything that is
visible to user space anyway, there has to be alternate names.
The tradition is to prepend two underscores, so the kernel would
have to use "__uint32_t" etc for its header files.
- at that point, there's no longer any valid argument that it's a
"standard type" (it ain't), and I personally find it a lot more
readable to just use the types that the kernel has always used:
__u8/__u16/__u32. For stuff that is only used for the kernel,
the shorter "u8/u16/u32" versions may be used.
In short: having the kernel use the same names as user space is ACTIVELY
BAD, exactly because those names have standards-defined visibility, which
means that the kernel _cannot_ use them in all places anyway. So don't
even _try_.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
[not found] ` <20150601085605.GN2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2015-06-01 9:08 ` Christian König
2015-06-01 9:14 ` Frans Klaver
[not found] ` <556C2105.2090607-5C7GfCeVMHo@public.gmane.org>
0 siblings, 2 replies; 31+ messages in thread
From: Christian König @ 2015-06-01 9:08 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Mikko Rapeli, Krzysztof Kozlowski,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, Seung-Woo Kim,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Kyungmin Park,
Kukjin Kim, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Yeah, completely agree with Linus on the visibility problem and that's
exactly the reason why we don't include <stdint.h> in the kernel header
and expect userspace to define the ISO types somewhere.
But using the types from "include/linux/types.h" and especially
including it into the uapi headers doesn't make the situation better,
but rather worse.
With this step we not only make the headers depend on another header
that isn't part of the uapi, but also pollute the user space namespace
with __sXX and __uXX types which aren't defined anywhere else.
Regards,
Christian.
On 01.06.2015 10:56, Russell King - ARM Linux wrote:
> On Mon, Jun 01, 2015 at 10:20:10AM +0200, Christian König wrote:
>> Using types that differs on 32-bit and 64-bit machines for a kernel
>> interface is indeed a rather bad idea. This not only includes longs, but
>> pointers as well.
> [cut standard stdint.h types argument which we've heard before]
>
> You need to read Linus' rant on this subject:
>
> From: Linus Torvalds <torvalds-3NddpPZAyC0@public.gmane.org>
> Subject: Re: [RFC] Splitting kernel headers and deprecating __KERNEL__
> Date: Mon, 29 Nov 2004 01:30:46 GMT
>
> Ok, this discussion has gone on for too long anyway, but let's make it
> easier for everybody. The kernel uses u8/u16/u32 because:
>
> - the kernel should not depend on, or pollute user-space naming.
> YOU MUST NOT USE "uint32_t" when that may not be defined, and
> user-space rules for when it is defined are arcane and totally
> arbitrary.
>
> - since the kernel cannot use those types for anything that is
> visible to user space anyway, there has to be alternate names.
> The tradition is to prepend two underscores, so the kernel would
> have to use "__uint32_t" etc for its header files.
>
> - at that point, there's no longer any valid argument that it's a
> "standard type" (it ain't), and I personally find it a lot more
> readable to just use the types that the kernel has always used:
> __u8/__u16/__u32. For stuff that is only used for the kernel,
> the shorter "u8/u16/u32" versions may be used.
>
> In short: having the kernel use the same names as user space is ACTIVELY
> BAD, exactly because those names have standards-defined visibility, which
> means that the kernel _cannot_ use them in all places anyway. So don't
> even _try_.
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
2015-06-01 9:08 ` Christian König
@ 2015-06-01 9:14 ` Frans Klaver
[not found] ` <556C2105.2090607-5C7GfCeVMHo@public.gmane.org>
1 sibling, 0 replies; 31+ messages in thread
From: Frans Klaver @ 2015-06-01 9:14 UTC (permalink / raw)
To: Christian König
Cc: Russell King - ARM Linux, Krzysztof Kozlowski, linux-samsung-soc,
Mikko Rapeli, Seung-Woo Kim, linux-kernel@vger.kernel.org,
DRI mailing list, Kyungmin Park, Kukjin Kim, linux-api,
linux-arm-kernel
On Mon, Jun 1, 2015 at 11:08 AM, Christian König
<christian.koenig@amd.com> wrote:
> Yeah, completely agree with Linus on the visibility problem and that's
> exactly the reason why we don't include <stdint.h> in the kernel header and
> expect userspace to define the ISO types somewhere.
>
> But using the types from "include/linux/types.h" and especially including it
> into the uapi headers doesn't make the situation better, but rather worse.
>
> With this step we not only make the headers depend on another header that
> isn't part of the uapi, but also pollute the user space namespace with __sXX
> and __uXX types which aren't defined anywhere else.
These __uXX and __sXX types are defined in
include/uapi/asm-generic/ll64.h and pulled in by
include/uapi/linux/types.h. Including linux/types.h is therefore
valid.
Frans
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
[not found] ` <556C15BA.7000909-5C7GfCeVMHo@public.gmane.org>
2015-06-01 8:56 ` Russell King - ARM Linux
@ 2015-06-01 9:15 ` Mikko Rapeli
1 sibling, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-06-01 9:15 UTC (permalink / raw)
To: Christian König
Cc: Russell King - ARM Linux, Krzysztof Kozlowski,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, Seung-Woo Kim,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Kyungmin Park,
Kukjin Kim, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Mon, Jun 01, 2015 at 10:20:10AM +0200, Christian König wrote:
> Additional to that "linux/types.h" is not part of the uapi as far as
> I know, so including it in a header which is part of the uapi should
> be forbidden.
linux/types.h is part of uapi. See usr/include after 'make headers_install'.
-Mikko
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
[not found] ` <556C2105.2090607-5C7GfCeVMHo@public.gmane.org>
@ 2015-06-01 9:38 ` Russell King - ARM Linux
[not found] ` <20150601093808.GP2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
0 siblings, 1 reply; 31+ messages in thread
From: Russell King - ARM Linux @ 2015-06-01 9:38 UTC (permalink / raw)
To: Christian König
Cc: Mikko Rapeli, Krzysztof Kozlowski,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, Seung-Woo Kim,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Kyungmin Park,
Kukjin Kim, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Mon, Jun 01, 2015 at 11:08:21AM +0200, Christian König wrote:
> Yeah, completely agree with Linus on the visibility problem and that's
> exactly the reason why we don't include <stdint.h> in the kernel header and
> expect userspace to define the ISO types somewhere.
>
> But using the types from "include/linux/types.h" and especially including it
> into the uapi headers doesn't make the situation better, but rather worse.
>
> With this step we not only make the headers depend on another header that
> isn't part of the uapi, but also pollute the user space namespace with __sXX
> and __uXX types which aren't defined anywhere else.
1) Header files are permitted to pollute userspace with __-defined stuff.
2) __[su]XX types are defined as part of the kernel's uapi.
include/uapi/linux/types.h includes asm/types.h, which in userspace
picks up include/uapi/asm-generic/types.h. That picks up
asm-generic/int-ll64.h, which defines these types.
Moreover, this is done throughout the kernel headers _already_ (as you
would expect for a policy set 10+ years ago).
Please, I'm not interested in this discussion, so please don't argue
with me - I may agree with your position, but what you think and what
I think are really not relevant here. If you have a problem, take it
up with Linus - I made that clear in my email.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
[not found] ` <20150601093808.GP2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2015-06-01 9:51 ` Christian König
0 siblings, 0 replies; 31+ messages in thread
From: Christian König @ 2015-06-01 9:51 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Mikko Rapeli, Krzysztof Kozlowski,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, Seung-Woo Kim,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Kyungmin Park,
Kukjin Kim, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On 01.06.2015 11:38, Russell King - ARM Linux wrote:
> On Mon, Jun 01, 2015 at 11:08:21AM +0200, Christian König wrote:
>> Yeah, completely agree with Linus on the visibility problem and that's
>> exactly the reason why we don't include <stdint.h> in the kernel header and
>> expect userspace to define the ISO types somewhere.
>>
>> But using the types from "include/linux/types.h" and especially including it
>> into the uapi headers doesn't make the situation better, but rather worse.
>>
>> With this step we not only make the headers depend on another header that
>> isn't part of the uapi, but also pollute the user space namespace with __sXX
>> and __uXX types which aren't defined anywhere else.
> 1) Header files are permitted to pollute userspace with __-defined stuff.
>
> 2) __[su]XX types are defined as part of the kernel's uapi.
> include/uapi/linux/types.h includes asm/types.h, which in userspace
> picks up include/uapi/asm-generic/types.h. That picks up
> asm-generic/int-ll64.h, which defines these types.
>
> Moreover, this is done throughout the kernel headers _already_ (as you
> would expect for a policy set 10+ years ago).
>
> Please, I'm not interested in this discussion, so please don't argue
> with me - I may agree with your position, but what you think and what
> I think are really not relevant here. If you have a problem, take it
> up with Linus - I made that clear in my email.
>
In this case I'm fine with the changes, but I'm still not sure if that's
a good idea or not.
Sticking to ISO C still sounds better than doing something on our own.
And it now looks a bit different than it was in 2004, stdint.h is widely
adopted in userspace if I'm not completely mistaken.
Anyway you're perfectly right that Linus need to decide and I'm not in
the mod to argue with him either (got way to much other things to do as
well).
Regards,
Christian.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
2015-05-30 16:46 ` Russell King - ARM Linux
2015-06-01 8:20 ` Christian König
@ 2015-06-02 18:59 ` Mikko Rapeli
1 sibling, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-06-02 18:59 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-kernel, Krzysztof Kozlowski, linux-samsung-soc,
Joonyoung Shim, David Airlie, Seung-Woo Kim, dri-devel, Inki Dae,
Kyungmin Park, Kukjin Kim, linux-api, linux-arm-kernel
On Sat, May 30, 2015 at 05:46:56PM +0100, Russell King - ARM Linux wrote:
> Note that drm/drm.h is all that should need to be included - drm/drm.h
> takes care of including linux/types.h when building on Linux platforms.
> (note: if your compiler doesn't set __linux__ then you're probably not
> using the proper compiler...)
Thanks, I'll fix this by including only drm/drm.h in exynos_drm.h,
nouveau_drm.h, radeon_drm.h and via_drm.h patches.
I'm using standard gcc from Debian for the x86 compilation.
-Mikko
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 10/98] via_drm.h: hide struct via_file_private in userspace
[not found] ` <1433000370-19509-11-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2015-06-03 16:50 ` Emil Velikov
2015-09-02 19:17 ` Mikko Rapeli
0 siblings, 1 reply; 31+ messages in thread
From: Emil Velikov @ 2015-06-03 16:50 UTC (permalink / raw)
To: Mikko Rapeli
Cc: Linux-Kernel@Vger. Kernel. Org, ML dri-devel,
linux-api-u79uwXL29TY76Z2rM5mHXA
Hi Mikko,
On 30 May 2015 at 16:38, Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org> wrote:
> Fixes compiler error since list_head is not exported to userspace headers.
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
> ---
> include/uapi/drm/via_drm.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
> index 791531e..34ce658 100644
> --- a/include/uapi/drm/via_drm.h
> +++ b/include/uapi/drm/via_drm.h
> @@ -272,8 +272,10 @@ typedef struct drm_via_dmablit {
> drm_via_blitsync_t sync;
> } drm_via_dmablit_t;
>
> +#ifdef __KERNEL__
> struct via_file_private {
> struct list_head obj_list;
> };
> +#endif
>
We might want to follow the example of other drivers (i915) and move
it to drivers/gpu/drm/via_drv.h, There are two users of this struct
(via_drv.c and via_mm.c), and each one explicitly includes the header.
How does that sound ?
Same suggestion goes for the equivalent sis patch.
Cheers
Emil
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h
2015-05-30 15:38 ` [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
@ 2015-06-03 17:16 ` Emil Velikov
2015-06-04 11:34 ` Emil Velikov
0 siblings, 1 reply; 31+ messages in thread
From: Emil Velikov @ 2015-06-03 17:16 UTC (permalink / raw)
To: Mikko Rapeli; +Cc: linux-api, Linux-Kernel@Vger. Kernel. Org, ML dri-devel
Hi Mikko,
On 30 May 2015 at 16:38, Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> Fixes compiler error:
>
> drm/via_drm.h:36:27: fatal error: via_drmclient.h: No such file or directory
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
> include/uapi/drm/via_drm.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
> index 8b0533c..791531e 100644
> --- a/include/uapi/drm/via_drm.h
> +++ b/include/uapi/drm/via_drm.h
> @@ -24,6 +24,7 @@
> #ifndef _VIA_DRM_H_
> #define _VIA_DRM_H_
>
> +#include <linux/types.h>
As mentioned elsewhere one could avoid this, and just use drm.h to
manage the approapriate types (uint32_t vs __u32 and so on).
> #include <drm/drm.h>
>
> /* WARNING: These defines must be the same as what the Xserver uses.
> @@ -33,9 +34,6 @@
> #ifndef _VIA_DEFINES_
> #define _VIA_DEFINES_
>
> -#ifndef __KERNEL__
> -#include "via_drmclient.h"
> -#endif
>
I fear that this one is a particular example of a nasty legacy from
the UMS days. The file is available/provided in very old mesa versions
and at the very same time mesa requires via_drm.h. So I would kindly
ask that you:
- Grab the libdrm userspace package, and apply a similar change.
- Rebuild/install the above.
- Fetch mesa 7.11, and try building the via dri module. Ideally
things will continue to build, alternatively we might need to add
another/additional guard for this include.
Thanks
Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t
2015-05-30 15:37 ` [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t Mikko Rapeli
@ 2015-06-03 17:19 ` Emil Velikov
[not found] ` <CACvgo50OLHbvk4scG+pSOW53gR8Ze=yrD4GvbmdE=YRgALjdow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 31+ messages in thread
From: Emil Velikov @ 2015-06-03 17:19 UTC (permalink / raw)
To: Mikko Rapeli; +Cc: linux-api, Linux-Kernel@Vger. Kernel. Org, ML dri-devel
On 30 May 2015 at 16:37, Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> Fixes userspace compilation error:
>
> drm/drm.h:132:2: error: unknown type name ‘size_t’
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
> include/uapi/drm/drm.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index ff6ef62..b197650 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -129,11 +129,11 @@ struct drm_version {
> int version_major; /**< Major version */
> int version_minor; /**< Minor version */
> int version_patchlevel; /**< Patch level */
> - size_t name_len; /**< Length of name buffer */
> + __kernel_size_t name_len; /**< Length of name buffer */
> char __user *name; /**< Name of driver */
> - size_t date_len; /**< Length of date buffer */
> + __kernel_size_t date_len; /**< Length of date buffer */
> char __user *date; /**< User-space buffer to hold date */
> - size_t desc_len; /**< Length of desc buffer */
> + __kernel_size_t desc_len; /**< Length of desc buffer */
> char __user *desc; /**< User-space buffer to hold desc */
> };
>
> @@ -143,7 +143,7 @@ struct drm_version {
> * \sa drmGetBusid() and drmSetBusId().
> */
> struct drm_unique {
> - size_t unique_len; /**< Length of unique */
> + __kernel_size_t unique_len; /**< Length of unique */
As the file is used by other platforms than Linux this change will
break them. Can you add a typedef similar to how __u8 and friends are
handled at the top of the file.
Thanks
Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h
2015-06-03 17:16 ` Emil Velikov
@ 2015-06-04 11:34 ` Emil Velikov
0 siblings, 0 replies; 31+ messages in thread
From: Emil Velikov @ 2015-06-04 11:34 UTC (permalink / raw)
To: Mikko Rapeli; +Cc: linux-api, Linux-Kernel@Vger. Kernel. Org, ML dri-devel
On 3 June 2015 at 18:16, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> Hi Mikko,
>
> On 30 May 2015 at 16:38, Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
>> Fixes compiler error:
>>
>> drm/via_drm.h:36:27: fatal error: via_drmclient.h: No such file or directory
>>
>> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
>> ---
>> include/uapi/drm/via_drm.h | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
>> index 8b0533c..791531e 100644
>> --- a/include/uapi/drm/via_drm.h
>> +++ b/include/uapi/drm/via_drm.h
>> @@ -24,6 +24,7 @@
>> #ifndef _VIA_DRM_H_
>> #define _VIA_DRM_H_
>>
>> +#include <linux/types.h>
> As mentioned elsewhere one could avoid this, and just use drm.h to
> manage the approapriate types (uint32_t vs __u32 and so on).
>
>> #include <drm/drm.h>
>>
>> /* WARNING: These defines must be the same as what the Xserver uses.
>> @@ -33,9 +34,6 @@
>> #ifndef _VIA_DEFINES_
>> #define _VIA_DEFINES_
>>
>> -#ifndef __KERNEL__
>> -#include "via_drmclient.h"
>> -#endif
>>
> I fear that this one is a particular example of a nasty legacy from
> the UMS days. The file is available/provided in very old mesa versions
> and at the very same time mesa requires via_drm.h. So I would kindly
> ask that you:
>
> - Grab the libdrm userspace package, and apply a similar change.
> - Rebuild/install the above.
> - Fetch mesa 7.11, and try building the via dri module. Ideally
> things will continue to build, alternatively we might need to add
> another/additional guard for this include.
>
So the situation is "funnier" than expected:
- There are at least two users of via_drm.h (mesa and xf86-video-via)
with each providing different via_drmclient.h.
- Neither of the two projects includes the latter header, despite
that it uses the macros defined within.
- via_drm.h is included via multiple headers, so adding extra ifdef
guards sounds like a bad idea.
- While new version of the ddx can be released, a mesa one is
unlikely - 7.11.2 was released ~4 years ago.
- Even if we cover the above two project, other projects (how many,
where are they hosted, etc.) may need the same treatment.
With the above said I'd suspect that we're safer leaving the include
as is ? Yes, it is busted if one tries to use the standalone header,
jet (most/all?) official users rely on that behaviour :-\
Cheers
Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t
[not found] ` <CACvgo50OLHbvk4scG+pSOW53gR8Ze=yrD4GvbmdE=YRgALjdow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-08-30 10:42 ` Mikko Rapeli
2015-10-15 6:49 ` Daniel Vetter
1 sibling, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-08-30 10:42 UTC (permalink / raw)
To: Emil Velikov
Cc: Linux-Kernel@Vger. Kernel. Org, ML dri-devel,
linux-api-u79uwXL29TY76Z2rM5mHXA
On Wed, Jun 03, 2015 at 06:19:48PM +0100, Emil Velikov wrote:
> On 30 May 2015 at 16:37, Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org> wrote:
> > Fixes userspace compilation error:
> >
> > drm/drm.h:132:2: error: unknown type name ‘size_t’
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
> > ---
> > include/uapi/drm/drm.h | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> > index ff6ef62..b197650 100644
> > --- a/include/uapi/drm/drm.h
> > +++ b/include/uapi/drm/drm.h
> > @@ -129,11 +129,11 @@ struct drm_version {
> > int version_major; /**< Major version */
> > int version_minor; /**< Minor version */
> > int version_patchlevel; /**< Patch level */
> > - size_t name_len; /**< Length of name buffer */
> > + __kernel_size_t name_len; /**< Length of name buffer */
> > char __user *name; /**< Name of driver */
> > - size_t date_len; /**< Length of date buffer */
> > + __kernel_size_t date_len; /**< Length of date buffer */
> > char __user *date; /**< User-space buffer to hold date */
> > - size_t desc_len; /**< Length of desc buffer */
> > + __kernel_size_t desc_len; /**< Length of desc buffer */
> > char __user *desc; /**< User-space buffer to hold desc */
> > };
> >
> > @@ -143,7 +143,7 @@ struct drm_version {
> > * \sa drmGetBusid() and drmSetBusId().
> > */
> > struct drm_unique {
> > - size_t unique_len; /**< Length of unique */
> > + __kernel_size_t unique_len; /**< Length of unique */
> As the file is used by other platforms than Linux this change will
> break them. Can you add a typedef similar to how __u8 and friends are
> handled at the top of the file.
Yes, I added typedef size_t __kernel_size_t; for other platforms.
-Mikko
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 10/98] via_drm.h: hide struct via_file_private in userspace
2015-06-03 16:50 ` Emil Velikov
@ 2015-09-02 19:17 ` Mikko Rapeli
0 siblings, 0 replies; 31+ messages in thread
From: Mikko Rapeli @ 2015-09-02 19:17 UTC (permalink / raw)
To: Emil Velikov; +Cc: linux-api, Linux-Kernel@Vger. Kernel. Org, ML dri-devel
On Wed, Jun 03, 2015 at 05:50:22PM +0100, Emil Velikov wrote:
> Hi Mikko,
>
> On 30 May 2015 at 16:38, Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> > Fixes compiler error since list_head is not exported to userspace headers.
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> > include/uapi/drm/via_drm.h | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
> > index 791531e..34ce658 100644
> > --- a/include/uapi/drm/via_drm.h
> > +++ b/include/uapi/drm/via_drm.h
> > @@ -272,8 +272,10 @@ typedef struct drm_via_dmablit {
> > drm_via_blitsync_t sync;
> > } drm_via_dmablit_t;
> >
> > +#ifdef __KERNEL__
> > struct via_file_private {
> > struct list_head obj_list;
> > };
> > +#endif
> >
> We might want to follow the example of other drivers (i915) and move
> it to drivers/gpu/drm/via_drv.h, There are two users of this struct
> (via_drv.c and via_mm.c), and each one explicitly includes the header.
> How does that sound ?
>
> Same suggestion goes for the equivalent sis patch.
Thanks, moved both of the file_private definitions to the driver headers.
-Mikko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t
[not found] ` <CACvgo50OLHbvk4scG+pSOW53gR8Ze=yrD4GvbmdE=YRgALjdow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-30 10:42 ` Mikko Rapeli
@ 2015-10-15 6:49 ` Daniel Vetter
1 sibling, 0 replies; 31+ messages in thread
From: Daniel Vetter @ 2015-10-15 6:49 UTC (permalink / raw)
To: Emil Velikov
Cc: Mikko Rapeli, linux-api-u79uwXL29TY76Z2rM5mHXA,
Linux-Kernel@Vger. Kernel. Org, ML dri-devel
On Wed, Jun 03, 2015 at 06:19:48PM +0100, Emil Velikov wrote:
> On 30 May 2015 at 16:37, Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org> wrote:
> > Fixes userspace compilation error:
> >
> > drm/drm.h:132:2: error: unknown type name ‘size_t’
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
> > ---
> > include/uapi/drm/drm.h | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> > index ff6ef62..b197650 100644
> > --- a/include/uapi/drm/drm.h
> > +++ b/include/uapi/drm/drm.h
> > @@ -129,11 +129,11 @@ struct drm_version {
> > int version_major; /**< Major version */
> > int version_minor; /**< Minor version */
> > int version_patchlevel; /**< Patch level */
> > - size_t name_len; /**< Length of name buffer */
> > + __kernel_size_t name_len; /**< Length of name buffer */
> > char __user *name; /**< Name of driver */
> > - size_t date_len; /**< Length of date buffer */
> > + __kernel_size_t date_len; /**< Length of date buffer */
> > char __user *date; /**< User-space buffer to hold date */
> > - size_t desc_len; /**< Length of desc buffer */
> > + __kernel_size_t desc_len; /**< Length of desc buffer */
> > char __user *desc; /**< User-space buffer to hold desc */
> > };
> >
> > @@ -143,7 +143,7 @@ struct drm_version {
> > * \sa drmGetBusid() and drmSetBusId().
> > */
> > struct drm_unique {
> > - size_t unique_len; /**< Length of unique */
> > + __kernel_size_t unique_len; /**< Length of unique */
> As the file is used by other platforms than Linux this change will
> break them. Can you add a typedef similar to how __u8 and friends are
> handled at the top of the file.
This file isn't used by anyone else than Linus since years. All of the
typedefs can be nuked imo.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2015-10-15 6:49 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
2015-05-30 15:37 ` [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-06-03 17:19 ` Emil Velikov
[not found] ` <CACvgo50OLHbvk4scG+pSOW53gR8Ze=yrD4GvbmdE=YRgALjdow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-30 10:42 ` Mikko Rapeli
2015-10-15 6:49 ` Daniel Vetter
2015-05-30 15:37 ` [PATCH 07/98] radeon_drm.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
2015-05-30 15:38 ` [PATCH 08/98] r128_drm.h: include drm/drm.h Mikko Rapeli
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:37 ` [PATCH 04/98] drm_mode.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
[not found] ` <1433000370-19509-5-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 19:58 ` Frans Klaver
2015-05-30 15:37 ` [PATCH 05/98] exynos_drm.h: use " Mikko Rapeli
[not found] ` <1433000370-19509-6-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 16:46 ` Russell King - ARM Linux
2015-06-01 8:20 ` Christian König
[not found] ` <556C15BA.7000909-5C7GfCeVMHo@public.gmane.org>
2015-06-01 8:56 ` Russell King - ARM Linux
[not found] ` <20150601085605.GN2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-06-01 9:08 ` Christian König
2015-06-01 9:14 ` Frans Klaver
[not found] ` <556C2105.2090607-5C7GfCeVMHo@public.gmane.org>
2015-06-01 9:38 ` Russell King - ARM Linux
[not found] ` <20150601093808.GP2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-06-01 9:51 ` Christian König
2015-06-01 9:15 ` Mikko Rapeli
2015-06-02 18:59 ` Mikko Rapeli
2015-05-30 15:37 ` [PATCH 06/98] nouveau_drm.h: use __u32 and " Mikko Rapeli
2015-05-30 15:38 ` [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
2015-06-03 17:16 ` Emil Velikov
2015-06-04 11:34 ` Emil Velikov
2015-05-30 15:38 ` [PATCH 10/98] via_drm.h: hide struct via_file_private in userspace Mikko Rapeli
[not found] ` <1433000370-19509-11-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-06-03 16:50 ` Emil Velikov
2015-09-02 19:17 ` Mikko Rapeli
2015-05-30 15:38 ` [PATCH 12/98] sis_drm.h: hide sis_file_private " Mikko Rapeli
2015-05-30 15:38 ` [PATCH 13/98] drm/i810_drm.h: include drm/drm.h Mikko Rapeli
2015-05-30 15:38 ` [PATCH 11/98] savage_drm.h: include <drm/drm.h> Mikko Rapeli
2015-05-30 15:38 ` [PATCH 14/98] include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h Mikko Rapeli
2015-05-30 15:38 ` [PATCH 15/98] include/uapi/drm/qxl_drm.h: " Mikko Rapeli
2015-05-30 15:38 ` [PATCH 16/98] include/uapi/drm/msm_drm.h: use __s32, __s64, " Mikko Rapeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox