1.1 --- a/examples/vga-pmp/main.c Tue Oct 23 19:17:34 2018 +0200
1.2 +++ b/examples/vga-pmp/main.c Tue Oct 23 19:29:55 2018 +0200
1.3 @@ -107,7 +107,7 @@
1.4 dma_set_interrupt(0, T2, 1);
1.5 dma_set_transfer(0, PHYSICAL((uint32_t) linedata), LINE_LENGTH,
1.6 HW_PHYSICAL(PM_REG(0, PMxDIN)), 1,
1.7 - LINE_LENGTH);
1.8 + TRANSFER_CELL_SIZE);
1.9 dma_init_interrupt(0, 0b1000, 1, 3);
1.10
1.11 /* Enable DMA on the preceding channel's completion, with this also
2.1 --- a/examples/vga-pmp/vga.h Tue Oct 23 19:17:34 2018 +0200
2.2 +++ b/examples/vga-pmp/vga.h Tue Oct 23 19:29:55 2018 +0200
2.3 @@ -22,6 +22,7 @@
2.4
2.5 #define LINE_LENGTH 160 /* pixels */
2.6 #define LINE_COUNT 256 /* distinct display lines */
2.7 +#define LINE_MULTIPLIER 2
2.8
2.9 #define ZERO_LENGTH 1 /* pixels */
2.10
2.11 @@ -35,7 +36,7 @@
2.12 /* Horizontal lines, back porch end. */
2.13
2.14 #define VISIBLE_START 70
2.15 -#define VFP_START (VISIBLE_START + 2 * LINE_COUNT)
2.16 +#define VFP_START (VISIBLE_START + LINE_MULTIPLIER * LINE_COUNT)
2.17
2.18 /* Horizontal lines, front porch end. */
2.19
2.20 @@ -45,11 +46,13 @@
2.21
2.22 #define VSYNC_END 622
2.23
2.24 -#define SCREEN_BASE 256
2.25 -#define SCREEN_SIZE (40 * 1024)
2.26 -#define SCREEN_LIMIT (SCREEN_BASE + SCREEN_SIZE)
2.27 +/* Framebuffer properties. */
2.28 +
2.29 +#define SCREEN_SIZE (LINE_LENGTH * LINE_COUNT)
2.30
2.31 -#define SCREEN_BASE_KSEG0 (KSEG0_BASE + SCREEN_BASE)
2.32 -#define SCREEN_LIMIT_KSEG0 (KSEG0_BASE + SCREEN_LIMIT)
2.33 +/* Transfer and pixel allocation properties. */
2.34 +
2.35 +#define TRANSFER_CELL_SIZE LINE_LENGTH
2.36 +#define CELL_SIZE LINE_LENGTH
2.37
2.38 #endif /* __VGA_H__ */
3.1 --- a/examples/vga/main.c Tue Oct 23 19:17:34 2018 +0200
3.2 +++ b/examples/vga/main.c Tue Oct 23 19:29:55 2018 +0200
3.3 @@ -103,7 +103,7 @@
3.4 dma_set_interrupt(0, T2, 1);
3.5 dma_set_transfer(0, PHYSICAL((uint32_t) screenstart), LINE_LENGTH,
3.6 HW_PHYSICAL(PORTB), 1,
3.7 - LINE_LENGTH);
3.8 + TRANSFER_CELL_SIZE);
3.9
3.10 /* Enable DMA on the preceding channel's completion, with the timer event
3.11 initiating the transfer. */
4.1 --- a/examples/vga/vga.h Tue Oct 23 19:17:34 2018 +0200
4.2 +++ b/examples/vga/vga.h Tue Oct 23 19:29:55 2018 +0200
4.3 @@ -22,6 +22,7 @@
4.4
4.5 #define LINE_LENGTH 160 /* pixels */
4.6 #define LINE_COUNT 256 /* distinct display lines */
4.7 +#define LINE_MULTIPLIER 2
4.8
4.9 #define ZERO_LENGTH 1 /* pixels */
4.10
4.11 @@ -35,7 +36,7 @@
4.12 /* Horizontal lines, back porch end. */
4.13
4.14 #define VISIBLE_START 70
4.15 -#define VFP_START (VISIBLE_START + 2 * LINE_COUNT)
4.16 +#define VFP_START (VISIBLE_START + LINE_MULTIPLIER * LINE_COUNT)
4.17
4.18 /* Horizontal lines, front porch end. */
4.19
4.20 @@ -48,6 +49,10 @@
4.21 /* Framebuffer properties. */
4.22
4.23 #define SCREEN_SIZE (LINE_LENGTH * LINE_COUNT)
4.24 -#define LINE_MULTIPLIER 2
4.25 +
4.26 +/* Transfer and pixel allocation properties. */
4.27 +
4.28 +#define TRANSFER_CELL_SIZE LINE_LENGTH
4.29 +#define CELL_SIZE LINE_LENGTH
4.30
4.31 #endif /* __VGA_H__ */