[PATCH 1/2] libdrm: update drm headers from kernel, including new overlay ioctls & structs

2012-02-06 Thread Lan, Hai
To improve the conformability and avoid compiling error with 
libva/intel-driver(expected specifier-qualifier-list before uint32_t),
I think it's better to use __u32 instead of using uint32_t.

Thanks and best regards.
Hai Lan

>  #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
>  #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
>  #define DRM_MODE_FB_DIRTY_FLAGS 0x03
> @@ -346,31 +410,31 @@ struct drm_mode_crtc_page_flip {
> 
>  /* create a dumb scanout buffer */
>  struct drm_mode_create_dumb {
> -__u32 height;
> -__u32 width;
> -__u32 bpp;
> -__u32 flags;
> -/* handle, pitch, size will be returned */
> -__u32 handle;
> -__u32 pitch;
> -__u64 size;
> + uint32_t height;
> + uint32_t width;
> + uint32_t bpp;
> + uint32_t flags;
> + /* handle, pitch, size will be returned */
> + uint32_t handle;
> + uint32_t pitch;
> + uint64_t size;
>  };
> 
>  /* set up for mmap of a dumb scanout buffer */
>  struct drm_mode_map_dumb {
> -/** Handle for the object being mapped. */
> -__u32 handle;
> -__u32 pad;
> -/**
> - * Fake offset to use for subsequent mmap call
> - *
> - * This is a fixed-size type for 32/64 compatibility.
> - */
> -__u64 offset;
> + /** Handle for the object being mapped. */
> + __u32 handle;
> + __u32 pad;
> + /**
> +  * Fake offset to use for subsequent mmap call
> +  *
> +  * This is a fixed-size type for 32/64 compatibility.
> +  */
> + __u64 offset;
>  };
> 
>  struct drm_mode_destroy_dumb {
> - __u32 handle;
> + uint32_t handle;
>  };
> 
>  #endif


RE: [PATCH 1/2] libdrm: update drm headers from kernel, including new overlay ioctls & structs

2012-02-05 Thread Lan, Hai
To improve the conformability and avoid compiling error with 
libva/intel-driver(expected specifier-qualifier-list before uint32_t),
I think it's better to use __u32 instead of using uint32_t.

Thanks and best regards.
Hai Lan

>  #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
>  #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
>  #define DRM_MODE_FB_DIRTY_FLAGS 0x03
> @@ -346,31 +410,31 @@ struct drm_mode_crtc_page_flip {
> 
>  /* create a dumb scanout buffer */
>  struct drm_mode_create_dumb {
> -__u32 height;
> -__u32 width;
> -__u32 bpp;
> -__u32 flags;
> -/* handle, pitch, size will be returned */
> -__u32 handle;
> -__u32 pitch;
> -__u64 size;
> + uint32_t height;
> + uint32_t width;
> + uint32_t bpp;
> + uint32_t flags;
> + /* handle, pitch, size will be returned */
> + uint32_t handle;
> + uint32_t pitch;
> + uint64_t size;
>  };
> 
>  /* set up for mmap of a dumb scanout buffer */
>  struct drm_mode_map_dumb {
> -/** Handle for the object being mapped. */
> -__u32 handle;
> -__u32 pad;
> -/**
> - * Fake offset to use for subsequent mmap call
> - *
> - * This is a fixed-size type for 32/64 compatibility.
> - */
> -__u64 offset;
> + /** Handle for the object being mapped. */
> + __u32 handle;
> + __u32 pad;
> + /**
> +  * Fake offset to use for subsequent mmap call
> +  *
> +  * This is a fixed-size type for 32/64 compatibility.
> +  */
> + __u64 offset;
>  };
> 
>  struct drm_mode_destroy_dumb {
> - __u32 handle;
> + uint32_t handle;
>  };
> 
>  #endif
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/2] libdrm: update drm headers from kernel, including new overlay ioctls & structs

2011-12-06 Thread Jesse Barnes
On Tue,  6 Dec 2011 15:23:57 -0800
Jesse Barnes  wrote:

> Add structs and functions necessary for the new plane and fb handling code,
> including a new header, drm_fourcc.h, that includes the surface formats
> supported by various DRM drivers.
> 
> Signed-off-by: Jesse Barnes 
> ---

Arg some misc other stuff got pulled in... I'll repost with just the
plane stuff.

-- 
Jesse Barnes, Intel Open Source Technology Center


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/2] libdrm: update drm headers from kernel, including new overlay ioctls & structs

2011-12-06 Thread Jesse Barnes
On Tue,  6 Dec 2011 15:23:57 -0800
Jesse Barnes  wrote:

> Add structs and functions necessary for the new plane and fb handling code,
> including a new header, drm_fourcc.h, that includes the surface formats
> supported by various DRM drivers.
> 
> Signed-off-by: Jesse Barnes 
> ---

Arg some misc other stuff got pulled in... I'll repost with just the
plane stuff.

-- 
Jesse Barnes, Intel Open Source Technology Center
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: 



[PATCH 1/2] libdrm: update drm headers from kernel, including new overlay ioctls & structs

2011-12-06 Thread Jesse Barnes
Add structs and functions necessary for the new plane and fb handling code,
including a new header, drm_fourcc.h, that includes the surface formats
supported by various DRM drivers.

Signed-off-by: Jesse Barnes 
---
 include/drm/Makefile.am  |1 +
 include/drm/drm.h|   13 -
 include/drm/drm_fourcc.h |  130 +++
 include/drm/drm_mode.h   |  100 --
 xf86drmMode.c|  153 ++
 xf86drmMode.h|   33 ++
 6 files changed, 411 insertions(+), 19 deletions(-)
 create mode 100644 include/drm/drm_fourcc.h

diff --git a/include/drm/Makefile.am b/include/drm/Makefile.am
index 43695bd..2923ab4 100644
--- a/include/drm/Makefile.am
+++ b/include/drm/Makefile.am
@@ -26,6 +26,7 @@ klibdrmincludedir = ${includedir}/libdrm
 klibdrminclude_HEADERS = \
drm.h \
drm_mode.h \
+   drm_fourcc.h \
drm_sarea.h \
i915_drm.h \
mga_drm.h \
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 5fd24fc..bb2dea8 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -467,12 +467,15 @@ struct drm_irq_busid {
 enum drm_vblank_seq_type {
_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence 
number */
_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
+   /* bits 1-6 are reserved for high crtcs */
+   _DRM_VBLANK_HIGH_CRTC_MASK = 0x003e,
_DRM_VBLANK_EVENT = 0x400,   /**< Send event instead of blocking */
_DRM_VBLANK_FLIP = 0x800,   /**< Scheduled buffer swap should flip 
*/
_DRM_VBLANK_NEXTONMISS = 0x1000,/**< If missed, wait for next 
vblank */
_DRM_VBLANK_SECONDARY = 0x2000, /**< Secondary display 
controller */
_DRM_VBLANK_SIGNAL = 0x4000 /**< Send signal instead of blocking, 
unsupported */
 };
+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1
 
 #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
 #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
@@ -674,6 +677,8 @@ struct drm_get_cap {
 #define DRM_IOCTL_UNLOCK   DRM_IOW( 0x2b, struct drm_lock)
 #define DRM_IOCTL_FINISH   DRM_IOW( 0x2c, struct drm_lock)
 
+#define DRM_IOCTL_GEM_PRIME_OPENDRM_IOWR(0x2e, struct drm_gem_open)
+
 #define DRM_IOCTL_AGP_ACQUIRE  DRM_IO(  0x30)
 #define DRM_IOCTL_AGP_RELEASE  DRM_IO(  0x31)
 #define DRM_IOCTL_AGP_ENABLE   DRM_IOW( 0x32, struct drm_agp_mode)
@@ -713,6 +718,10 @@ struct drm_get_cap {
 #define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
 #define DRM_IOCTL_MODE_MAP_DUMBDRM_IOWR(0xB3, struct drm_mode_map_dumb)
 #define DRM_IOCTL_MODE_DESTROY_DUMBDRM_IOWR(0xB4, struct 
drm_mode_destroy_dumb)
+#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct 
drm_mode_get_plane_res)
+#define DRM_IOCTL_MODE_GETPLANEDRM_IOWR(0xB6, struct 
drm_mode_get_plane)
+#define DRM_IOCTL_MODE_SETPLANEDRM_IOWR(0xB7, struct 
drm_mode_set_plane)
+#define DRM_IOCTL_MODE_ADDFB2  DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
 
 /**
  * Device specific ioctls should only be in their respective headers
@@ -755,9 +764,10 @@ struct drm_event_vblank {
 };
 
 #define DRM_CAP_DUMB_BUFFER 0x1
-#define DRM_CAP_VBLANK_HIGH_CRTC   0x2
+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
 
 /* typedef area */
+#ifndef __KERNEL__
 typedef struct drm_clip_rect drm_clip_rect_t;
 typedef struct drm_drawable_info drm_drawable_info_t;
 typedef struct drm_tex_region drm_tex_region_t;
@@ -799,5 +809,6 @@ typedef struct drm_agp_binding drm_agp_binding_t;
 typedef struct drm_agp_info drm_agp_info_t;
 typedef struct drm_scatter_gather drm_scatter_gather_t;
 typedef struct drm_set_version drm_set_version_t;
