Home | History | Annotate | Line # | Download | only in drm
      1  1.1  riastrad /*	$NetBSD: tegra_drm.h,v 1.2 2021/12/18 23:45:46 riastradh Exp $	*/
      2  1.1  riastrad 
      3  1.1  riastrad /*
      4  1.1  riastrad  * Copyright (c) 2012-2013, NVIDIA CORPORATION.  All rights reserved.
      5  1.1  riastrad  *
      6  1.1  riastrad  * Permission is hereby granted, free of charge, to any person obtaining a
      7  1.1  riastrad  * copy of this software and associated documentation files (the "Software"),
      8  1.1  riastrad  * to deal in the Software without restriction, including without limitation
      9  1.1  riastrad  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     10  1.1  riastrad  * and/or sell copies of the Software, and to permit persons to whom the
     11  1.1  riastrad  * Software is furnished to do so, subject to the following conditions:
     12  1.1  riastrad  *
     13  1.1  riastrad  * The above copyright notice and this permission notice shall be included in
     14  1.1  riastrad  * all copies or substantial portions of the Software.
     15  1.1  riastrad  *
     16  1.1  riastrad  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  1.1  riastrad  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  1.1  riastrad  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     19  1.1  riastrad  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
     20  1.1  riastrad  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     21  1.1  riastrad  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     22  1.1  riastrad  * OTHER DEALINGS IN THE SOFTWARE.
     23  1.1  riastrad  */
     24  1.1  riastrad 
     25  1.1  riastrad #ifndef _UAPI_TEGRA_DRM_H_
     26  1.1  riastrad #define _UAPI_TEGRA_DRM_H_
     27  1.1  riastrad 
     28  1.1  riastrad #include "drm.h"
     29  1.1  riastrad 
     30  1.1  riastrad #if defined(__cplusplus)
     31  1.1  riastrad extern "C" {
     32  1.1  riastrad #endif
     33  1.1  riastrad 
     34  1.1  riastrad #define DRM_TEGRA_GEM_CREATE_TILED     (1 << 0)
     35  1.1  riastrad #define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
     36  1.1  riastrad 
     37  1.1  riastrad /**
     38  1.1  riastrad  * struct drm_tegra_gem_create - parameters for the GEM object creation IOCTL
     39  1.1  riastrad  */
     40  1.1  riastrad struct drm_tegra_gem_create {
     41  1.1  riastrad 	/**
     42  1.1  riastrad 	 * @size:
     43  1.1  riastrad 	 *
     44  1.1  riastrad 	 * The size, in bytes, of the buffer object to be created.
     45  1.1  riastrad 	 */
     46  1.1  riastrad 	__u64 size;
     47  1.1  riastrad 
     48  1.1  riastrad 	/**
     49  1.1  riastrad 	 * @flags:
     50  1.1  riastrad 	 *
     51  1.1  riastrad 	 * A bitmask of flags that influence the creation of GEM objects:
     52  1.1  riastrad 	 *
     53  1.1  riastrad 	 * DRM_TEGRA_GEM_CREATE_TILED
     54  1.1  riastrad 	 *   Use the 16x16 tiling format for this buffer.
     55  1.1  riastrad 	 *
     56  1.1  riastrad 	 * DRM_TEGRA_GEM_CREATE_BOTTOM_UP
     57  1.1  riastrad 	 *   The buffer has a bottom-up layout.
     58  1.1  riastrad 	 */
     59  1.1  riastrad 	__u32 flags;
     60  1.1  riastrad 
     61  1.1  riastrad 	/**
     62  1.1  riastrad 	 * @handle:
     63  1.1  riastrad 	 *
     64  1.1  riastrad 	 * The handle of the created GEM object. Set by the kernel upon
     65  1.1  riastrad 	 * successful completion of the IOCTL.
     66  1.1  riastrad 	 */
     67  1.1  riastrad 	__u32 handle;
     68  1.1  riastrad };
     69  1.1  riastrad 
     70  1.1  riastrad /**
     71  1.1  riastrad  * struct drm_tegra_gem_mmap - parameters for the GEM mmap IOCTL
     72  1.1  riastrad  */
     73  1.1  riastrad struct drm_tegra_gem_mmap {
     74  1.1  riastrad 	/**
     75  1.1  riastrad 	 * @handle:
     76  1.1  riastrad 	 *
     77  1.1  riastrad 	 * Handle of the GEM object to obtain an mmap offset for.
     78  1.1  riastrad 	 */
     79  1.1  riastrad 	__u32 handle;
     80  1.1  riastrad 
     81  1.1  riastrad 	/**
     82  1.1  riastrad 	 * @pad:
     83  1.1  riastrad 	 *
     84  1.1  riastrad 	 * Structure padding that may be used in the future. Must be 0.
     85  1.1  riastrad 	 */
     86  1.1  riastrad 	__u32 pad;
     87  1.1  riastrad 
     88  1.1  riastrad 	/**
     89  1.1  riastrad 	 * @offset:
     90  1.1  riastrad 	 *
     91  1.1  riastrad 	 * The mmap offset for the given GEM object. Set by the kernel upon
     92  1.1  riastrad 	 * successful completion of the IOCTL.
     93  1.1  riastrad 	 */
     94  1.1  riastrad 	__u64 offset;
     95  1.1  riastrad };
     96  1.1  riastrad 
     97  1.1  riastrad /**
     98  1.1  riastrad  * struct drm_tegra_syncpt_read - parameters for the read syncpoint IOCTL
     99  1.1  riastrad  */
    100  1.1  riastrad struct drm_tegra_syncpt_read {
    101  1.1  riastrad 	/**
    102  1.1  riastrad 	 * @id:
    103  1.1  riastrad 	 *
    104  1.1  riastrad 	 * ID of the syncpoint to read the current value from.
    105  1.1  riastrad 	 */
    106  1.1  riastrad 	__u32 id;
    107  1.1  riastrad 
    108  1.1  riastrad 	/**
    109  1.1  riastrad 	 * @value:
    110  1.1  riastrad 	 *
    111  1.1  riastrad 	 * The current syncpoint value. Set by the kernel upon successful
    112  1.1  riastrad 	 * completion of the IOCTL.
    113  1.1  riastrad 	 */
    114  1.1  riastrad 	__u32 value;
    115  1.1  riastrad };
    116  1.1  riastrad 
    117  1.1  riastrad /**
    118  1.1  riastrad  * struct drm_tegra_syncpt_incr - parameters for the increment syncpoint IOCTL
    119  1.1  riastrad  */
    120  1.1  riastrad struct drm_tegra_syncpt_incr {
    121  1.1  riastrad 	/**
    122  1.1  riastrad 	 * @id:
    123  1.1  riastrad 	 *
    124  1.1  riastrad 	 * ID of the syncpoint to increment.
    125  1.1  riastrad 	 */
    126  1.1  riastrad 	__u32 id;
    127  1.1  riastrad 
    128  1.1  riastrad 	/**
    129  1.1  riastrad 	 * @pad:
    130  1.1  riastrad 	 *
    131  1.1  riastrad 	 * Structure padding that may be used in the future. Must be 0.
    132  1.1  riastrad 	 */
    133  1.1  riastrad 	__u32 pad;
    134  1.1  riastrad };
    135  1.1  riastrad 
    136  1.1  riastrad /**
    137  1.1  riastrad  * struct drm_tegra_syncpt_wait - parameters for the wait syncpoint IOCTL
    138  1.1  riastrad  */
    139  1.1  riastrad struct drm_tegra_syncpt_wait {
    140  1.1  riastrad 	/**
    141  1.1  riastrad 	 * @id:
    142  1.1  riastrad 	 *
    143  1.1  riastrad 	 * ID of the syncpoint to wait on.
    144  1.1  riastrad 	 */
    145  1.1  riastrad 	__u32 id;
    146  1.1  riastrad 
    147  1.1  riastrad 	/**
    148  1.1  riastrad 	 * @thresh:
    149  1.1  riastrad 	 *
    150  1.1  riastrad 	 * Threshold value for which to wait.
    151  1.1  riastrad 	 */
    152  1.1  riastrad 	__u32 thresh;
    153  1.1  riastrad 
    154  1.1  riastrad 	/**
    155  1.1  riastrad 	 * @timeout:
    156  1.1  riastrad 	 *
    157  1.1  riastrad 	 * Timeout, in milliseconds, to wait.
    158  1.1  riastrad 	 */
    159  1.1  riastrad 	__u32 timeout;
    160  1.1  riastrad 
    161  1.1  riastrad 	/**
    162  1.1  riastrad 	 * @value:
    163  1.1  riastrad 	 *
    164  1.1  riastrad 	 * The new syncpoint value after the wait. Set by the kernel upon
    165  1.1  riastrad 	 * successful completion of the IOCTL.
    166  1.1  riastrad 	 */
    167  1.1  riastrad 	__u32 value;
    168  1.1  riastrad };
    169  1.1  riastrad 
    170  1.1  riastrad #define DRM_TEGRA_NO_TIMEOUT	(0xffffffff)
    171  1.1  riastrad 
    172  1.1  riastrad /**
    173  1.1  riastrad  * struct drm_tegra_open_channel - parameters for the open channel IOCTL
    174  1.1  riastrad  */
    175  1.1  riastrad struct drm_tegra_open_channel {
    176  1.1  riastrad 	/**
    177  1.1  riastrad 	 * @client:
    178  1.1  riastrad 	 *
    179  1.1  riastrad 	 * The client ID for this channel.
    180  1.1  riastrad 	 */
    181  1.1  riastrad 	__u32 client;
    182  1.1  riastrad 
    183  1.1  riastrad 	/**
    184  1.1  riastrad 	 * @pad:
    185  1.1  riastrad 	 *
    186  1.1  riastrad 	 * Structure padding that may be used in the future. Must be 0.
    187  1.1  riastrad 	 */
    188  1.1  riastrad 	__u32 pad;
    189  1.1  riastrad 
    190  1.1  riastrad 	/**
    191  1.1  riastrad 	 * @context:
    192  1.1  riastrad 	 *
    193  1.1  riastrad 	 * The application context of this channel. Set by the kernel upon
    194  1.1  riastrad 	 * successful completion of the IOCTL. This context needs to be passed
    195  1.1  riastrad 	 * to the DRM_TEGRA_CHANNEL_CLOSE or the DRM_TEGRA_SUBMIT IOCTLs.
    196  1.1  riastrad 	 */
    197  1.1  riastrad 	__u64 context;
    198  1.1  riastrad };
    199  1.1  riastrad 
    200  1.1  riastrad /**
    201  1.1  riastrad  * struct drm_tegra_close_channel - parameters for the close channel IOCTL
    202  1.1  riastrad  */
    203  1.1  riastrad struct drm_tegra_close_channel {
    204  1.1  riastrad 	/**
    205  1.1  riastrad 	 * @context:
    206  1.1  riastrad 	 *
    207  1.1  riastrad 	 * The application context of this channel. This is obtained from the
    208  1.1  riastrad 	 * DRM_TEGRA_OPEN_CHANNEL IOCTL.
    209  1.1  riastrad 	 */
    210  1.1  riastrad 	__u64 context;
    211  1.1  riastrad };
    212  1.1  riastrad 
    213  1.1  riastrad /**
    214  1.1  riastrad  * struct drm_tegra_get_syncpt - parameters for the get syncpoint IOCTL
    215  1.1  riastrad  */
    216  1.1  riastrad struct drm_tegra_get_syncpt {
    217  1.1  riastrad 	/**
    218  1.1  riastrad 	 * @context:
    219  1.1  riastrad 	 *
    220  1.1  riastrad 	 * The application context identifying the channel for which to obtain
    221  1.1  riastrad 	 * the syncpoint ID.
    222  1.1  riastrad 	 */
    223  1.1  riastrad 	__u64 context;
    224  1.1  riastrad 
    225  1.1  riastrad 	/**
    226  1.1  riastrad 	 * @index:
    227  1.1  riastrad 	 *
    228  1.1  riastrad 	 * Index of the client syncpoint for which to obtain the ID.
    229  1.1  riastrad 	 */
    230  1.1  riastrad 	__u32 index;
    231  1.1  riastrad 
    232  1.1  riastrad 	/**
    233  1.1  riastrad 	 * @id:
    234  1.1  riastrad 	 *
    235  1.1  riastrad 	 * The ID of the given syncpoint. Set by the kernel upon successful
    236  1.1  riastrad 	 * completion of the IOCTL.
    237  1.1  riastrad 	 */
    238  1.1  riastrad 	__u32 id;
    239  1.1  riastrad };
    240  1.1  riastrad 
    241  1.1  riastrad /**
    242  1.1  riastrad  * struct drm_tegra_get_syncpt_base - parameters for the get wait base IOCTL
    243  1.1  riastrad  */
    244  1.1  riastrad struct drm_tegra_get_syncpt_base {
    245  1.1  riastrad 	/**
    246  1.1  riastrad 	 * @context:
    247  1.1  riastrad 	 *
    248  1.1  riastrad 	 * The application context identifying for which channel to obtain the
    249  1.1  riastrad 	 * wait base.
    250  1.1  riastrad 	 */
    251  1.1  riastrad 	__u64 context;
    252  1.1  riastrad 
    253  1.1  riastrad 	/**
    254  1.1  riastrad 	 * @syncpt:
    255  1.1  riastrad 	 *
    256  1.1  riastrad 	 * ID of the syncpoint for which to obtain the wait base.
    257  1.1  riastrad 	 */
    258  1.1  riastrad 	__u32 syncpt;
    259  1.1  riastrad 
    260  1.1  riastrad 	/**
    261  1.1  riastrad 	 * @id:
    262  1.1  riastrad 	 *
    263  1.1  riastrad 	 * The ID of the wait base corresponding to the client syncpoint. Set
    264  1.1  riastrad 	 * by the kernel upon successful completion of the IOCTL.
    265  1.1  riastrad 	 */
    266  1.1  riastrad 	__u32 id;
    267  1.1  riastrad };
    268  1.1  riastrad 
    269  1.1  riastrad /**
    270  1.1  riastrad  * struct drm_tegra_syncpt - syncpoint increment operation
    271  1.1  riastrad  */
    272  1.1  riastrad struct drm_tegra_syncpt {
    273  1.1  riastrad 	/**
    274  1.1  riastrad 	 * @id:
    275  1.1  riastrad 	 *
    276  1.1  riastrad 	 * ID of the syncpoint to operate on.
    277  1.1  riastrad 	 */
    278  1.1  riastrad 	__u32 id;
    279  1.1  riastrad 
    280  1.1  riastrad 	/**
    281  1.1  riastrad 	 * @incrs:
    282  1.1  riastrad 	 *
    283  1.1  riastrad 	 * Number of increments to perform for the syncpoint.
    284  1.1  riastrad 	 */
    285  1.1  riastrad 	__u32 incrs;
    286  1.1  riastrad };
    287  1.1  riastrad 
    288  1.1  riastrad /**
    289  1.1  riastrad  * struct drm_tegra_cmdbuf - structure describing a command buffer
    290  1.1  riastrad  */
    291  1.1  riastrad struct drm_tegra_cmdbuf {
    292  1.1  riastrad 	/**
    293  1.1  riastrad 	 * @handle:
    294  1.1  riastrad 	 *
    295  1.1  riastrad 	 * Handle to a GEM object containing the command buffer.
    296  1.1  riastrad 	 */
    297  1.1  riastrad 	__u32 handle;
    298  1.1  riastrad 
    299  1.1  riastrad 	/**
    300  1.1  riastrad 	 * @offset:
    301  1.1  riastrad 	 *
    302  1.1  riastrad 	 * Offset, in bytes, into the GEM object identified by @handle at
    303  1.1  riastrad 	 * which the command buffer starts.
    304  1.1  riastrad 	 */
    305  1.1  riastrad 	__u32 offset;
    306  1.1  riastrad 
    307  1.1  riastrad 	/**
    308  1.1  riastrad 	 * @words:
    309  1.1  riastrad 	 *
    310  1.1  riastrad 	 * Number of 32-bit words in this command buffer.
    311  1.1  riastrad 	 */
    312  1.1  riastrad 	__u32 words;
    313  1.1  riastrad 
    314  1.1  riastrad 	/**
    315  1.1  riastrad 	 * @pad:
    316  1.1  riastrad 	 *
    317  1.1  riastrad 	 * Structure padding that may be used in the future. Must be 0.
    318  1.1  riastrad 	 */
    319  1.1  riastrad 	__u32 pad;
    320  1.1  riastrad };
    321  1.1  riastrad 
    322  1.1  riastrad /**
    323  1.1  riastrad  * struct drm_tegra_reloc - GEM object relocation structure
    324  1.1  riastrad  */
    325  1.1  riastrad struct drm_tegra_reloc {
    326  1.1  riastrad 	struct {
    327  1.1  riastrad 		/**
    328  1.1  riastrad 		 * @cmdbuf.handle:
    329  1.1  riastrad 		 *
    330  1.1  riastrad 		 * Handle to the GEM object containing the command buffer for
    331  1.1  riastrad 		 * which to perform this GEM object relocation.
    332  1.1  riastrad 		 */
    333  1.1  riastrad 		__u32 handle;
    334  1.1  riastrad 
    335  1.1  riastrad 		/**
    336  1.1  riastrad 		 * @cmdbuf.offset:
    337  1.1  riastrad 		 *
    338  1.1  riastrad 		 * Offset, in bytes, into the command buffer at which to
    339  1.1  riastrad 		 * insert the relocated address.
    340  1.1  riastrad 		 */
    341  1.1  riastrad 		__u32 offset;
    342  1.1  riastrad 	} cmdbuf;
    343  1.1  riastrad 	struct {
    344  1.1  riastrad 		/**
    345  1.1  riastrad 		 * @target.handle:
    346  1.1  riastrad 		 *
    347  1.1  riastrad 		 * Handle to the GEM object to be relocated.
    348  1.1  riastrad 		 */
    349  1.1  riastrad 		__u32 handle;
    350  1.1  riastrad 
    351  1.1  riastrad 		/**
    352  1.1  riastrad 		 * @target.offset:
    353  1.1  riastrad 		 *
    354  1.1  riastrad 		 * Offset, in bytes, into the target GEM object at which the
    355  1.1  riastrad 		 * relocated data starts.
    356  1.1  riastrad 		 */
    357  1.1  riastrad 		__u32 offset;
    358  1.1  riastrad 	} target;
    359  1.1  riastrad 
    360  1.1  riastrad 	/**
    361  1.1  riastrad 	 * @shift:
    362  1.1  riastrad 	 *
    363  1.1  riastrad 	 * The number of bits by which to shift relocated addresses.
    364  1.1  riastrad 	 */
    365  1.1  riastrad 	__u32 shift;
    366  1.1  riastrad 
    367  1.1  riastrad 	/**
    368  1.1  riastrad 	 * @pad:
    369  1.1  riastrad 	 *
    370  1.1  riastrad 	 * Structure padding that may be used in the future. Must be 0.
    371  1.1  riastrad 	 */
    372  1.1  riastrad 	__u32 pad;
    373  1.1  riastrad };
    374  1.1  riastrad 
    375  1.1  riastrad /**
    376  1.1  riastrad  * struct drm_tegra_waitchk - wait check structure
    377  1.1  riastrad  */
    378  1.1  riastrad struct drm_tegra_waitchk {
    379  1.1  riastrad 	/**
    380  1.1  riastrad 	 * @handle:
    381  1.1  riastrad 	 *
    382  1.1  riastrad 	 * Handle to the GEM object containing a command stream on which to
    383  1.1  riastrad 	 * perform the wait check.
    384  1.1  riastrad 	 */
    385  1.1  riastrad 	__u32 handle;
    386  1.1  riastrad 
    387  1.1  riastrad 	/**
    388  1.1  riastrad 	 * @offset:
    389  1.1  riastrad 	 *
    390  1.1  riastrad 	 * Offset, in bytes, of the location in the command stream to perform
    391  1.1  riastrad 	 * the wait check on.
    392  1.1  riastrad 	 */
    393  1.1  riastrad 	__u32 offset;
    394  1.1  riastrad 
    395  1.1  riastrad 	/**
    396  1.1  riastrad 	 * @syncpt:
    397  1.1  riastrad 	 *
    398  1.1  riastrad 	 * ID of the syncpoint to wait check.
    399  1.1  riastrad 	 */
    400  1.1  riastrad 	__u32 syncpt;
    401  1.1  riastrad 
    402  1.1  riastrad 	/**
    403  1.1  riastrad 	 * @thresh:
    404  1.1  riastrad 	 *
    405  1.1  riastrad 	 * Threshold value for which to check.
    406  1.1  riastrad 	 */
    407  1.1  riastrad 	__u32 thresh;
    408  1.1  riastrad };
    409  1.1  riastrad 
    410  1.1  riastrad /**
    411  1.1  riastrad  * struct drm_tegra_submit - job submission structure
    412  1.1  riastrad  */
    413  1.1  riastrad struct drm_tegra_submit {
    414  1.1  riastrad 	/**
    415  1.1  riastrad 	 * @context:
    416  1.1  riastrad 	 *
    417  1.1  riastrad 	 * The application context identifying the channel to use for the
    418  1.1  riastrad 	 * execution of this job.
    419  1.1  riastrad 	 */
    420  1.1  riastrad 	__u64 context;
    421  1.1  riastrad 
    422  1.1  riastrad 	/**
    423  1.1  riastrad 	 * @num_syncpts:
    424  1.1  riastrad 	 *
    425  1.1  riastrad 	 * The number of syncpoints operated on by this job. This defines the
    426  1.1  riastrad 	 * length of the array pointed to by @syncpts.
    427  1.1  riastrad 	 */
    428  1.1  riastrad 	__u32 num_syncpts;
    429  1.1  riastrad 
    430  1.1  riastrad 	/**
    431  1.1  riastrad 	 * @num_cmdbufs:
    432  1.1  riastrad 	 *
    433  1.1  riastrad 	 * The number of command buffers to execute as part of this job. This
    434  1.1  riastrad 	 * defines the length of the array pointed to by @cmdbufs.
    435  1.1  riastrad 	 */
    436  1.1  riastrad 	__u32 num_cmdbufs;
    437  1.1  riastrad 
    438  1.1  riastrad 	/**
    439  1.1  riastrad 	 * @num_relocs:
    440  1.1  riastrad 	 *
    441  1.1  riastrad 	 * The number of relocations to perform before executing this job.
    442  1.1  riastrad 	 * This defines the length of the array pointed to by @relocs.
    443  1.1  riastrad 	 */
    444  1.1  riastrad 	__u32 num_relocs;
    445  1.1  riastrad 
    446  1.1  riastrad 	/**
    447  1.1  riastrad 	 * @num_waitchks:
    448  1.1  riastrad 	 *
    449  1.1  riastrad 	 * The number of wait checks to perform as part of this job. This
    450  1.1  riastrad 	 * defines the length of the array pointed to by @waitchks.
    451  1.1  riastrad 	 */
    452  1.1  riastrad 	__u32 num_waitchks;
    453  1.1  riastrad 
    454  1.1  riastrad 	/**
    455  1.1  riastrad 	 * @waitchk_mask:
    456  1.1  riastrad 	 *
    457  1.1  riastrad 	 * Bitmask of valid wait checks.
    458  1.1  riastrad 	 */
    459  1.1  riastrad 	__u32 waitchk_mask;
    460  1.1  riastrad 
    461  1.1  riastrad 	/**
    462  1.1  riastrad 	 * @timeout:
    463  1.1  riastrad 	 *
    464  1.1  riastrad 	 * Timeout, in milliseconds, before this job is cancelled.
    465  1.1  riastrad 	 */
    466  1.1  riastrad 	__u32 timeout;
    467  1.1  riastrad 
    468  1.1  riastrad 	/**
    469  1.1  riastrad 	 * @syncpts:
    470  1.1  riastrad 	 *
    471  1.1  riastrad 	 * A pointer to an array of &struct drm_tegra_syncpt structures that
    472  1.1  riastrad 	 * specify the syncpoint operations performed as part of this job.
    473  1.1  riastrad 	 * The number of elements in the array must be equal to the value
    474  1.1  riastrad 	 * given by @num_syncpts.
    475  1.1  riastrad 	 */
    476  1.1  riastrad 	__u64 syncpts;
    477  1.1  riastrad 
    478  1.1  riastrad 	/**
    479  1.1  riastrad 	 * @cmdbufs:
    480  1.1  riastrad 	 *
    481  1.1  riastrad 	 * A pointer to an array of &struct drm_tegra_cmdbuf structures that
    482  1.1  riastrad 	 * define the command buffers to execute as part of this job. The
    483  1.1  riastrad 	 * number of elements in the array must be equal to the value given
    484  1.1  riastrad 	 * by @num_syncpts.
    485  1.1  riastrad 	 */
    486  1.1  riastrad 	__u64 cmdbufs;
    487  1.1  riastrad 
    488  1.1  riastrad 	/**
    489  1.1  riastrad 	 * @relocs:
    490  1.1  riastrad 	 *
    491  1.1  riastrad 	 * A pointer to an array of &struct drm_tegra_reloc structures that
    492  1.1  riastrad 	 * specify the relocations that need to be performed before executing
    493  1.1  riastrad 	 * this job. The number of elements in the array must be equal to the
    494  1.1  riastrad 	 * value given by @num_relocs.
    495  1.1  riastrad 	 */
    496  1.1  riastrad 	__u64 relocs;
    497  1.1  riastrad 
    498  1.1  riastrad 	/**
    499  1.1  riastrad 	 * @waitchks:
    500  1.1  riastrad 	 *
    501  1.1  riastrad 	 * A pointer to an array of &struct drm_tegra_waitchk structures that
    502  1.1  riastrad 	 * specify the wait checks to be performed while executing this job.
    503  1.1  riastrad 	 * The number of elements in the array must be equal to the value
    504  1.1  riastrad 	 * given by @num_waitchks.
    505  1.1  riastrad 	 */
    506  1.1  riastrad 	__u64 waitchks;
    507  1.1  riastrad 
    508  1.1  riastrad 	/**
    509  1.1  riastrad 	 * @fence:
    510  1.1  riastrad 	 *
    511  1.1  riastrad 	 * The threshold of the syncpoint associated with this job after it
    512  1.1  riastrad 	 * has been completed. Set by the kernel upon successful completion of
    513  1.1  riastrad 	 * the IOCTL. This can be used with the DRM_TEGRA_SYNCPT_WAIT IOCTL to
    514  1.1  riastrad 	 * wait for this job to be finished.
    515  1.1  riastrad 	 */
    516  1.1  riastrad 	__u32 fence;
    517  1.1  riastrad 
    518  1.1  riastrad 	/**
    519  1.1  riastrad 	 * @reserved:
    520  1.1  riastrad 	 *
    521  1.1  riastrad 	 * This field is reserved for future use. Must be 0.
    522  1.1  riastrad 	 */
    523  1.1  riastrad 	__u32 reserved[5];
    524  1.1  riastrad };
    525  1.1  riastrad 
    526  1.1  riastrad #define DRM_TEGRA_GEM_TILING_MODE_PITCH 0
    527  1.1  riastrad #define DRM_TEGRA_GEM_TILING_MODE_TILED 1
    528  1.1  riastrad #define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2
    529  1.1  riastrad 
    530  1.1  riastrad /**
    531  1.1  riastrad  * struct drm_tegra_gem_set_tiling - parameters for the set tiling IOCTL
    532  1.1  riastrad  */
    533  1.1  riastrad struct drm_tegra_gem_set_tiling {
    534  1.1  riastrad 	/**
    535  1.1  riastrad 	 * @handle:
    536  1.1  riastrad 	 *
    537  1.1  riastrad 	 * Handle to the GEM object for which to set the tiling parameters.
    538  1.1  riastrad 	 */
    539  1.1  riastrad 	__u32 handle;
    540  1.1  riastrad 
    541  1.1  riastrad 	/**
    542  1.1  riastrad 	 * @mode:
    543  1.1  riastrad 	 *
    544  1.1  riastrad 	 * The tiling mode to set. Must be one of:
    545  1.1  riastrad 	 *
    546  1.1  riastrad 	 * DRM_TEGRA_GEM_TILING_MODE_PITCH
    547  1.1  riastrad 	 *   pitch linear format
    548  1.1  riastrad 	 *
    549  1.1  riastrad 	 * DRM_TEGRA_GEM_TILING_MODE_TILED
    550  1.1  riastrad 	 *   16x16 tiling format
    551  1.1  riastrad 	 *
    552  1.1  riastrad 	 * DRM_TEGRA_GEM_TILING_MODE_BLOCK
    553  1.1  riastrad 	 *   16Bx2 tiling format
    554  1.1  riastrad 	 */
    555  1.1  riastrad 	__u32 mode;
    556  1.1  riastrad 
    557  1.1  riastrad 	/**
    558  1.1  riastrad 	 * @value:
    559  1.1  riastrad 	 *
    560  1.1  riastrad 	 * The value to set for the tiling mode parameter.
    561  1.1  riastrad 	 */
    562  1.1  riastrad 	__u32 value;
    563  1.1  riastrad 
    564  1.1  riastrad 	/**
    565  1.1  riastrad 	 * @pad:
    566  1.1  riastrad 	 *
    567  1.1  riastrad 	 * Structure padding that may be used in the future. Must be 0.
    568  1.1  riastrad 	 */
    569  1.1  riastrad 	__u32 pad;
    570  1.1  riastrad };
    571  1.1  riastrad 
    572  1.1  riastrad /**
    573  1.1  riastrad  * struct drm_tegra_gem_get_tiling - parameters for the get tiling IOCTL
    574  1.1  riastrad  */
    575  1.1  riastrad struct drm_tegra_gem_get_tiling {
    576  1.1  riastrad 	/**
    577  1.1  riastrad 	 * @handle:
    578  1.1  riastrad 	 *
    579  1.1  riastrad 	 * Handle to the GEM object for which to query the tiling parameters.
    580  1.1  riastrad 	 */
    581  1.1  riastrad 	__u32 handle;
    582  1.1  riastrad 
    583  1.1  riastrad 	/**
    584  1.1  riastrad 	 * @mode:
    585  1.1  riastrad 	 *
    586  1.1  riastrad 	 * The tiling mode currently associated with the GEM object. Set by
    587  1.1  riastrad 	 * the kernel upon successful completion of the IOCTL.
    588  1.1  riastrad 	 */
    589  1.1  riastrad 	__u32 mode;
    590  1.1  riastrad 
    591  1.1  riastrad 	/**
    592  1.1  riastrad 	 * @value:
    593  1.1  riastrad 	 *
    594  1.1  riastrad 	 * The tiling mode parameter currently associated with the GEM object.
    595  1.1  riastrad 	 * Set by the kernel upon successful completion of the IOCTL.
    596  1.1  riastrad 	 */
    597  1.1  riastrad 	__u32 value;
    598  1.1  riastrad 
    599  1.1  riastrad 	/**
    600  1.1  riastrad 	 * @pad:
    601  1.1  riastrad 	 *
    602  1.1  riastrad 	 * Structure padding that may be used in the future. Must be 0.
    603  1.1  riastrad 	 */
    604  1.1  riastrad 	__u32 pad;
    605  1.1  riastrad };
    606  1.1  riastrad 
    607  1.1  riastrad #define DRM_TEGRA_GEM_BOTTOM_UP		(1 << 0)
    608  1.1  riastrad #define DRM_TEGRA_GEM_FLAGS		(DRM_TEGRA_GEM_BOTTOM_UP)
    609  1.1  riastrad 
    610  1.1  riastrad /**
    611  1.1  riastrad  * struct drm_tegra_gem_set_flags - parameters for the set flags IOCTL
    612  1.1  riastrad  */
    613  1.1  riastrad struct drm_tegra_gem_set_flags {
    614  1.1  riastrad 	/**
    615  1.1  riastrad 	 * @handle:
    616  1.1  riastrad 	 *
    617  1.1  riastrad 	 * Handle to the GEM object for which to set the flags.
    618  1.1  riastrad 	 */
    619  1.1  riastrad 	__u32 handle;
    620  1.1  riastrad 
    621  1.1  riastrad 	/**
    622  1.1  riastrad 	 * @flags:
    623  1.1  riastrad 	 *
    624  1.1  riastrad 	 * The flags to set for the GEM object.
    625  1.1  riastrad 	 */
    626  1.1  riastrad 	__u32 flags;
    627  1.1  riastrad };
    628  1.1  riastrad 
    629  1.1  riastrad /**
    630  1.1  riastrad  * struct drm_tegra_gem_get_flags - parameters for the get flags IOCTL
    631  1.1  riastrad  */
    632  1.1  riastrad struct drm_tegra_gem_get_flags {
    633  1.1  riastrad 	/**
    634  1.1  riastrad 	 * @handle:
    635  1.1  riastrad 	 *
    636  1.1  riastrad 	 * Handle to the GEM object for which to query the flags.
    637  1.1  riastrad 	 */
    638  1.1  riastrad 	__u32 handle;
    639  1.1  riastrad 
    640  1.1  riastrad 	/**
    641  1.1  riastrad 	 * @flags:
    642  1.1  riastrad 	 *
    643  1.1  riastrad 	 * The flags currently associated with the GEM object. Set by the
    644  1.1  riastrad 	 * kernel upon successful completion of the IOCTL.
    645  1.1  riastrad 	 */
    646  1.1  riastrad 	__u32 flags;
    647  1.1  riastrad };
    648  1.1  riastrad 
    649  1.1  riastrad #define DRM_TEGRA_GEM_CREATE		0x00
    650  1.1  riastrad #define DRM_TEGRA_GEM_MMAP		0x01
    651  1.1  riastrad #define DRM_TEGRA_SYNCPT_READ		0x02
    652  1.1  riastrad #define DRM_TEGRA_SYNCPT_INCR		0x03
    653  1.1  riastrad #define DRM_TEGRA_SYNCPT_WAIT		0x04
    654  1.1  riastrad #define DRM_TEGRA_OPEN_CHANNEL		0x05
    655  1.1  riastrad #define DRM_TEGRA_CLOSE_CHANNEL		0x06
    656  1.1  riastrad #define DRM_TEGRA_GET_SYNCPT		0x07
    657  1.1  riastrad #define DRM_TEGRA_SUBMIT		0x08
    658  1.1  riastrad #define DRM_TEGRA_GET_SYNCPT_BASE	0x09
    659  1.1  riastrad #define DRM_TEGRA_GEM_SET_TILING	0x0a
    660  1.1  riastrad #define DRM_TEGRA_GEM_GET_TILING	0x0b
    661  1.1  riastrad #define DRM_TEGRA_GEM_SET_FLAGS		0x0c
    662  1.1  riastrad #define DRM_TEGRA_GEM_GET_FLAGS		0x0d
    663  1.1  riastrad 
    664  1.1  riastrad #define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
    665  1.1  riastrad #define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
    666  1.1  riastrad #define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
    667  1.1  riastrad #define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
    668  1.1  riastrad #define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
    669  1.1  riastrad #define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
    670  1.1  riastrad #define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_close_channel)
    671  1.1  riastrad #define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
    672  1.1  riastrad #define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
    673  1.1  riastrad #define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base)
    674  1.1  riastrad #define DRM_IOCTL_TEGRA_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_TILING, struct drm_tegra_gem_set_tiling)
    675  1.1  riastrad #define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling)
    676  1.1  riastrad #define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
    677  1.1  riastrad #define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
    678  1.1  riastrad 
    679  1.1  riastrad #if defined(__cplusplus)
    680  1.1  riastrad }
    681  1.1  riastrad #endif
    682  1.1  riastrad 
    683  1.1  riastrad #endif
    684