aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/radeonfb.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/aty/radeonfb.h')
-rw-r--r--drivers/video/aty/radeonfb.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index ccbfffd12805..3ea1b00fdd22 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -53,6 +53,7 @@ enum radeon_family {
53 CHIP_FAMILY_RV380, /* RV370/RV380/M22/M24 */ 53 CHIP_FAMILY_RV380, /* RV370/RV380/M22/M24 */
54 CHIP_FAMILY_R420, /* R420/R423/M18 */ 54 CHIP_FAMILY_R420, /* R420/R423/M18 */
55 CHIP_FAMILY_RC410, 55 CHIP_FAMILY_RC410,
56 CHIP_FAMILY_RS400,
56 CHIP_FAMILY_RS480, 57 CHIP_FAMILY_RS480,
57 CHIP_FAMILY_LAST, 58 CHIP_FAMILY_LAST,
58}; 59};
@@ -533,33 +534,39 @@ static inline u32 radeon_get_dstbpp(u16 depth)
533/* 534/*
534 * 2D Engine helper routines 535 * 2D Engine helper routines
535 */ 536 */
536static inline void radeon_engine_flush (struct radeonfb_info *rinfo) 537
538static inline void _radeon_fifo_wait(struct radeonfb_info *rinfo, int entries)
537{ 539{
538 int i; 540 int i;
539 541
540 /* initiate flush */ 542 for (i=0; i<2000000; i++) {
541 OUTREGP(RB2D_DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL, 543 if ((INREG(RBBM_STATUS) & 0x7f) >= entries)
542 ~RB2D_DC_FLUSH_ALL);
543
544 for (i=0; i < 2000000; i++) {
545 if (!(INREG(RB2D_DSTCACHE_CTLSTAT) & RB2D_DC_BUSY))
546 return; 544 return;
547 udelay(1); 545 udelay(1);
548 } 546 }
549 printk(KERN_ERR "radeonfb: Flush Timeout !\n"); 547 printk(KERN_ERR "radeonfb: FIFO Timeout !\n");
550} 548}
551 549
552 550static inline void radeon_engine_flush (struct radeonfb_info *rinfo)
553static inline void _radeon_fifo_wait(struct radeonfb_info *rinfo, int entries)
554{ 551{
555 int i; 552 int i;
556 553
557 for (i=0; i<2000000; i++) { 554 /* Initiate flush */
558 if ((INREG(RBBM_STATUS) & 0x7f) >= entries) 555 OUTREGP(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL,
556 ~RB2D_DC_FLUSH_ALL);
557
558 /* Ensure FIFO is empty, ie, make sure the flush commands
559 * has reached the cache
560 */
561 _radeon_fifo_wait (rinfo, 64);
562
563 /* Wait for the flush to complete */
564 for (i=0; i < 2000000; i++) {
565 if (!(INREG(DSTCACHE_CTLSTAT) & RB2D_DC_BUSY))
559 return; 566 return;
560 udelay(1); 567 udelay(1);
561 } 568 }
562 printk(KERN_ERR "radeonfb: FIFO Timeout !\n"); 569 printk(KERN_ERR "radeonfb: Flush Timeout !\n");
563} 570}
564 571
565 572