patch-2.4.0-test9 linux/drivers/char/drm/mga_drv.h

Next file: linux/drivers/char/drm/mga_state.c
Previous file: linux/drivers/char/drm/mga_drv.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/char/drm/mga_drv.h linux/drivers/char/drm/mga_drv.h
@@ -11,11 +11,11 @@
  * 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
@@ -50,7 +50,7 @@
 } drm_mga_prim_buf_t;
 
 typedef struct _drm_mga_freelist {
-   	unsigned int age;
+   	__volatile__ unsigned int age;
    	drm_buf_t *buf;
    	struct _drm_mga_freelist *next;
    	struct _drm_mga_freelist *prev;
@@ -82,6 +82,7 @@
 	int use_agp;
    	drm_mga_warp_index_t WarpIndex[MGA_MAX_G400_PIPES];
 	unsigned int WarpPipe;
+	unsigned int vertexsize;
    	atomic_t pending_bufs;
    	void *status_page;
    	unsigned long real_status_page;
@@ -97,7 +98,7 @@
       	wait_queue_head_t wait_queue;	/* Processes waiting until interrupt */
 	wait_queue_head_t buf_queue;    /* Processes waiting for a free buf */
 	/* Some validated register values:
-	 */	
+	 */
 	u32 mAccess;
 } drm_mga_private_t;
 
@@ -128,7 +129,6 @@
 extern int mga_dma_cleanup(drm_device_t *dev);
 extern int mga_flush_ioctl(struct inode *inode, struct file *filp,
 			   unsigned int cmd, unsigned long arg);
-extern void mga_flush_write_combine(void);
 extern unsigned int mga_create_sync_tag(drm_device_t *dev);
 extern drm_buf_t *mga_freelist_get(drm_device_t *dev);
 extern int mga_freelist_put(drm_device_t *dev, drm_buf_t *buf);
@@ -137,9 +137,9 @@
 
 
 				/* mga_bufs.c */
