Re: SM501: Implement acceleration features

From: Ben Dooks
Date: Wed Nov 11 2009 - 17:27:55 EST


Vincent Sanders wrote:
On Wed, Nov 11, 2009 at 12:58:25AM +0100, Krzysztof Helt wrote:
On Tue, 10 Nov 2009 17:18:10 +0000
Ben Dooks <ben@xxxxxxxxxxxx> wrote:

From: Vincent Sanders <vince@xxxxxxxxxxxx>

This patch provides the acceleration entry points for the SM501
framebuffer driver.

This patch provides the sync, copyarea and fillrect entry points,
using the SM501's 2D acceleration engine to perform the operations
in-chip rather than across the bus.

Signed-off-by: Vincent Sanders <vince@xxxxxxxxxxxx>
Signed-off-by: Simtec Linux Team <linux@xxxxxxxxxxxx>
Signed-off-by: Ben Dooks <ben@xxxxxxxxxxxx>

---
drivers/video/sm501fb.c | 238 ++++++++++++++++++++++++++++++++++++++++++---
include/linux/sm501-regs.h | 2 2 files changed, 226 insertions(+), 14 deletions(-)

Index: b/drivers/video/sm501fb.c
===================================================================
--- a/drivers/video/sm501fb.c 2009-11-03 11:19:44.000000000 +0000
+++ b/drivers/video/sm501fb.c 2009-11-03 11:19:46.000000000 +0000

I have snipped all but small amount for context

+ /* wait for the 2d engine to be ready */
+ while ((count > 0) &&
+ (readl(fbi->regs + SM501_SYSTEM_CONTROL) &
+ SM501_SYSCTRL_2D_ENGINE_STATUS) != 0)
+ count--;
+
You may add cpu_relax() inside this loop.


ok, would need to test this thoroughly as the SM501 has some...odd
behaviours (see later on).

+
+ if (sm501fb_sync(info))
+ return;
+
Please check if you need to wait for the blit engine before writting
to any register. Usually, the values in the bit engine registers
are shadowed after the engine is started (ie. the blitting operation
is started) and the next set of values can be written into the regs.

indeed, if it were sane I would agree, it isnt in all circumstances, see later

It might be worth caching the data that relies on bpp after set_par
call, and thus avoiding another swtich on bpp in the acceleration
routines.

Otherwise not much else to say.

--
Ben Dooks, Software Engineer, Simtec Electronics

http://www.simtec.co.uk/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/