Skip to content

Commit

Permalink
hw/display: fix qemu_console_resize being called from the TCG thread
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Dec 12, 2023
1 parent f5de023 commit 53e8f0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hw/display/esp_rgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ static void esp_rgb_write(void *opaque, hwaddr addr,
s->height = MAX(s->height, 10);

/* Update the window size */
if (s->con) {
qemu_console_resize(s->con, s->width, s->height);
}
s->do_update_size = true;
break;

case A_RGB_UPDATE_STATUS:
Expand Down Expand Up @@ -147,6 +145,11 @@ static void rgb_update(void* opaque)
{
ESPRgbState* s = (ESPRgbState*) opaque;

if (s->con && s->do_update_size) {
qemu_console_resize(s->con, s->width, s->height);
s->do_update_size = false;
}

if (s->con && s->update_area) {
uint32_t src = s->color_content;
AddressSpace* src_as = NULL;
Expand Down
1 change: 1 addition & 0 deletions include/hw/display/esp_rgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ typedef struct ESPRgbState {
/* Window size */
uint32_t width;
uint32_t height;
bool do_update_size;

/* Update area */
bool update_area;
Expand Down

0 comments on commit 53e8f0a

Please sign in to comment.