-extern int  mga_addbufs(struct inode *inode, struct file *filp, 
+extern int  mga_addbufs(struct inode *inode, struct file *filp,
 			unsigned int cmd, unsigned long arg);
-extern int  mga_infobufs(struct inode *inode, struct file *filp, 
+extern int  mga_infobufs(struct inode *inode, struct file *filp,
 			 unsigned int cmd, unsigned long arg);
 extern int  mga_markbufs(struct inode *inode, struct file *filp,
 			 unsigned int cmd, unsigned long arg);
@@ -179,6 +179,7 @@
 extern int  mga_context_switch(drm_device_t *dev, int old, int new);
 extern int  mga_context_switch_complete(drm_device_t *dev, int new);
 
+#define mga_flush_write_combine()	mb()
 
 typedef enum {
 	TT_GENERAL,
@@ -201,7 +202,7 @@
 #define ISREG0(r)	(r >= DWGREG0 && r <= DWGREG0_END)
 #define ADRINDEX0(r)	(u8)((r - DWGREG0) >> 2)
 #define ADRINDEX1(r)	(u8)(((r - DWGREG1) >> 2) | 0x80)
-#define ADRINDEX(r)	(ISREG0(r) ? ADRINDEX0(r) : ADRINDEX1(r)) 
+#define ADRINDEX(r)	(ISREG0(r) ? ADRINDEX0(r) : ADRINDEX1(r))
 
 #define MGA_VERBOSE 0
 #define MGA_NUM_PRIM_BUFS 	8
@@ -212,13 +213,12 @@
 #define PRIM_OVERFLOW(dev, dev_priv, length) do {			   \
 	drm_mga_prim_buf_t *tmp_buf =					   \
  		dev_priv->prim_bufs[dev_priv->current_prim_idx];	   \
-	if( test_bit(MGA_BUF_NEEDS_OVERFLOW,				   \
-		  &tmp_buf->buffer_status)) {				   \
+	if( test_bit(MGA_BUF_NEEDS_OVERFLOW, &tmp_buf->buffer_status)) {   \
  		mga_advance_primary(dev);				   \
  		mga_dma_schedule(dev, 1);				   \
 		tmp_buf = dev_priv->prim_bufs[dev_priv->current_prim_idx]; \
  	} else if( tmp_buf->max_dwords - tmp_buf->num_dwords < length ||   \
- 	    tmp_buf->sec_used > MGA_DMA_BUF_NR/2) {			   \
+ 	           tmp_buf->sec_used > MGA_DMA_BUF_NR/2) {		   \
 		set_bit(MGA_BUF_FORCE_FIRE, &tmp_buf->buffer_status);	   \
  		mga_advance_primary(dev);				   \
  		mga_dma_schedule(dev, 1);				   \
@@ -295,7 +295,7 @@
 		       num_dwords + 1 + outcount, ADRINDEX(reg), val);	\
 	if( ++outcount == 4) {						\
 		outcount = 0;						\
-		dma_ptr[0] = *(u32 *)tempIndex;				\
+		dma_ptr[0] = *(unsigned long *)tempIndex;		\
 		dma_ptr+=5;						\
 		num_dwords += 5;					\
 	}								\
@@ -377,6 +377,72 @@
 #define MGAREG_YTOP 				0x1c98
 #define MGAREG_ZORG 				0x1c0c
 
+/* Warp registers */
+#define MGAREG_WR0                              0x2d00
+#define MGAREG_WR1                              0x2d04
+#define MGAREG_WR2                              0x2d08
+#define MGAREG_WR3                              0x2d0c
+#define MGAREG_WR4                              0x2d10
+#define MGAREG_WR5                              0x2d14
+#define MGAREG_WR6                              0x2d18
+#define MGAREG_WR7                              0x2d1c
+#define MGAREG_WR8                              0x2d20
+#define MGAREG_WR9                              0x2d24
+#define MGAREG_WR10                             0x2d28
+#define MGAREG_WR11                             0x2d2c
+#define MGAREG_WR12                             0x2d30
+#define MGAREG_WR13                             0x2d34
+#define MGAREG_WR14                             0x2d38
+#define MGAREG_WR15                             0x2d3c
+#define MGAREG_WR16                             0x2d40
+#define MGAREG_WR17                             0x2d44
+#define MGAREG_WR18                             0x2d48
+#define MGAREG_WR19                             0x2d4c
+#define MGAREG_WR20                             0x2d50
+#define MGAREG_WR21                             0x2d54
+#define MGAREG_WR22                             0x2d58
+#define MGAREG_WR23                             0x2d5c
+#define MGAREG_WR24                             0x2d60
+#define MGAREG_WR25                             0x2d64
+#define MGAREG_WR26                             0x2d68
+#define MGAREG_WR27                             0x2d6c
+#define MGAREG_WR28                             0x2d70
+#define MGAREG_WR29                             0x2d74
+#define MGAREG_WR30                             0x2d78
+#define MGAREG_WR31                             0x2d7c
+#define MGAREG_WR32                             0x2d80
+#define MGAREG_WR33                             0x2d84
+#define MGAREG_WR34                             0x2d88
+#define MGAREG_WR35                             0x2d8c
+#define MGAREG_WR36                             0x2d90
+#define MGAREG_WR37                             0x2d94
+#define MGAREG_WR38                             0x2d98
+#define MGAREG_WR39                             0x2d9c
+#define MGAREG_WR40                             0x2da0
+#define MGAREG_WR41                             0x2da4
+#define MGAREG_WR42                             0x2da8
+#define MGAREG_WR43                             0x2dac
+#define MGAREG_WR44                             0x2db0
+#define MGAREG_WR45                             0x2db4
+#define MGAREG_WR46                             0x2db8
+#define MGAREG_WR47                             0x2dbc
+#define MGAREG_WR48                             0x2dc0
+#define MGAREG_WR49                             0x2dc4
+#define MGAREG_WR50                             0x2dc8
+#define MGAREG_WR51                             0x2dcc
+#define MGAREG_WR52                             0x2dd0
+#define MGAREG_WR53                             0x2dd4
+#define MGAREG_WR54                             0x2dd8
+#define MGAREG_WR55                             0x2ddc
+#define MGAREG_WR56                             0x2de0
+#define MGAREG_WR57                             0x2de4
+#define MGAREG_WR58                             0x2de8
+#define MGAREG_WR59                             0x2dec
+#define MGAREG_WR60                             0x2df0
+#define MGAREG_WR61                             0x2df4
+#define MGAREG_WR62                             0x2df8
+#define MGAREG_WR63                             0x2dfc
+
 #define PDEA_pagpxfer_enable			0x2
 
 #define WIA_wmode_suspend			0x0
@@ -396,8 +462,8 @@
 #define DC_atype_zi 				0x30
 #define DC_atype_blk 				0x40
 #define DC_atype_i 				0x70
-#define DC_linear_xy 				0x0 		
-#define DC_linear_linear 			0x80 		
+#define DC_linear_xy 				0x0
+#define DC_linear_linear 			0x80
 #define DC_zmode_nozcmp 			0x0
 #define DC_zmode_ze 				0x200
 #define DC_zmode_zne 				0x300
@@ -405,16 +471,16 @@
 #define DC_zmode_zlte 				0x500
 #define DC_zmode_zgt 				0x600
 #define DC_zmode_zgte 				0x700
-#define DC_solid_disable 			0x0 		
-#define DC_solid_enable 			0x800 		
-#define DC_arzero_disable 			0x0 		
-#define DC_arzero_enable 			0x1000 		
-#define DC_sgnzero_disable 			0x0 		
-#define DC_sgnzero_enable 			0x2000 		
-#define DC_shftzero_disable 			0x0 		
-#define DC_shftzero_enable 			0x4000 		
-#define DC_bop_SHIFT 				16 		
-#define DC_trans_SHIFT 				20 		
+#define DC_solid_disable 			0x0
+#define DC_solid_enable 			0x800
+#define DC_arzero_disable 			0x0
+#define DC_arzero_enable 			0x1000
+#define DC_sgnzero_disable 			0x0
+#define DC_sgnzero_enable 			0x2000
+#define DC_shftzero_disable 			0x0
+#define DC_shftzero_enable 			0x4000
+#define DC_bop_SHIFT 				16
+#define DC_trans_SHIFT 				20
 #define DC_bltmod_bmonolef 			0x0
 #define DC_bltmod_bmonowf 			0x8000000
 #define DC_bltmod_bplan 			0x2000000
@@ -423,21 +489,22 @@
 #define DC_bltmod_bu32rgb 			0xe000000
 #define DC_bltmod_bu24bgr 			0x16000000
 #define DC_bltmod_bu24rgb 			0x1e000000
-#define DC_pattern_disable 			0x0 		
-#define DC_pattern_enable 			0x20000000 	
-#define DC_transc_disable 			0x0 		
-#define DC_transc_enable 			0x40000000 	
-#define DC_clipdis_disable 			0x0 		
-#define DC_clipdis_enable 			0x80000000 	
+#define DC_pattern_disable 			0x0
+#define DC_pattern_enable 			0x20000000
+#define DC_transc_disable 			0x0
+#define DC_transc_enable 			0x40000000
+#define DC_clipdis_disable 			0x0
+#define DC_clipdis_enable 			0x80000000
 
-#define SETADD_mode_vertlist                   	0x0 	
+
+#define SETADD_mode_vertlist                   	0x0
 
 
 #define MGA_CLEAR_CMD (DC_opcod_trap | DC_arzero_enable | 		\
 		       DC_sgnzero_enable | DC_shftzero_enable | 	\
 		       (0xC << DC_bop_SHIFT) | DC_clipdis_enable | 	\
 		       DC_solid_enable | DC_transc_enable)
-	  
+
 
 #define MGA_COPY_CMD (DC_opcod_bitblt | DC_atype_rpl | DC_linear_xy |	\
 		      DC_solid_disable | DC_arzero_disable | 		\

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)