aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/radeonfb.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-16 01:03:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:44 -0400
commita6c0c37db654444dfce91cd75ad8a56bb15a0d25 (patch)
treea204a42fa6441253f51bd186f6978a4f25492a44 /drivers/video/aty/radeonfb.h
parent7c08c9ae0c145807c0dae4a55f240fa3d4fd5262 (diff)
radeonfb: misc cleanup of engine and dst cache handling
Fix a couple of incomplete tests of the chip families in the engine init/reset code and proper initialization of the destination cache mode. The result should better match what the latest X radeon driver does. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: David S. Miller <davem@davemloft.net> Cc: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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