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.
This commit is contained in:
Jeff Epler 2023-09-27 15:01:18 -05:00
parent f80d08e207
commit b3141933af
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -252,7 +252,9 @@ STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t *self) {
displayio_display_core_start_refresh(&self->core);
const displayio_area_t *current_area = _get_refresh_areas(self);
if (current_area) {
uint8_t dirty_row_bitmask[(self->core.height + 7) / 8];
bool transposed = (self->core.rotation == 90 || self->core.rotation == 270);
int row_count = transposed ? self->core.width : self->core.height;
uint8_t dirty_row_bitmask[(row_count + 7) / 8];
memset(dirty_row_bitmask, 0, sizeof(dirty_row_bitmask));
self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo);
while (current_area != NULL) {