aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-03-31 18:25:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 11:59:34 -0400
commit2f682fae611df642acfb99b5f2fd665f001cd253 (patch)
tree7cfb73ff951b0963438159a82e38c50f51c57770 /drivers/video
parent84d9077b3391e6966813e380e63b57f53e58e120 (diff)
atyfb: speed up Mach64 cursor
Save one fifo entry on cursor enabling and disabling. Save another fifo entry for FB_CUR_SETPOS operation by removing redundant one. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/aty/mach64_cursor.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c
index faf95da8fcbc..04c710804bb0 100644
--- a/drivers/video/aty/mach64_cursor.c
+++ b/drivers/video/aty/mach64_cursor.c
@@ -77,9 +77,13 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
77 if (par->asleep) 77 if (par->asleep)
78 return -EPERM; 78 return -EPERM;
79 79
80 /* Hide cursor */
81 wait_for_fifo(1, par); 80 wait_for_fifo(1, par);
82 aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par) & ~HWCURSOR_ENABLE, par); 81 if (cursor->enable)
82 aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
83 | HWCURSOR_ENABLE, par);
84 else
85 aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
86 & ~HWCURSOR_ENABLE, par);
83 87
84 /* set position */ 88 /* set position */
85 if (cursor->set & FB_CUR_SETPOS) { 89 if (cursor->set & FB_CUR_SETPOS) {
@@ -109,7 +113,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
109 y<<=1; 113 y<<=1;
110 h<<=1; 114 h<<=1;
111 } 115 }
112 wait_for_fifo(4, par); 116 wait_for_fifo(3, par);
113 aty_st_le32(CUR_OFFSET, (info->fix.smem_len >> 3) + (yoff << 1), par); 117 aty_st_le32(CUR_OFFSET, (info->fix.smem_len >> 3) + (yoff << 1), par);
114 aty_st_le32(CUR_HORZ_VERT_OFF, 118 aty_st_le32(CUR_HORZ_VERT_OFF,
115 ((u32) (64 - h + yoff) << 16) | xoff, par); 119 ((u32) (64 - h + yoff) << 16) | xoff, par);
@@ -177,11 +181,6 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
177 } 181 }
178 } 182 }
179 183
180 if (cursor->enable) {
181 wait_for_fifo(1, par);
182 aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
183 | HWCURSOR_ENABLE, par);
184 }
185 return 0; 184 return 0;
186} 185}
187 186