* [PATCH] atyfb: speed up Mach64 cursor
@ 2009-03-17 21:04 Krzysztof Helt
2009-03-21 20:01 ` Ville Syrjälä
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Helt @ 2009-03-17 21:04 UTC (permalink / raw)
To: Linux-fbdev-devel; +Cc: Andrew Morton
From: Krzysztof Helt <krzysztof.h1@wp.pl>
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>
---
drivers/video/aty/mach64_cursor.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c
index faf95da..2eb3926 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)
if (par->asleep)
return -EPERM;
- /* Hide cursor */
wait_for_fifo(1, par);
- aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par) & ~HWCURSOR_ENABLE, par);
+ if (cursor->enable)
+ aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
+ | HWCURSOR_ENABLE, par);
+ else
+ aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
+ & ~HWCURSOR_ENABLE, par);
/* set position */
if (cursor->set & FB_CUR_SETPOS) {
@@ -109,7 +113,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
y<<=1;
h<<=1;
}
- wait_for_fifo(4, par);
+ wait_for_fifo(3, par);
aty_st_le32(CUR_OFFSET, (info->fix.smem_len >> 3) + (yoff << 1), par);
aty_st_le32(CUR_HORZ_VERT_OFF,
((u32) (64 - h + yoff) << 16) | xoff, par);
@@ -177,11 +181,6 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
}
}
- if (cursor->enable) {
- wait_for_fifo(1, par);
- aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
- | HWCURSOR_ENABLE, par);
- }
return 0;
}
--
1.5.2.2
----------------------------------------------------------------------
Dzwon taniej na zagraniczne komorki!
Sprawdz >> http://link.interia.pl/f20a2
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] atyfb: speed up Mach64 cursor
2009-03-17 21:04 [PATCH] atyfb: speed up Mach64 cursor Krzysztof Helt
@ 2009-03-21 20:01 ` Ville Syrjälä
2009-03-21 20:50 ` Krzysztof Helt
0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2009-03-21 20:01 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: Andrew Morton, Linux-fbdev-devel
On Tue, Mar 17, 2009 at 10:04:43PM +0100, Krzysztof Helt wrote:
> --- 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)
> if (par->asleep)
> return -EPERM;
>
> - /* Hide cursor */
> wait_for_fifo(1, par);
> - aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par) & ~HWCURSOR_ENABLE, par);
> + if (cursor->enable)
> + aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
> + | HWCURSOR_ENABLE, par);
> + else
> + aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
> + & ~HWCURSOR_ENABLE, par);
It looks like you are now enabling the cursor before the cursor image
is loaded or the cursor is moved to the correct position so the user
could briefly see a corrupted and/or misplaced cursor.
--
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] atyfb: speed up Mach64 cursor
2009-03-21 20:01 ` Ville Syrjälä
@ 2009-03-21 20:50 ` Krzysztof Helt
0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Helt @ 2009-03-21 20:50 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: Andrew Morton, Linux-fbdev-devel
On Sat, 21 Mar 2009 22:01:03 +0200
Ville Syrjälä <syrjala@sci.fi> wrote:
> On Tue, Mar 17, 2009 at 10:04:43PM +0100, Krzysztof Helt wrote:
> > --- 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)
> > if (par->asleep)
> > return -EPERM;
> >
> > - /* Hide cursor */
> > wait_for_fifo(1, par);
> > - aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par) & ~HWCURSOR_ENABLE, par);
> > + if (cursor->enable)
> > + aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
> > + | HWCURSOR_ENABLE, par);
> > + else
> > + aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, par)
> > + & ~HWCURSOR_ENABLE, par);
>
>
> It looks like you are now enabling the cursor before the cursor image
> is loaded or the cursor is moved to the correct position so the user
> could briefly see a corrupted and/or misplaced cursor.
>
Yes. At least two other drivers do the same (pm2fb and tdfxfb) and
I have never experienced problems with visible corrupted cursor.
This is probably unlikely as the cursor change must last longer
then one full screen refresh.
On the other hand, one wrote twice (cursor off and on) to
the chip every time the cursor position changed.
Also if the cursor was turned on the driver sent two writes
to the chip (off then on). This was redundant.
Regards,
Krzysztof
----------------------------------------------------------------------
Co mówi Waldek, kiedy nikt go nie widzi:?
Sprawd¼ >>> http://link.interia.pl/f20ab
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-21 20:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-17 21:04 [PATCH] atyfb: speed up Mach64 cursor Krzysztof Helt
2009-03-21 20:01 ` Ville Syrjälä
2009-03-21 20:50 ` Krzysztof Helt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).