patch-2.4.0-test8 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-test7/linux/drivers/char/drm/mga_drv.h linux/drivers/char/drm/mga_drv.h
@@ -39,8 +39,8 @@
 
 typedef struct {
 	u32 buffer_status;
-   	unsigned int num_dwords;
-   	unsigned int max_dwords;
+   	int num_dwords;
+   	int max_dwords;
    	u32 *current_dma_ptr;
    	u32 *head;
    	u32 phys_head;
@@ -209,19 +209,27 @@
 #define PRIMLOCALS	u8 tempIndex[4]; u32 *dma_ptr; u32 phys_head; \
 			int outcount, num_dwords
 
-#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)) {				\
- 		mga_advance_primary(dev);				\
- 		mga_dma_schedule(dev, 1);				\
- 	} else if( tmp_buf->max_dwords - tmp_buf->num_dwords < length ||\
- 	    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);				\
-	}								\
+#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)) {				   \
+ 		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) {			   \
+		set_bit(MGA_BUF_FORCE_FIRE, &tmp_buf->buffer_status);	   \
+ 		mga_advance_primary(dev);				   \
+ 		mga_dma_schedule(dev, 1);				   \
+		tmp_buf = dev_priv->prim_bufs[dev_priv->current_prim_idx]; \
+	}								   \
+	if(MGA_VERBOSE)							   \
+		DRM_DEBUG("PRIMGETPTR in %s\n", __FUNCTION__);		   \
+	dma_ptr = tmp_buf->current_dma_ptr;				   \
+	num_dwords = tmp_buf->num_dwords;				   \
+	phys_head = tmp_buf->phys_head;					   \
+	outcount = 0;							   \
 } while(0)
 
 #define PRIMGETPTR(dev_priv) do {					\

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