@@ -144,10 +144,14 @@ void common_hal_picodvi_framebuffer_construct(picodvi_framebuffer_obj_t *self,
144
144
bool color_framebuffer = color_depth >= 8 ;
145
145
const struct dvi_timing * timing = NULL ;
146
146
if ((width == 640 && height == 480 ) ||
147
- (width == 320 && height == 240 )) {
147
+ (width == 320 && height == 240 ) ||
148
+ (width == 640 && height == 240 )
149
+ ) {
148
150
timing = & dvi_timing_640x480p_60hz ;
149
151
} else if ((width == 800 && height == 480 ) ||
150
- (width == 400 && height == 240 )) {
152
+ (width == 400 && height == 240 ) ||
153
+ (width == 800 && height == 240 )
154
+ ) {
151
155
timing = & dvi_timing_800x480p_60hz ;
152
156
} else {
153
157
if (height != 480 && height != 240 ) {
@@ -223,16 +227,15 @@ void common_hal_picodvi_framebuffer_construct(picodvi_framebuffer_obj_t *self,
223
227
size_t tmds_bufs_per_scanline ;
224
228
size_t scanline_width = width ;
225
229
if (color_framebuffer ) {
226
- dvi_vertical_repeat = 2 ;
227
230
dvi_monochrome_tmds = false;
228
231
tmds_bufs_per_scanline = 3 ;
229
232
scanline_width *= 2 ;
230
233
} else {
231
- dvi_vertical_repeat = 1 ;
232
234
dvi_monochrome_tmds = true;
233
235
// One tmds buffer is used for all three color outputs.
234
236
tmds_bufs_per_scanline = 1 ;
235
237
}
238
+ dvi_vertical_repeat = timing -> v_active_lines / self -> height ;
236
239
self -> pitch = (self -> width * color_depth ) / 8 ;
237
240
// Align each row to words.
238
241
if (self -> pitch % sizeof (uint32_t ) != 0 ) {
0 commit comments