Re: [Intel-gfx] [PATCH i-g-t 2/4] v3d: Import the V3D DRM UAPI header.

2018-11-21 Thread Petri Latvala
On Wed, Nov 14, 2018 at 02:28:30PM -0800, Eric Anholt wrote:
> Copied from make headers_install at drm-misc-next 783195ec1cad
> ("drm/syncobj: disable the timeline UAPI for now v2")
> 
> Signed-off-by: Eric Anholt 

Acked-by: Petri Latvala 


> ---
>  include/drm-uapi/v3d_drm.h | 204 +
>  1 file changed, 204 insertions(+)
>  create mode 100644 include/drm-uapi/v3d_drm.h
> 
> diff --git a/include/drm-uapi/v3d_drm.h b/include/drm-uapi/v3d_drm.h
> new file mode 100644
> index ..f446656d00b1
> --- /dev/null
> +++ b/include/drm-uapi/v3d_drm.h
> @@ -0,0 +1,204 @@
> +/*
> + * Copyright © 2014-2018 Broadcom
> + *
> + * 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
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +#ifndef _V3D_DRM_H_
> +#define _V3D_DRM_H_
> +
> +#include "drm.h"
> +
> +#if defined(__cplusplus)
> +extern "C" {
> +#endif
> +
> +#define DRM_V3D_SUBMIT_CL 0x00
> +#define DRM_V3D_WAIT_BO   0x01
> +#define DRM_V3D_CREATE_BO 0x02
> +#define DRM_V3D_MMAP_BO   0x03
> +#define DRM_V3D_GET_PARAM 0x04
> +#define DRM_V3D_GET_BO_OFFSET 0x05
> +
> +#define DRM_IOCTL_V3D_SUBMIT_CL   DRM_IOWR(DRM_COMMAND_BASE + 
> DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
> +#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + 
> DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
> +#define DRM_IOCTL_V3D_CREATE_BO   DRM_IOWR(DRM_COMMAND_BASE + 
> DRM_V3D_CREATE_BO, struct drm_v3d_create_bo)
> +#define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + 
> DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
> +#define DRM_IOCTL_V3D_GET_PARAM   DRM_IOWR(DRM_COMMAND_BASE + 
> DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
> +#define DRM_IOCTL_V3D_GET_BO_OFFSET   DRM_IOWR(DRM_COMMAND_BASE + 
> DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
> +
> +/**
> + * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 
> 3D
> + * engine.
> + *
> + * This asks the kernel to have the GPU execute an optional binner
> + * command list, and a render command list.
> + */
> +struct drm_v3d_submit_cl {
> + /* Pointer to the binner command list.
> +  *
> +  * This is the first set of commands executed, which runs the
> +  * coordinate shader to determine where primitives land on the screen,
> +  * then writes out the state updates and draw calls necessary per tile
> +  * to the tile allocation BO.
> +  *
> +  * This BCL will block on any previous BCL submitted on the
> +  * same FD, but not on any RCL or BCLs submitted by other
> +  * clients -- that is left up to the submitter to control
> +  * using in_sync_bcl if necessary.
> +  */
> + __u32 bcl_start;
> +
> +  /** End address of the BCL (first byte after the BCL) */
> + __u32 bcl_end;
> +
> + /* Offset of the render command list.
> +  *
> +  * This is the second set of commands executed, which will either
> +  * execute the tiles that have been set up by the BCL, or a fixed set
> +  * of tiles (in the case of RCL-only blits).
> +  *
> +  * This RCL will block on this submit's BCL, and any previous
> +  * RCL submitted on the same FD, but not on any RCL or BCLs
> +  * submitted by other clients -- that is left up to the
> +  * submitter to control using in_sync_rcl if necessary.
> +  */
> + __u32 rcl_start;
> +
> +  /** End address of the RCL (first byte after the RCL) */
> + __u32 rcl_end;
> +
> + /** An optional sync object to wait on before starting the BCL. */
> + __u32 in_sync_bcl;
> + /** An optional sync object to wait on before starting the RCL. */
> + __u32 in_sync_rcl;
> + /** An optional sync object to place the completion fence in. */
> + __u32 

[Intel-gfx] [PATCH i-g-t 2/4] v3d: Import the V3D DRM UAPI header.

2018-11-14 Thread Eric Anholt
Copied from make headers_install at drm-misc-next 783195ec1cad
("drm/syncobj: disable the timeline UAPI for now v2")

Signed-off-by: Eric Anholt 
---
 include/drm-uapi/v3d_drm.h | 204 +
 1 file changed, 204 insertions(+)
 create mode 100644 include/drm-uapi/v3d_drm.h

diff --git a/include/drm-uapi/v3d_drm.h b/include/drm-uapi/v3d_drm.h
new file mode 100644
index ..f446656d00b1
--- /dev/null
+++ b/include/drm-uapi/v3d_drm.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright © 2014-2018 Broadcom
+ *
+ * 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
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef _V3D_DRM_H_
+#define _V3D_DRM_H_
+
+#include "drm.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define DRM_V3D_SUBMIT_CL 0x00
+#define DRM_V3D_WAIT_BO   0x01
+#define DRM_V3D_CREATE_BO 0x02
+#define DRM_V3D_MMAP_BO   0x03
+#define DRM_V3D_GET_PARAM 0x04
+#define DRM_V3D_GET_BO_OFFSET 0x05
+
+#define DRM_IOCTL_V3D_SUBMIT_CL   DRM_IOWR(DRM_COMMAND_BASE + 
DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
+#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + 
DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
+#define DRM_IOCTL_V3D_CREATE_BO   DRM_IOWR(DRM_COMMAND_BASE + 
DRM_V3D_CREATE_BO, struct drm_v3d_create_bo)
+#define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + 
DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
+#define DRM_IOCTL_V3D_GET_PARAM   DRM_IOWR(DRM_COMMAND_BASE + 
DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
+#define DRM_IOCTL_V3D_GET_BO_OFFSET   DRM_IOWR(DRM_COMMAND_BASE + 
DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
+
+/**
+ * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
+ * engine.
+ *
+ * This asks the kernel to have the GPU execute an optional binner
+ * command list, and a render command list.
+ */
+struct drm_v3d_submit_cl {
+   /* Pointer to the binner command list.
+*
+* This is the first set of commands executed, which runs the
+* coordinate shader to determine where primitives land on the screen,
+* then writes out the state updates and draw calls necessary per tile
+* to the tile allocation BO.
+*
+* This BCL will block on any previous BCL submitted on the
+* same FD, but not on any RCL or BCLs submitted by other
+* clients -- that is left up to the submitter to control
+* using in_sync_bcl if necessary.
+*/
+   __u32 bcl_start;
+
+/** End address of the BCL (first byte after the BCL) */
+   __u32 bcl_end;
+
+   /* Offset of the render command list.
+*
+* This is the second set of commands executed, which will either
+* execute the tiles that have been set up by the BCL, or a fixed set
+* of tiles (in the case of RCL-only blits).
+*
+* This RCL will block on this submit's BCL, and any previous
+* RCL submitted on the same FD, but not on any RCL or BCLs
+* submitted by other clients -- that is left up to the
+* submitter to control using in_sync_rcl if necessary.
+*/
+   __u32 rcl_start;
+
+/** End address of the RCL (first byte after the RCL) */
+   __u32 rcl_end;
+
+   /** An optional sync object to wait on before starting the BCL. */
+   __u32 in_sync_bcl;
+   /** An optional sync object to wait on before starting the RCL. */
+   __u32 in_sync_rcl;
+   /** An optional sync object to place the completion fence in. */
+   __u32 out_sync;
+
+   /* Offset of the tile alloc memory
+*
+* This is optional on V3D 3.3 (where the CL can set the value) but
+* required on V3D 4.1.
+*/
+   __u32 qma;
+
+   /** Size of the tile alloc memory. */
+