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

2016-03-30 Thread Daniel Vetter
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.

v2: Also annote with __user, as request by Emil&Ilia.

Cc: Ilia Mirkin 
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..7d42d105f32a 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 __user *virt;
+#else
void __user *virtual;   /**< Mmap'd area in user-virtual */
+#endif
struct drm_buf_pub __user *list;/**< Buffer information */
 };

-- 
2.8.0.rc3



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

2016-03-30 Thread Emil Velikov
On 30 March 2016 at 16:12, 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.
>
> v2: Also annote with __user, as request by Emil&Ilia.

Reviewed-by: Emil Velikov 

-Emil


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

2016-03-30 Thread Daniel Vetter
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 */
 };

-- 
2.8.0.rc3



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

2016-03-30 Thread Emil Velikov
On 30 March 2016 at 14:53, Ilia Mirkin  wrote:
> On Wed, Mar 30, 2016 at 9:47 AM, 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;
>
> Shouldn't this also be __user for consistency? (I realize it'll never
> play since the kernel doesn't get built with C++...)
>
Yes please. There is also a bunch of extern C guards that could be
nice, but that's a whole another thing.

-Emil


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

2016-03-30 Thread Ilia Mirkin
On Wed, Mar 30, 2016 at 9:47 AM, 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;

Shouldn't this also be __user for consistency? (I realize it'll never
play since the kernel doesn't get built with C++...)

> +#else
> void __user *virtual;   /**< Mmap'd area in user-virtual */
> +#endif
> struct drm_buf_pub __user *list;/**< Buffer information */
>  };
>
> --
> 2.8.0.rc3
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel