Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picodvi: support 640x240 and 800x240 (tested @1bpp) #9102

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions ports/raspberrypi/common-hal/picodvi/Framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ void common_hal_picodvi_framebuffer_construct(picodvi_framebuffer_obj_t *self,
bool color_framebuffer = color_depth >= 8;
const struct dvi_timing *timing = NULL;
if ((width == 640 && height == 480) ||
(width == 320 && height == 240)) {
(width == 320 && height == 240) ||
(width == 640 && height == 240)
) {
timing = &dvi_timing_640x480p_60hz;
} else if ((width == 800 && height == 480) ||
(width == 400 && height == 240)) {
(width == 400 && height == 240) ||
(width == 800 && height == 240) ||
dhalbert marked this conversation as resolved.
Show resolved Hide resolved
) {
timing = &dvi_timing_800x480p_60hz;
} else {
if (height != 480 && height != 240) {
Expand Down Expand Up @@ -223,16 +227,15 @@ void common_hal_picodvi_framebuffer_construct(picodvi_framebuffer_obj_t *self,
size_t tmds_bufs_per_scanline;
size_t scanline_width = width;
if (color_framebuffer) {
dvi_vertical_repeat = 2;
dvi_monochrome_tmds = false;
tmds_bufs_per_scanline = 3;
scanline_width *= 2;
} else {
dvi_vertical_repeat = 1;
dvi_monochrome_tmds = true;
// One tmds buffer is used for all three color outputs.
tmds_bufs_per_scanline = 1;
}
dvi_vertical_repeat = timing->v_active_lines / self->height;
self->pitch = (self->width * color_depth) / 8;
// Align each row to words.
if (self->pitch % sizeof(uint32_t) != 0) {
Expand Down
Loading