Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:50

0001 /*
0002  * Copyright 2013 Red Hat
0003  * All Rights Reserved.
0004  *
0005  * Permission is hereby granted, free of charge, to any person obtaining a
0006  * copy of this software and associated documentation files (the "Software"),
0007  * to deal in the Software without restriction, including without limitation
0008  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0009  * and/or sell copies of the Software, and to permit persons to whom the
0010  * Software is furnished to do so, subject to the following conditions:
0011  *
0012  * The above copyright notice and this permission notice (including the next
0013  * paragraph) shall be included in all copies or substantial portions of the
0014  * Software.
0015  *
0016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0017  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0018  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0019  * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
0020  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0021  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0022  * OTHER DEALINGS IN THE SOFTWARE.
0023  */
0024 #ifndef QXL_DRM_H
0025 #define QXL_DRM_H
0026 
0027 #include "drm.h"
0028 
0029 #if defined(__cplusplus)
0030 extern "C" {
0031 #endif
0032 
0033 /* Please note that modifications to all structs defined here are
0034  * subject to backwards-compatibility constraints.
0035  *
0036  * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
0037  * compatibility Keep fields aligned to their size
0038  */
0039 
0040 #define QXL_GEM_DOMAIN_CPU 0
0041 #define QXL_GEM_DOMAIN_VRAM 1
0042 #define QXL_GEM_DOMAIN_SURFACE 2
0043 
0044 #define DRM_QXL_ALLOC       0x00
0045 #define DRM_QXL_MAP         0x01
0046 #define DRM_QXL_EXECBUFFER  0x02
0047 #define DRM_QXL_UPDATE_AREA 0x03
0048 #define DRM_QXL_GETPARAM    0x04
0049 #define DRM_QXL_CLIENTCAP   0x05
0050 
0051 #define DRM_QXL_ALLOC_SURF  0x06
0052 
0053 struct drm_qxl_alloc {
0054     __u32 size;
0055     __u32 handle; /* 0 is an invalid handle */
0056 };
0057 
0058 struct drm_qxl_map {
0059     __u64 offset; /* use for mmap system call */
0060     __u32 handle;
0061     __u32 pad;
0062 };
0063 
0064 /*
0065  * dest is the bo we are writing the relocation into
0066  * src is bo we are relocating.
0067  * *(dest_handle.base_addr + dest_offset) = physical_address(src_handle.addr +
0068  * src_offset)
0069  */
0070 #define QXL_RELOC_TYPE_BO 1
0071 #define QXL_RELOC_TYPE_SURF 2
0072 
0073 struct drm_qxl_reloc {
0074     __u64 src_offset; /* offset into src_handle or src buffer */
0075     __u64 dst_offset; /* offset in dest handle */
0076     __u32 src_handle; /* dest handle to compute address from */
0077     __u32 dst_handle; /* 0 if to command buffer */
0078     __u32 reloc_type;
0079     __u32 pad;
0080 };
0081 
0082 struct drm_qxl_command {
0083     __u64       command; /* void* */
0084     __u64       relocs; /* struct drm_qxl_reloc* */
0085     __u32       type;
0086     __u32       command_size;
0087     __u32       relocs_num;
0088     __u32                pad;
0089 };
0090 
0091 struct drm_qxl_execbuffer {
0092     __u32       flags;      /* for future use */
0093     __u32       commands_num;
0094     __u64       commands;   /* struct drm_qxl_command* */
0095 };
0096 
0097 struct drm_qxl_update_area {
0098     __u32 handle;
0099     __u32 top;
0100     __u32 left;
0101     __u32 bottom;
0102     __u32 right;
0103     __u32 pad;
0104 };
0105 
0106 #define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */
0107 #define QXL_PARAM_MAX_RELOCS 2
0108 struct drm_qxl_getparam {
0109     __u64 param;
0110     __u64 value;
0111 };
0112 
0113 /* these are one bit values */
0114 struct drm_qxl_clientcap {
0115     __u32 index;
0116     __u32 pad;
0117 };
0118 
0119 struct drm_qxl_alloc_surf {
0120     __u32 format;
0121     __u32 width;
0122     __u32 height;
0123     __s32 stride;
0124     __u32 handle;
0125     __u32 pad;
0126 };
0127 
0128 #define DRM_IOCTL_QXL_ALLOC \
0129     DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC, struct drm_qxl_alloc)
0130 
0131 #define DRM_IOCTL_QXL_MAP \
0132     DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_MAP, struct drm_qxl_map)
0133 
0134 #define DRM_IOCTL_QXL_EXECBUFFER \
0135     DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_EXECBUFFER,\
0136         struct drm_qxl_execbuffer)
0137 
0138 #define DRM_IOCTL_QXL_UPDATE_AREA \
0139     DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_UPDATE_AREA,\
0140         struct drm_qxl_update_area)
0141 
0142 #define DRM_IOCTL_QXL_GETPARAM \
0143     DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_GETPARAM,\
0144         struct drm_qxl_getparam)
0145 
0146 #define DRM_IOCTL_QXL_CLIENTCAP \
0147     DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_CLIENTCAP,\
0148         struct drm_qxl_clientcap)
0149 
0150 #define DRM_IOCTL_QXL_ALLOC_SURF \
0151     DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\
0152         struct drm_qxl_alloc_surf)
0153 
0154 #if defined(__cplusplus)
0155 }
0156 #endif
0157 
0158 #endif