Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions shared-module/framebufferio/lvgl/FramebufferDisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "shared-module/videocore/VideoBuffer.h"
#endif
#include "supervisor/port_heap.h"
#if CIRCUITPY_WEB_WORKFLOW
#include "supervisor/shared/web_workflow/display_stream.h"
#endif

#if CIRCUITPY_ESPIDF
#include "esp_attr.h"
Expand Down Expand Up @@ -191,6 +194,9 @@ static void framebufferio_lvgl_flush_cb(lv_display_t *disp, const lv_area_t *are
for (uint16_t y = area->y1; y <= area->y2; y++) {
MARK_ROW_DIRTY(y);
}
#if CIRCUITPY_WEB_WORKFLOW
display_stream_area_updated(&self->core, area);
#endif
} else {
lv_area_t rotated_area = *area;
lv_display_rotate_area(disp, &rotated_area);
Expand All @@ -205,6 +211,10 @@ static void framebufferio_lvgl_flush_cb(lv_display_t *disp, const lv_area_t *are
for (uint16_t y = rotated_area.y1; y <= rotated_area.y2; y++) {
MARK_ROW_DIRTY(y);
}
#if CIRCUITPY_WEB_WORKFLOW
// The stream reads the framebuffer, so it needs the area in the panel's orientation.
display_stream_area_updated(&self->core, &rotated_area);
#endif
}

// Publish each flushed area now. LVGL doesn't reliably report the last flush part in all
Expand Down
12 changes: 10 additions & 2 deletions supervisor/shared/web_workflow/display_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,12 @@ void display_stream_area_updated(displayio_display_core_t *core, const displayio
return;
}
if (core == target) {
#if CIRCUITPY_DISPLAYIO_LVGL
// An lv_area_t: the second corner is inclusive.
_mark_dirty(area->x1, area->y1, area->x2 + 1, area->y2 + 1);
#else
_mark_dirty(area->x1, area->y1, area->x2, area->y2);
#endif
}
// Another display may be a new one to switch to.
_pass_later();
Expand Down Expand Up @@ -463,8 +468,11 @@ static void _check_display(void) {
// The panel's size, whatever the rotation. The legacy compositor keeps it in the
// full refresh area; LVGL tracks invalidation itself, so the core keeps only the size.
#if CIRCUITPY_DISPLAYIO_LVGL
uint16_t new_width = core != NULL ? core->width : width;
uint16_t new_height = core != NULL ? core->height : height;
// The LVGL core keeps the rotated size, but the framebuffer read below is in
// the panel's own orientation, so swap them back when transposed.
bool transposed = core != NULL && (core->rotation == 90 || core->rotation == 270);
uint16_t new_width = core != NULL ? (transposed ? core->height : core->width) : width;
uint16_t new_height = core != NULL ? (transposed ? core->width : core->height) : height;
#else
uint16_t new_width = core != NULL ? core->area.x2 : width;
uint16_t new_height = core != NULL ? core->area.y2 : height;
Expand Down
Loading