# HG changeset patch # User Paul Boddie # Date 1540315795 -7200 # Node ID 24065fd1609fd665ea5dbfa97cb96cd755586cb2 # Parent d00ca7551358958605b63c85c66c2b630bf2d2da Introduced various definitions for transfer and display-related properties. Removed obsolete definitions from the vga-pmp example. diff -r d00ca7551358 -r 24065fd1609f examples/vga-pmp/main.c --- a/examples/vga-pmp/main.c Tue Oct 23 19:17:34 2018 +0200 +++ b/examples/vga-pmp/main.c Tue Oct 23 19:29:55 2018 +0200 @@ -107,7 +107,7 @@ dma_set_interrupt(0, T2, 1); dma_set_transfer(0, PHYSICAL((uint32_t) linedata), LINE_LENGTH, HW_PHYSICAL(PM_REG(0, PMxDIN)), 1, - LINE_LENGTH); + TRANSFER_CELL_SIZE); dma_init_interrupt(0, 0b1000, 1, 3); /* Enable DMA on the preceding channel's completion, with this also diff -r d00ca7551358 -r 24065fd1609f examples/vga-pmp/vga.h --- a/examples/vga-pmp/vga.h Tue Oct 23 19:17:34 2018 +0200 +++ b/examples/vga-pmp/vga.h Tue Oct 23 19:29:55 2018 +0200 @@ -22,6 +22,7 @@ #define LINE_LENGTH 160 /* pixels */ #define LINE_COUNT 256 /* distinct display lines */ +#define LINE_MULTIPLIER 2 #define ZERO_LENGTH 1 /* pixels */ @@ -35,7 +36,7 @@ /* Horizontal lines, back porch end. */ #define VISIBLE_START 70 -#define VFP_START (VISIBLE_START + 2 * LINE_COUNT) +#define VFP_START (VISIBLE_START + LINE_MULTIPLIER * LINE_COUNT) /* Horizontal lines, front porch end. */ @@ -45,11 +46,13 @@ #define VSYNC_END 622 -#define SCREEN_BASE 256 -#define SCREEN_SIZE (40 * 1024) -#define SCREEN_LIMIT (SCREEN_BASE + SCREEN_SIZE) +/* Framebuffer properties. */ + +#define SCREEN_SIZE (LINE_LENGTH * LINE_COUNT) -#define SCREEN_BASE_KSEG0 (KSEG0_BASE + SCREEN_BASE) -#define SCREEN_LIMIT_KSEG0 (KSEG0_BASE + SCREEN_LIMIT) +/* Transfer and pixel allocation properties. */ + +#define TRANSFER_CELL_SIZE LINE_LENGTH +#define CELL_SIZE LINE_LENGTH #endif /* __VGA_H__ */ diff -r d00ca7551358 -r 24065fd1609f examples/vga/main.c --- a/examples/vga/main.c Tue Oct 23 19:17:34 2018 +0200 +++ b/examples/vga/main.c Tue Oct 23 19:29:55 2018 +0200 @@ -103,7 +103,7 @@ dma_set_interrupt(0, T2, 1); dma_set_transfer(0, PHYSICAL((uint32_t) screenstart), LINE_LENGTH, HW_PHYSICAL(PORTB), 1, - LINE_LENGTH); + TRANSFER_CELL_SIZE); /* Enable DMA on the preceding channel's completion, with the timer event initiating the transfer. */ diff -r d00ca7551358 -r 24065fd1609f examples/vga/vga.h --- a/examples/vga/vga.h Tue Oct 23 19:17:34 2018 +0200 +++ b/examples/vga/vga.h Tue Oct 23 19:29:55 2018 +0200 @@ -22,6 +22,7 @@ #define LINE_LENGTH 160 /* pixels */ #define LINE_COUNT 256 /* distinct display lines */ +#define LINE_MULTIPLIER 2 #define ZERO_LENGTH 1 /* pixels */ @@ -35,7 +36,7 @@ /* Horizontal lines, back porch end. */ #define VISIBLE_START 70 -#define VFP_START (VISIBLE_START + 2 * LINE_COUNT) +#define VFP_START (VISIBLE_START + LINE_MULTIPLIER * LINE_COUNT) /* Horizontal lines, front porch end. */ @@ -48,6 +49,10 @@ /* Framebuffer properties. */ #define SCREEN_SIZE (LINE_LENGTH * LINE_COUNT) -#define LINE_MULTIPLIER 2 + +/* Transfer and pixel allocation properties. */ + +#define TRANSFER_CELL_SIZE LINE_LENGTH +#define CELL_SIZE LINE_LENGTH #endif /* __VGA_H__ */