drm.h revision d0538f66491267879b7418b21ad78e3dcc2dcc83
60405de4d8688d96dd05157c28db3ade5c9bc234kz/* BEGIN CSTYLED */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Header for the Direct Rendering Manager
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \author Rickard E. (Rik) Faith <faith@valinux.com>
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \par Acknowledgments:
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * All rights reserved.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Permission is hereby granted, free of charge, to any person obtaining a
60405de4d8688d96dd05157c28db3ade5c9bc234kz * copy of this software and associated documentation files (the "Software"),
60405de4d8688d96dd05157c28db3ade5c9bc234kz * to deal in the Software without restriction, including without limitation
60405de4d8688d96dd05157c28db3ade5c9bc234kz * the rights to use, copy, modify, merge, publish, distribute, sublicense,
60405de4d8688d96dd05157c28db3ade5c9bc234kz * and/or sell copies of the Software, and to permit persons to whom the
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Software is furnished to do so, subject to the following conditions:
60405de4d8688d96dd05157c28db3ade5c9bc234kz * The above copyright notice and this permission notice (including the next
60405de4d8688d96dd05157c28db3ade5c9bc234kz * paragraph) shall be included in all copies or substantial portions of the
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Software.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60405de4d8688d96dd05157c28db3ade5c9bc234kz * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60405de4d8688d96dd05157c28db3ade5c9bc234kz * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
60405de4d8688d96dd05157c28db3ade5c9bc234kz * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
60405de4d8688d96dd05157c28db3ade5c9bc234kz * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
60405de4d8688d96dd05157c28db3ade5c9bc234kz * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
60405de4d8688d96dd05157c28db3ade5c9bc234kz * OTHER DEALINGS IN THE SOFTWARE.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \mainpage
60405de4d8688d96dd05157c28db3ade5c9bc234kz * The Direct Rendering Manager (DRM) is a device-independent kernel-level
60405de4d8688d96dd05157c28db3ade5c9bc234kz * device driver that provides support for the XFree86 Direct Rendering
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Infrastructure (DRI).
60405de4d8688d96dd05157c28db3ade5c9bc234kz * The DRM supports the Direct Rendering Infrastructure (DRI) in four major
60405de4d8688d96dd05157c28db3ade5c9bc234kz * -# The DRM provides synchronized access to the graphics hardware via
60405de4d8688d96dd05157c28db3ade5c9bc234kz * the use of an optimized two-tiered lock.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * -# The DRM enforces the DRI security policy for access to the graphics
60405de4d8688d96dd05157c28db3ade5c9bc234kz * hardware by only allowing authenticated X11 clients access to
60405de4d8688d96dd05157c28db3ade5c9bc234kz * restricted regions of memory.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * -# The DRM provides a generic DMA engine, complete with multiple
60405de4d8688d96dd05157c28db3ade5c9bc234kz * queues and the ability to detect the need for an OpenGL context
60405de4d8688d96dd05157c28db3ade5c9bc234kz * -# The DRM is extensible via the use of small device-specific modules
60405de4d8688d96dd05157c28db3ade5c9bc234kz * that rely extensively on the API exported by the DRM module.
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
e92e3a8694f157faf8a9e44096a70ada86c556bfzw * Use is subject to license terms.
60405de4d8688d96dd05157c28db3ade5c9bc234kz#pragma ident "%Z%%M% %I% %E% SMI"
60405de4d8688d96dd05157c28db3ade5c9bc234kz# define __volatile__ volatile
60405de4d8688d96dd05157c28db3ade5c9bc234kz#if defined(__linux__)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
e92e3a8694f157faf8a9e44096a70ada86c556bfzw#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
e92e3a8694f157faf8a9e44096a70ada86c556bfzw#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(IN_MODULE)
60405de4d8688d96dd05157c28db3ade5c9bc234kz/* Prevent name collision when including sys/ioccom.h */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#endif /* __FreeBSD__ && xf86ioctl */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
60405de4d8688d96dd05157c28db3ade5c9bc234kz/* Solaris-specific. */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
60405de4d8688d96dd05157c28db3ade5c9bc234kz/* used for X server compile */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#if !defined(_KERNEL)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOR(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof (size))
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOW(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof (size))
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOWR(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, \
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#endif /* _KERNEL */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#endif /* __Solaris__ or sun */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
60405de4d8688d96dd05157c28db3ade5c9bc234kz#if defined(__linux__)
e92e3a8694f157faf8a9e44096a70ada86c556bfzw#if defined(__KERNEL__)
e92e3a8694f157faf8a9e44096a70ada86c556bfzwtypedef unsigned long long drm_u64_t;
e92e3a8694f157faf8a9e44096a70ada86c556bfzwtypedef unsigned int drm_handle_t;
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef unsigned long long drm_handle_t; /**< To mapped regions */
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef unsigned int drm_context_t; /**< GLXContext handle */
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef unsigned int drm_drawable_t;
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef unsigned int drm_magic_t; /**< Magic for authentication */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Cliprect.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \warning If you change this structure, make sure you change
60405de4d8688d96dd05157c28db3ade5c9bc234kz * XF86DRIClipRectRec in the server as well
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \note KW: Actually it's illegal to change either for
60405de4d8688d96dd05157c28db3ade5c9bc234kz * backwards-compatibility reasons.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_clip_rect {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned short x1;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned short y1;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned short x2;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned short y2;
e92e3a8694f157faf8a9e44096a70ada86c556bfzw * Drawable information.
e92e3a8694f157faf8a9e44096a70ada86c556bfzwtypedef struct drm_drawable_info {
e92e3a8694f157faf8a9e44096a70ada86c556bfzw unsigned int num_rects;
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Texture region,
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_tex_region {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned char next;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned char prev;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned char in_use;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned char padding;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned int age;
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Hardware lock.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * The lock structure is a simple cache-line aligned integer. To avoid
60405de4d8688d96dd05157c28db3ade5c9bc234kz * processor bus contention on a multiprocessor system, there should not be any
60405de4d8688d96dd05157c28db3ade5c9bc234kz * other data stored in the same cache line.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_hw_lock {
60405de4d8688d96dd05157c28db3ade5c9bc234kz/* This is beyond ugly, and only works on GCC. However, it allows me to use
60405de4d8688d96dd05157c28db3ade5c9bc234kz * drm.h in places (i.e., in the X-server) where I can't use size_t. The real
60405de4d8688d96dd05157c28db3ade5c9bc234kz * fix is to use uint32_t instead of size_t, but that fix will break existing
60405de4d8688d96dd05157c28db3ade5c9bc234kz * LP64 (i.e., PowerPC64, SPARC64, IA-64, Alpha, etc.) systems. That *will*
60405de4d8688d96dd05157c28db3ade5c9bc234kz * eventually happen, though. I chose 'unsigned long' to be the fallback type
60405de4d8688d96dd05157c28db3ade5c9bc234kz * because that works on all the platforms I know about. Hopefully, the
60405de4d8688d96dd05157c28db3ade5c9bc234kz * real fix will happen before that bites us.
60405de4d8688d96dd05157c28db3ade5c9bc234kz# warning "__SIZE_TYPE__ not defined. Assuming sizeof(size_t) == sizeof(unsigned long)!"
60405de4d8688d96dd05157c28db3ade5c9bc234kz# define DRM_SIZE_T unsigned long
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_VERSION ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmGetVersion().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_version {
60405de4d8688d96dd05157c28db3ade5c9bc234kz char __user *date; /**< User-space buffer to hold date */
60405de4d8688d96dd05157c28db3ade5c9bc234kz char __user *desc; /**< User-space buffer to hold desc */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_GET_UNIQUE ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmGetBusid() and drmSetBusId().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_unique {
60405de4d8688d96dd05157c28db3ade5c9bc234kz char __user *unique; /**< Unique name for driver instantiation */
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_list {
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_block {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_CONTROL ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmCtlInstHandler() and drmCtlUninstHandler().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_control {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Type of memory to map.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum drm_map_type {
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Memory mapping flags.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum drm_map_flags {
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_ctx_priv_map {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned int ctx_id; /**< Context requesting private mapping */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
60405de4d8688d96dd05157c28db3ade5c9bc234kz * argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmAddMap().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_map {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long long offset; /**< Requested physical address (0 for SAREA)*/
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long long handle;
60405de4d8688d96dd05157c28db3ade5c9bc234kz /**< User-space: "Handle" to pass to mmap() */
60405de4d8688d96dd05157c28db3ade5c9bc234kz /**< Kernel-space: kernel-virtual address */
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long size; /**< Requested physical size (bytes) */
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* Private data */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_GET_CLIENT ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_client {
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum {
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* Add to the *END* of the list */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_GET_STATS ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_stats {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long count;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long value;
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Hardware locking flags.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum drm_lock_flags {
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* These *HALT* flags aren't supported yet
60405de4d8688d96dd05157c28db3ade5c9bc234kz -- they will be used to support the
60405de4d8688d96dd05157c28db3ade5c9bc234kz full-screen DGA-like mode. */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmGetLock() and drmUnlock().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_lock {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DMA flags
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \warning
60405de4d8688d96dd05157c28db3ade5c9bc234kz * These values \e must match xf86drm.h.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drm_dma.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum drm_dma_flags {
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* Flags for DMA buffer dispatch */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Block until buffer dispatched.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \note The buffer may not yet have
60405de4d8688d96dd05157c28db3ade5c9bc234kz * been processed by the hardware --
60405de4d8688d96dd05157c28db3ade5c9bc234kz * getting a hardware lock with the
60405de4d8688d96dd05157c28db3ade5c9bc234kz * hardware quiescent will ensure
60405de4d8688d96dd05157c28db3ade5c9bc234kz * that the buffer has been
60405de4d8688d96dd05157c28db3ade5c9bc234kz * processed.
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* Flags for DMA buffer request */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmAddBufs().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum {
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_buf_desc {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Start address of where the AGP buffers are
60405de4d8688d96dd05157c28db3ade5c9bc234kz * in the AGP aperture
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_INFO_BUFS ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_buf_info {
60405de4d8688d96dd05157c28db3ade5c9bc234kz drm_buf_desc_t __user *list; /**< List of buffer descriptions */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_FREE_BUFS ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_buf_free {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Buffer information
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drm_buf_map.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_buf_pub {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_MAP_BUFS ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_buf_map {
60405de4d8688d96dd05157c28db3ade5c9bc234kz void __user *virtual; /**< Mmap'd area in user-virtual */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_DMA ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Indices here refer to the offset into the buffer list in drm_buf_get.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmDMA().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_dma {
60405de4d8688d96dd05157c28db3ade5c9bc234kz int __user *send_indices; /**< List of handles to buffers */
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_ADD_CTX ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmCreateContext() and drmDestroyContext().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_ctx {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_RES_CTX ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_ctx_res {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_draw {
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
d0538f66491267879b7418b21ad78e3dcc2dcc83cgtypedef enum {
d0538f66491267879b7418b21ad78e3dcc2dcc83cgtypedef struct drm_update_draw {
d0538f66491267879b7418b21ad78e3dcc2dcc83cg unsigned int type;
d0538f66491267879b7418b21ad78e3dcc2dcc83cg unsigned int num;
d0538f66491267879b7418b21ad78e3dcc2dcc83cg unsigned long long data;
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_auth {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_IRQ_BUSID ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmGetInterruptFromBusID().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_irq_busid {
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef enum {
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
60405de4d8688d96dd05157c28db3ade5c9bc234kz _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
d0538f66491267879b7418b21ad78e3dcc2dcc83cg#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_SIGNAL | _DRM_VBLANK_SECONDARY | \
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned int sequence;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long signal;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned int sequence;
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmWaitVBlank().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef union drm_wait_vblank {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_AGP_ENABLE ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmAgpEnable().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_agp_mode {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmAgpAlloc() and drmAgpFree().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_agp_buffer {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long size; /**< In bytes -- will round to page boundary */
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long handle; /**< Used for binding / unbinding */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmAgpBind() and drmAgpUnbind().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_agp_binding {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long offset; /**< In bytes -- will round to page boundary */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_AGP_INFO ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
60405de4d8688d96dd05157c28db3ade5c9bc234kz * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(),
60405de4d8688d96dd05157c28db3ade5c9bc234kz * drmAgpVendorId() and drmAgpDeviceId().
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_agp_info {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long mode;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long memory_used;
60405de4d8688d96dd05157c28db3ade5c9bc234kz /** \name PCI information */
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned short id_vendor;
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned short id_device;
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_SG_ALLOC ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_scatter_gather {
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long size; /**< In bytes -- will round to page boundary */
60405de4d8688d96dd05157c28db3ade5c9bc234kz unsigned long handle; /**< Used for mapping / unmapping */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * DRM_IOCTL_SET_VERSION ioctl argument type.
60405de4d8688d96dd05157c28db3ade5c9bc234kztypedef struct drm_set_version {
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \name Ioctls Definitions
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, drm_irq_busid_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, drm_set_version_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, drm_buf_desc_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm_buf_info_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm_buf_free_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, drm_ctx_priv_map_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, drm_ctx_priv_map_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, drm_agp_mode_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, drm_agp_buffer_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, drm_agp_buffer_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, drm_agp_binding_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, drm_agp_binding_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, drm_scatter_gather_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, drm_scatter_gather_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, drm_wait_vblank_t)
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Device specific ioctls should only be in their respective headers
e92e3a8694f157faf8a9e44096a70ada86c556bfzw * The device specific ioctl range is from 0x40 to 0x99.
e92e3a8694f157faf8a9e44096a70ada86c556bfzw * Generic IOCTLS restart at 0xA0.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
60405de4d8688d96dd05157c28db3ade5c9bc234kz * drmCommandReadWrite().
60405de4d8688d96dd05157c28db3ade5c9bc234kz#endif /* _DRM_H_ */