Warning, file /include/libdrm/via_drm.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef _VIA_DRM_H_
0025 #define _VIA_DRM_H_
0026
0027 #include "drm.h"
0028
0029 #if defined(__cplusplus)
0030 extern "C" {
0031 #endif
0032
0033
0034
0035
0036
0037 #ifndef _VIA_DEFINES_
0038 #define _VIA_DEFINES_
0039
0040 #include "via_drmclient.h"
0041
0042 #define VIA_NR_SAREA_CLIPRECTS 8
0043 #define VIA_NR_XVMC_PORTS 10
0044 #define VIA_NR_XVMC_LOCKS 5
0045 #define VIA_MAX_CACHELINE_SIZE 64
0046 #define XVMCLOCKPTR(saPriv,lockNo) \
0047 ((__volatile__ struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
0048 (VIA_MAX_CACHELINE_SIZE - 1)) & \
0049 ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
0050 VIA_MAX_CACHELINE_SIZE*(lockNo)))
0051
0052
0053
0054 #define VIA_NR_TEX_REGIONS 64
0055 #define VIA_LOG_MIN_TEX_REGION_SIZE 16
0056 #endif
0057
0058 #define VIA_UPLOAD_TEX0IMAGE 0x1
0059 #define VIA_UPLOAD_TEX1IMAGE 0x2
0060 #define VIA_UPLOAD_CTX 0x4
0061 #define VIA_UPLOAD_BUFFERS 0x8
0062 #define VIA_UPLOAD_TEX0 0x10
0063 #define VIA_UPLOAD_TEX1 0x20
0064 #define VIA_UPLOAD_CLIPRECTS 0x40
0065 #define VIA_UPLOAD_ALL 0xff
0066
0067
0068 #define DRM_VIA_ALLOCMEM 0x00
0069 #define DRM_VIA_FREEMEM 0x01
0070 #define DRM_VIA_AGP_INIT 0x02
0071 #define DRM_VIA_FB_INIT 0x03
0072 #define DRM_VIA_MAP_INIT 0x04
0073 #define DRM_VIA_DEC_FUTEX 0x05
0074 #define NOT_USED
0075 #define DRM_VIA_DMA_INIT 0x07
0076 #define DRM_VIA_CMDBUFFER 0x08
0077 #define DRM_VIA_FLUSH 0x09
0078 #define DRM_VIA_PCICMD 0x0a
0079 #define DRM_VIA_CMDBUF_SIZE 0x0b
0080 #define NOT_USED
0081 #define DRM_VIA_WAIT_IRQ 0x0d
0082 #define DRM_VIA_DMA_BLIT 0x0e
0083 #define DRM_VIA_BLIT_SYNC 0x0f
0084
0085 #define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
0086 #define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
0087 #define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
0088 #define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
0089 #define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
0090 #define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
0091 #define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
0092 #define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
0093 #define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH)
0094 #define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
0095 #define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
0096 drm_via_cmdbuf_size_t)
0097 #define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
0098 #define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
0099 #define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
0100
0101
0102
0103
0104
0105
0106 #define VIA_TEX_SETUP_SIZE 8
0107
0108
0109
0110 #define VIA_FRONT 0x1
0111 #define VIA_BACK 0x2
0112 #define VIA_DEPTH 0x4
0113 #define VIA_STENCIL 0x8
0114 #define VIA_MEM_VIDEO 0
0115 #define VIA_MEM_AGP 1
0116 #define VIA_MEM_SYSTEM 2
0117 #define VIA_MEM_MIXED 3
0118 #define VIA_MEM_UNKNOWN 4
0119
0120 typedef struct {
0121 __u32 offset;
0122 __u32 size;
0123 } drm_via_agp_t;
0124
0125 typedef struct {
0126 __u32 offset;
0127 __u32 size;
0128 } drm_via_fb_t;
0129
0130 typedef struct {
0131 __u32 context;
0132 __u32 type;
0133 __u32 size;
0134 unsigned long index;
0135 unsigned long offset;
0136 } drm_via_mem_t;
0137
0138 typedef struct _drm_via_init {
0139 enum {
0140 VIA_INIT_MAP = 0x01,
0141 VIA_CLEANUP_MAP = 0x02
0142 } func;
0143
0144 unsigned long sarea_priv_offset;
0145 unsigned long fb_offset;
0146 unsigned long mmio_offset;
0147 unsigned long agpAddr;
0148 } drm_via_init_t;
0149
0150 typedef struct _drm_via_futex {
0151 enum {
0152 VIA_FUTEX_WAIT = 0x00,
0153 VIA_FUTEX_WAKE = 0X01
0154 } func;
0155 __u32 ms;
0156 __u32 lock;
0157 __u32 val;
0158 } drm_via_futex_t;
0159
0160 typedef struct _drm_via_dma_init {
0161 enum {
0162 VIA_INIT_DMA = 0x01,
0163 VIA_CLEANUP_DMA = 0x02,
0164 VIA_DMA_INITIALIZED = 0x03
0165 } func;
0166
0167 unsigned long offset;
0168 unsigned long size;
0169 unsigned long reg_pause_addr;
0170 } drm_via_dma_init_t;
0171
0172 typedef struct _drm_via_cmdbuffer {
0173 char *buf;
0174 unsigned long size;
0175 } drm_via_cmdbuffer_t;
0176
0177
0178
0179
0180 typedef struct _drm_via_tex_region {
0181 unsigned char next, prev;
0182 unsigned char inUse;
0183 int age;
0184 } drm_via_tex_region_t;
0185
0186 typedef struct _drm_via_sarea {
0187 unsigned int dirty;
0188 unsigned int nbox;
0189 struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
0190 drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
0191 int texAge;
0192 int ctxOwner;
0193 int vertexPrim;
0194
0195
0196
0197
0198
0199
0200
0201 char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
0202
0203 unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
0204 unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
0205 unsigned int XvMCCtxNoGrabbed;
0206
0207
0208
0209 unsigned int pfCurrentOffset;
0210 } drm_via_sarea_t;
0211
0212 typedef struct _drm_via_cmdbuf_size {
0213 enum {
0214 VIA_CMDBUF_SPACE = 0x01,
0215 VIA_CMDBUF_LAG = 0x02
0216 } func;
0217 int wait;
0218 __u32 size;
0219 } drm_via_cmdbuf_size_t;
0220
0221 typedef enum {
0222 VIA_IRQ_ABSOLUTE = 0x0,
0223 VIA_IRQ_RELATIVE = 0x1,
0224 VIA_IRQ_SIGNAL = 0x10000000,
0225 VIA_IRQ_FORCE_SEQUENCE = 0x20000000
0226 } via_irq_seq_type_t;
0227
0228 #define VIA_IRQ_FLAGS_MASK 0xF0000000
0229
0230 enum drm_via_irqs {
0231 drm_via_irq_hqv0 = 0,
0232 drm_via_irq_hqv1,
0233 drm_via_irq_dma0_dd,
0234 drm_via_irq_dma0_td,
0235 drm_via_irq_dma1_dd,
0236 drm_via_irq_dma1_td,
0237 drm_via_irq_num
0238 };
0239
0240 struct drm_via_wait_irq_request {
0241 unsigned irq;
0242 via_irq_seq_type_t type;
0243 __u32 sequence;
0244 __u32 signal;
0245 };
0246
0247 typedef union drm_via_irqwait {
0248 struct drm_via_wait_irq_request request;
0249 struct drm_wait_vblank_reply reply;
0250 } drm_via_irqwait_t;
0251
0252 typedef struct drm_via_blitsync {
0253 __u32 sync_handle;
0254 unsigned engine;
0255 } drm_via_blitsync_t;
0256
0257
0258
0259
0260
0261
0262
0263 typedef struct drm_via_dmablit {
0264 __u32 num_lines;
0265 __u32 line_length;
0266
0267 __u32 fb_addr;
0268 __u32 fb_stride;
0269
0270 unsigned char *mem_addr;
0271 __u32 mem_stride;
0272
0273 __u32 flags;
0274 int to_fb;
0275
0276 drm_via_blitsync_t sync;
0277 } drm_via_dmablit_t;
0278
0279 #if defined(__cplusplus)
0280 }
0281 #endif
0282
0283 #endif