Back to index

libdrm  2.4.37
vmwgfx_drm.h
Go to the documentation of this file.
00001 /**************************************************************************
00002  *
00003  * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
00004  * All Rights Reserved.
00005  *
00006  * Permission is hereby granted, free of charge, to any person obtaining a
00007  * copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation the rights to use, copy, modify, merge, publish,
00010  * distribute, sub license, and/or sell copies of the Software, and to
00011  * permit persons to whom the Software is furnished to do so, subject to
00012  * the following conditions:
00013  *
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial portions
00016  * of the Software.
00017  *
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00019  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
00021  * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
00022  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
00023  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
00024  * USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  *
00026  **************************************************************************/
00027 
00028 #ifndef __VMWGFX_DRM_H__
00029 #define __VMWGFX_DRM_H__
00030 
00031 #define DRM_VMW_MAX_SURFACE_FACES 6
00032 #define DRM_VMW_MAX_MIP_LEVELS 24
00033 
00034 #define DRM_VMW_EXT_NAME_LEN 128
00035 
00036 #define DRM_VMW_GET_PARAM            0
00037 #define DRM_VMW_ALLOC_DMABUF         1
00038 #define DRM_VMW_UNREF_DMABUF         2
00039 #define DRM_VMW_CURSOR_BYPASS        3
00040 /* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/
00041 #define DRM_VMW_CONTROL_STREAM       4
00042 #define DRM_VMW_CLAIM_STREAM         5
00043 #define DRM_VMW_UNREF_STREAM         6
00044 /* guarded by DRM_VMW_PARAM_3D == 1 */
00045 #define DRM_VMW_CREATE_CONTEXT       7
00046 #define DRM_VMW_UNREF_CONTEXT        8
00047 #define DRM_VMW_CREATE_SURFACE       9
00048 #define DRM_VMW_UNREF_SURFACE        10
00049 #define DRM_VMW_REF_SURFACE          11
00050 #define DRM_VMW_EXECBUF              12
00051 #define DRM_VMW_FIFO_DEBUG           13
00052 #define DRM_VMW_FENCE_WAIT           14
00053 /* guarded by minor version >= 2 */
00054 #define DRM_VMW_UPDATE_LAYOUT        15
00055 
00056 
00057 /*************************************************************************/
00069 #define DRM_VMW_PARAM_NUM_STREAMS      0
00070 #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
00071 #define DRM_VMW_PARAM_3D               2
00072 #define DRM_VMW_PARAM_FIFO_OFFSET      3
00073 #define DRM_VMW_PARAM_HW_CAPS          4
00074 #define DRM_VMW_PARAM_FIFO_CAPS        5
00075 
00085 struct drm_vmw_getparam_arg {
00086        uint64_t value;
00087        uint32_t param;
00088        uint32_t pad64;
00089 };
00090 
00091 /*************************************************************************/
00110 struct drm_vmw_extension_rep {
00111        int32_t exists;
00112        uint32_t driver_ioctl_offset;
00113        uint32_t driver_sarea_offset;
00114        uint32_t major;
00115        uint32_t minor;
00116        uint32_t pl;
00117        uint32_t pad64;
00118 };
00119 
00129 union drm_vmw_extension_arg {
00130        char extension[DRM_VMW_EXT_NAME_LEN];
00131        struct drm_vmw_extension_rep rep;
00132 };
00133 
00134 /*************************************************************************/
00151 struct drm_vmw_context_arg {
00152        int32_t cid;
00153        uint32_t pad64;
00154 };
00155 
00156 /*************************************************************************/
00165 /*************************************************************************/
00194 struct drm_vmw_surface_create_req {
00195        uint32_t flags;
00196        uint32_t format;
00197        uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES];
00198        uint64_t size_addr;
00199        int32_t shareable;
00200        int32_t scanout;
00201 };
00202 
00213 struct drm_vmw_surface_arg {
00214        int32_t sid;
00215        uint32_t pad64;
00216 };
00217 
00229 struct drm_vmw_size {
00230        uint32_t width;
00231        uint32_t height;
00232        uint32_t depth;
00233        uint32_t pad64;
00234 };
00235 
00245 union drm_vmw_surface_create_arg {
00246        struct drm_vmw_surface_arg rep;
00247        struct drm_vmw_surface_create_req req;
00248 };
00249 
00250 /*************************************************************************/
00273 union drm_vmw_surface_reference_arg {
00274        struct drm_vmw_surface_create_req rep;
00275        struct drm_vmw_surface_arg req;
00276 };
00277 
00278 /*************************************************************************/
00289 /*************************************************************************/
00316 #define DRM_VMW_EXECBUF_VERSION 0
00317 
00318 struct drm_vmw_execbuf_arg {
00319        uint64_t commands;
00320        uint32_t command_size;
00321        uint32_t throttle_us;
00322        uint64_t fence_rep;
00323         uint32_t version;
00324         uint32_t flags;
00325 };
00326 
00343 struct drm_vmw_fence_rep {
00344        uint64_t fence_seq;
00345        int32_t error;
00346        uint32_t pad64;
00347 };
00348 
00349 /*************************************************************************/
00375 struct drm_vmw_alloc_dmabuf_req {
00376        uint32_t size;
00377        uint32_t pad64;
00378 };
00379 
00393 struct drm_vmw_dmabuf_rep {
00394        uint64_t map_handle;
00395        uint32_t handle;
00396        uint32_t cur_gmr_id;
00397        uint32_t cur_gmr_offset;
00398        uint32_t pad64;
00399 };
00400 
00410 union drm_vmw_alloc_dmabuf_arg {
00411        struct drm_vmw_alloc_dmabuf_req req;
00412        struct drm_vmw_dmabuf_rep rep;
00413 };
00414 
00415 /*************************************************************************/
00430 struct drm_vmw_unref_dmabuf_arg {
00431        uint32_t handle;
00432        uint32_t pad64;
00433 };
00434 
00435 /*************************************************************************/
00453 struct drm_vmw_fifo_debug_arg {
00454        uint64_t debug_buffer;
00455        uint32_t debug_buffer_size;
00456        uint32_t used_size;
00457        int32_t did_not_fit;
00458        uint32_t pad64;
00459 };
00460 
00461 struct drm_vmw_fence_wait_arg {
00462        uint64_t sequence;
00463        uint64_t kernel_cookie;
00464        int32_t cookie_valid;
00465        int32_t pad64;
00466 };
00467 
00468 /*************************************************************************/
00487 struct drm_vmw_rect {
00488        int32_t x;
00489        int32_t y;
00490        uint32_t w;
00491        uint32_t h;
00492 };
00493 
00512 struct drm_vmw_control_stream_arg {
00513        uint32_t stream_id;
00514        uint32_t enabled;
00515 
00516        uint32_t flags;
00517        uint32_t color_key;
00518 
00519        uint32_t handle;
00520        uint32_t offset;
00521        int32_t format;
00522        uint32_t size;
00523        uint32_t width;
00524        uint32_t height;
00525        uint32_t pitch[3];
00526 
00527        uint32_t pad64;
00528        struct drm_vmw_rect src;
00529        struct drm_vmw_rect dst;
00530 };
00531 
00532 /*************************************************************************/
00538 #define DRM_VMW_CURSOR_BYPASS_ALL    (1 << 0)
00539 #define DRM_VMW_CURSOR_BYPASS_FLAGS       (1)
00540 
00554 struct drm_vmw_cursor_bypass_arg {
00555        uint32_t flags;
00556        uint32_t crtc_id;
00557        int32_t xpos;
00558        int32_t ypos;
00559        int32_t xhot;
00560        int32_t yhot;
00561 };
00562 
00563 /*************************************************************************/
00577 struct drm_vmw_stream_arg {
00578        uint32_t stream_id;
00579        uint32_t pad64;
00580 };
00581 
00582 /*************************************************************************/
00590 /*************************************************************************/
00608 struct drm_vmw_update_layout_arg {
00609        uint32_t num_outputs;
00610        uint32_t pad64;
00611        uint64_t rects;
00612 };
00613 
00614 #endif