Skip to content

Commit b314193

Browse files
committed
FramebufferDisplay: dirty rows are physical
.. so they need a correct row count, which could be the "core.width" of a 90/180 rotated display. While I discovered this on the very unusual 320x960 display it could have affected any framebuffer display that was taller than it was wide, including sharp memory displays and rgbmatrix displays.
1 parent f80d08e commit b314193

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t *self) {
252252
displayio_display_core_start_refresh(&self->core);
253253
const displayio_area_t *current_area = _get_refresh_areas(self);
254254
if (current_area) {
255-
uint8_t dirty_row_bitmask[(self->core.height + 7) / 8];
255+
bool transposed = (self->core.rotation == 90 || self->core.rotation == 270);
256+
int row_count = transposed ? self->core.width : self->core.height;
257+
uint8_t dirty_row_bitmask[(row_count + 7) / 8];
256258
memset(dirty_row_bitmask, 0, sizeof(dirty_row_bitmask));
257259
self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo);
258260
while (current_area != NULL) {

0 commit comments

Comments
 (0)