1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-12-25 09:43:00 +02:00

ubb-vga: send a line's last DMA transfer also if only partially filled

This caused 800x600 images to be cut off, because the line length is
not a multiple of 64 bytes.

- ubb-vga.c (session): make the allocation a multiple of the DMA
  transfer size
- ubb-vga.c (line): round number of transfers up instead of down
- ubb-vga.c (mode_db): line duration of 800x600/54 was a bit to short
This commit is contained in:
Werner Almesberger 2011-05-02 05:25:15 -03:00
parent 3ea6b9852e
commit a3cea3573c

View File

@ -54,7 +54,7 @@ static const struct mode mode_db[] = {
{ "640x480/58", 640, 480, 12, 2, 10, 33, US(3.81), US(1.91), US(32.7) },
{ "640x480/70", 640, 480, 9, 2, 8, 29, US(1.90), US(2.06), US(24.8) },
{ "800x600/54", 800, 600, 8, 2, 32, 14, US(4.81), US(0.79), US(28.7) },
{ "800x600/54", 800, 600, 8, 2, 32, 14, US(4.81), US(0.79), US(28.8) },
{ "800x600/56", 800, 600, 8, 2, 1, 22, US(2.00), US(3.56), US(28.5) },
{ "800x600/72", 800, 600, 5, 3, 1, 27, US(2.14), US(2.70), US(22.0) },
@ -290,7 +290,7 @@ static void line(unsigned long line)
DCS(DMA) = 1 << 31;
DSA(DMA) = line;
DTA(DMA) = REG_PADDR(MSC_TXFIFO); /* MUST set this each time */
DTC(DMA) = mode->xres >> 6;
DTC(DMA) = (mode->xres+63) >> 6;
until(mode->hback_cycles);
@ -388,10 +388,12 @@ static void session(void (*gen)(void **fb, int xres, int yres), int frames)
{
void **f_virt;
const unsigned long *f_phys;
int i;
int i, bytes;
ccube_init();
f_virt = calloc_phys_vec(mode->yres, mode->xres/2);
bytes = mode->xres/2;
bytes = (bytes+31) & ~31;
f_virt = calloc_phys_vec(mode->yres, bytes);
gen(f_virt, mode->xres, mode->yres);
f_phys = xlat_virt(f_virt, mode->yres);