+#endif
 
 #endif
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
new file mode 100644
index 000..b1107cb
--- /dev/null
+++ b/include/drm/drm_fourcc.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABL

[PATCH 1/2] libdrm: update drm headers from kernel, including new overlay ioctls & structs

2011-12-06 Thread Jesse Barnes
Add structs and functions necessary for the new plane and fb handling code,
including a new header, drm_fourcc.h, that includes the surface formats
supported by various DRM drivers.

Signed-off-by: Jesse Barnes 
---
 include/drm/Makefile.am  |1 +
 include/drm/drm.h|   13 -
 include/drm/drm_fourcc.h |  130 +++
 include/drm/drm_mode.h   |  100 --
 xf86drmMode.c|  153 ++
 xf86drmMode.h|   33 ++
 6 files changed, 411 insertions(+), 19 deletions(-)
 create mode 100644 include/drm/drm_fourcc.h

diff --git a/include/drm/Makefile.am b/include/drm/Makefile.am
index 43695bd..2923ab4 100644
--- a/include/drm/Makefile.am
+++ b/include/drm/Makefile.am
@@ -26,6 +26,7 @@ klibdrmincludedir = ${includedir}/libdrm
 klibdrminclude_HEADERS = \
drm.h \
drm_mode.h \
+   drm_fourcc.h \
drm_sarea.h \
i915_drm.h \
mga_drm.h \
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 5fd24fc..bb2dea8 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -467,12 +467,15 @@ struct drm_irq_busid {
 enum drm_vblank_seq_type {
_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence 
number */
_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
+   /* bits 1-6 are reserved for high crtcs */
+   _DRM_VBLANK_HIGH_CRTC_MASK = 0x003e,
_DRM_VBLANK_EVENT = 0x400,   /**< Send event instead of blocking */
_DRM_VBLANK_FLIP = 0x800,   /**< Scheduled buffer swap should flip 
*/
_DRM_VBLANK_NEXTONMISS = 0x1000,/**< If missed, wait for next 
vblank */
_DRM_VBLANK_SECONDARY = 0x2000, /**< Secondary display 
controller */
_DRM_VBLANK_SIGNAL = 0x4000 /**< Send signal instead of blocking, 
unsupported */
 };
+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1

 #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
 #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
@@ -674,6 +677,8 @@ struct drm_get_cap {
 #define DRM_IOCTL_UNLOCK   DRM_IOW( 0x2b, struct drm_lock)
 #define DRM_IOCTL_FINISH   DRM_IOW( 0x2c, struct drm_lock)

+#define DRM_IOCTL_GEM_PRIME_OPENDRM_IOWR(0x2e, struct drm_gem_open)
+
 #define DRM_IOCTL_AGP_ACQUIRE  DRM_IO(  0x30)
 #define DRM_IOCTL_AGP_RELEASE  DRM_IO(  0x31)
 #define DRM_IOCTL_AGP_ENABLE   DRM_IOW( 0x32, struct drm_agp_mode)
@@ -713,6 +718,10 @@ struct drm_get_cap {
 #define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
 #define DRM_IOCTL_MODE_MAP_DUMBDRM_IOWR(0xB3, struct drm_mode_map_dumb)
 #define DRM_IOCTL_MODE_DESTROY_DUMBDRM_IOWR(0xB4, struct 
drm_mode_destroy_dumb)
+#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct 
drm_mode_get_plane_res)
+#define DRM_IOCTL_MODE_GETPLANEDRM_IOWR(0xB6, struct 
drm_mode_get_plane)
+#define DRM_IOCTL_MODE_SETPLANEDRM_IOWR(0xB7, struct 
drm_mode_set_plane)
+#define DRM_IOCTL_MODE_ADDFB2  DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)

 /**
  * Device specific ioctls should only be in their respective headers
@@ -755,9 +764,10 @@ struct drm_event_vblank {
 };

 #define DRM_CAP_DUMB_BUFFER 0x1
-#define DRM_CAP_VBLANK_HIGH_CRTC   0x2
+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2

 /* typedef area */
+#ifndef __KERNEL__
 typedef struct drm_clip_rect drm_clip_rect_t;
 typedef struct drm_drawable_info drm_drawable_info_t;
 typedef struct drm_tex_region drm_tex_region_t;
@@ -799,5 +809,6 @@ typedef struct drm_agp_binding drm_agp_binding_t;
 typedef struct drm_agp_info drm_agp_info_t;
 typedef struct drm_scatter_gather drm_scatter_gather_t;
 typedef struct drm_set_version drm_set_version_t;
+#endif

 #endif
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
new file mode 100644
index 000..b1107cb
--- /dev/null
+++ b/include/drm/drm_fourcc.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR