From 4480b32c500cacadefc6594eb319b0d5291c24b6 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 28 Apr 2011 12:30:22 -0300 Subject: [PATCH] ubb-vga2.c: corrected and improved loading of the first TX word - ubb-vga2.c (line): write the first word to the TX FIFO after starting the command or it is lost - ubb-vga2.c (line): fetch the first word while waiting for the back porch, making sure we have plenty of time for cache effects - ubb-vga2.c (line): we no longer need to prefetch the first word of the next line --- ubb-vga/ubb-vga2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ubb-vga/ubb-vga2.c b/ubb-vga/ubb-vga2.c index 8b75219..afc57f5 100644 --- a/ubb-vga/ubb-vga2.c +++ b/ubb-vga/ubb-vga2.c @@ -265,6 +265,7 @@ void setup(void) static void line(const uint32_t *line) { const uint32_t *p = line; + uint32_t first; /* Back porch */ @@ -273,7 +274,7 @@ static void line(const uint32_t *line) *msc_strpcl = 1 << 3; /* reset the MSC */ // while (*msc_stat & (1 << 15)); - *msc_txfifo = *p++; + first = *p++; until(US(0.79)); @@ -316,6 +317,8 @@ static void line(const uint32_t *line) /* Front porch */ + *msc_txfifo = first; + *pdfuns = CMD; *pddats = HSYNC; *pdfunc = CMD; @@ -344,7 +347,6 @@ static void line(const uint32_t *line) } fail: - (void) *(volatile const uint32_t *) p; until(line_cycles); }