Skip to content

Commit a5830ce

Browse files
authored
Merge pull request #9102 from jepler/rpi-dvi-double-height
pico_dvi: support 640x240 and 800x240 (tested @1bpp)
2 parents 32aacd9 + 4a08387 commit a5830ce

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ports/raspberrypi/common-hal/picodvi/Framebuffer.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,14 @@ void common_hal_picodvi_framebuffer_construct(picodvi_framebuffer_obj_t *self,
144144
bool color_framebuffer = color_depth >= 8;
145145
const struct dvi_timing *timing = NULL;
146146
if ((width == 640 && height == 480) ||
147-
(width == 320 && height == 240)) {
147+
(width == 320 && height == 240) ||
148+
(width == 640 && height == 240)
149+
) {
148150
timing = &dvi_timing_640x480p_60hz;
149151
} else if ((width == 800 && height == 480) ||
150-
(width == 400 && height == 240)) {
152+
(width == 400 && height == 240) ||
153+
(width == 800 && height == 240)
154+
) {
151155
timing = &dvi_timing_800x480p_60hz;
152156
} else {
153157
if (height != 480 && height != 240) {
@@ -223,16 +227,15 @@ void common_hal_picodvi_framebuffer_construct(picodvi_framebuffer_obj_t *self,
223227
size_t tmds_bufs_per_scanline;
224228
size_t scanline_width = width;
225229
if (color_framebuffer) {
226-
dvi_vertical_repeat = 2;
227230
dvi_monochrome_tmds = false;
228231
tmds_bufs_per_scanline = 3;
229232
scanline_width *= 2;
230233
} else {
231-
dvi_vertical_repeat = 1;
232234
dvi_monochrome_tmds = true;
233235
// One tmds buffer is used for all three color outputs.
234236
tmds_bufs_per_scanline = 1;
235237
}
238+
dvi_vertical_repeat = timing->v_active_lines / self->height;
236239
self->pitch = (self->width * color_depth) / 8;
237240
// Align each row to words.
238241
if (self->pitch % sizeof(uint32_t) != 0) {

0 commit comments

Comments
 (0)