📄 r128_drv.h
字号:
/* r128_drv.h -- Private header for r128 driver -*- linux-c -*- * Created: Mon Dec 13 09:51:11 1999 by faith@precisioninsight.com * * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Rickard E. (Rik) Faith <faith@valinux.com> * Kevin E. Martin <martin@valinux.com> * Gareth Hughes <gareth@valinux.com> * */#ifndef __R128_DRV_H__#define __R128_DRV_H__typedef struct drm_r128_freelist { unsigned int age; drm_buf_t *buf; struct drm_r128_freelist *next; struct drm_r128_freelist *prev;} drm_r128_freelist_t;typedef struct drm_r128_ring_buffer { u32 *start; u32 *end; int size; int size_l2qw; volatile u32 *head; u32 tail; u32 tail_mask; int space;} drm_r128_ring_buffer_t;typedef struct drm_r128_private { drm_r128_ring_buffer_t ring; drm_r128_sarea_t *sarea_priv; int cce_mode; int cce_fifo_size; int cce_secure; int cce_running; drm_r128_freelist_t *head; drm_r128_freelist_t *tail; int usec_timeout; int is_pci; atomic_t idle_count; unsigned int fb_bpp; unsigned int front_offset; unsigned int front_pitch; unsigned int back_offset; unsigned int back_pitch; unsigned int depth_bpp; unsigned int depth_offset; unsigned int depth_pitch; unsigned int span_offset; u32 front_pitch_offset_c; u32 back_pitch_offset_c; u32 depth_pitch_offset_c; u32 span_pitch_offset_c; drm_map_t *sarea; drm_map_t *fb; drm_map_t *mmio; drm_map_t *cce_ring; drm_map_t *ring_rptr; drm_map_t *buffers; drm_map_t *agp_textures;} drm_r128_private_t;typedef struct drm_r128_buf_priv { u32 age; int prim; int discard; int dispatched; drm_r128_freelist_t *list_entry;} drm_r128_buf_priv_t; /* r128_drv.c */extern int r128_version( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_open( struct inode *inode, struct file *filp );extern int r128_release( struct inode *inode, struct file *filp );extern int r128_ioctl( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_lock( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_unlock( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); /* r128_cce.c */extern int r128_cce_init( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_start( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_stop( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_reset( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_idle( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_engine_reset( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_packet( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_buffers( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern void r128_freelist_reset( drm_device_t *dev );extern drm_buf_t *r128_freelist_get( drm_device_t *dev );extern int r128_wait_ring( drm_r128_private_t *dev_priv, int n );extern void r128_update_ring_snapshot( drm_r128_private_t *dev_priv ); /* r128_state.c */extern int r128_cce_clear( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_swap( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_vertex( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_indices( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_blit( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_depth( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg );extern int r128_cce_stipple( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); /* r128_bufs.c */extern int r128_addbufs(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_mapbufs(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); /* r128_context.c */extern int r128_resctx(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_addctx(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_modctx(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_getctx(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_switchctx(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_newctx(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_rmctx(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);extern int r128_context_switch(drm_device_t *dev, int old, int new);extern int r128_context_switch_complete(drm_device_t *dev, int new);/* Register definitions, register access macros and drmAddMap constants * for Rage 128 kernel driver. */#define R128_AUX_SC_CNTL 0x1660# define R128_AUX1_SC_EN (1 << 0)# define R128_AUX1_SC_MODE_OR (0 << 1)# define R128_AUX1_SC_MODE_NAND (1 << 1)# define R128_AUX2_SC_EN (1 << 2)# define R128_AUX2_SC_MODE_OR (0 << 3)# define R128_AUX2_SC_MODE_NAND (1 << 3)# define R128_AUX3_SC_EN (1 << 4)# define R128_AUX3_SC_MODE_OR (0 << 5)# define R128_AUX3_SC_MODE_NAND (1 << 5)#define R128_AUX1_SC_LEFT 0x1664#define R128_AUX1_SC_RIGHT 0x1668#define R128_AUX1_SC_TOP 0x166c#define R128_AUX1_SC_BOTTOM 0x1670#define R128_AUX2_SC_LEFT 0x1674#define R128_AUX2_SC_RIGHT 0x1678#define R128_AUX2_SC_TOP 0x167c#define R128_AUX2_SC_BOTTOM 0x1680#define R128_AUX3_SC_LEFT 0x1684#define R128_AUX3_SC_RIGHT 0x1688#define R128_AUX3_SC_TOP 0x168c#define R128_AUX3_SC_BOTTOM 0x1690#define R128_BRUSH_DATA0 0x1480#define R128_BUS_CNTL 0x0030# define R128_BUS_MASTER_DIS (1 << 6)#define R128_CLOCK_CNTL_INDEX 0x0008#define R128_CLOCK_CNTL_DATA 0x000c# define R128_PLL_WR_EN (1 << 7)#define R128_CONSTANT_COLOR_C 0x1d34#define R128_DP_GUI_MASTER_CNTL 0x146c# define R128_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0)# define R128_GMC_DST_PITCH_OFFSET_CNTL (1 << 1)# define R128_GMC_BRUSH_SOLID_COLOR (13 << 4)# define R128_GMC_BRUSH_NONE (15 << 4)# define R128_GMC_DST_16BPP (4 << 8)# define R128_GMC_DST_24BPP (5 << 8)# define R128_GMC_DST_32BPP (6 << 8)# define R128_GMC_DST_DATATYPE_SHIFT 8# define R128_GMC_SRC_DATATYPE_COLOR (3 << 12)# define R128_DP_SRC_SOURCE_MEMORY (2 << 24)# define R128_DP_SRC_SOURCE_HOST_DATA (3 << 24)# define R128_GMC_CLR_CMP_CNTL_DIS (1 << 28)# define R128_GMC_AUX_CLIP_DIS (1 << 29)# define R128_GMC_WR_MSK_DIS (1 << 30)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -