Skip to content

LVGL SDL Disp Resizing #18461

Closed
Closed
@tvanfossen

Description

When running a native application using the SDL driver, lvgl_init sets the display size used by the LVGL display driver.

When using an actual LCD, ths display driver ver/hor resolution are set after the driver has been initialized as below:
image

For a native application using SDL, I have not been able to resize the display outside of performing a similar action as above, but for SDL.

For reference, I have attempted editing lv_drv_conf.h under the lv_drivers pkg

image

editing SDL_HOR_RES and SDL_VER_RES does not adjust the screen size and the SDL display always runs at the default 320x240 size as defined in lv_disp_drv_init below:

image

Alternatively, I also attempted editing lvgl_riot_conf to a similar end, but the result remained an lvgl display window of 320x240.

The SDL window itself will map to the SDL_HOR_RES/SDL_VER_RES size, but the LVGL display window always remains unchanged at 320x240.

In order to resolve this, the simplest solution seemed to be passing LCD_SCREEN_WIDTH/LCD_SCREEN_HEIGHT into the display driver, LCD_SCREEN_WIDTH/HEIGHT being passed in as CFLAGS in a pkg Makefile.include

image

Passing disp_dev_width/height into the disp_drv for SDL results in a kernel panic

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions