[FEATURE] Configurable video resolution RPi4B
Is your feature request related to a problem? Please describe.
Right now, the frame buffer implementation picks a static 1920x1080 resolution for video output. The Pi is capable of different resolutions though.
Describe the solution you'd like
There should be a way to negotiate this size, either through:
- Picking the maximum that the monitor is capable of
- Letting the user select a static value in Kconfig
- Implementing some kind of API in NuttX that allows changing the resolution (I am not sure if this is currently something NuttX's graphics APIs support)
Describe alternatives you've considered
The alternatives are the three listed above. One or a combination could be implemented.
Verification
- [x] I have verified before submitting the report.
@linguini1 besides Kconfig static configuration, the EDID protocol from HDMI could be used: https://en.wikipedia.org/wiki/Extended_Display_Identification_Data https://thehometheaterdiy.com/hdmi-edid/
But I don't know if we can change the LVGL resolution dynamically
Apparently we can: see here.
void lv_display_set_resolution(lv_display_t *disp, int32_t hor_res, int32_t ver_res)
I believe I don't have direct access to the EDID stuff in the Pi (?) since all the HDMI trickery is handled by the VideoCore. I know what I can do is 'test' if the screen is capable of a desired resolution through the video core, and then request the change to that resolution.
I would prefer the dynamic option to choosing it statically through Kconfig. I'd have to look at how I can implement the function that Tim mentioned in a way that works with the NuttX framebuffer lower-half. I didn't see an IOCTL for changing the framebuffer resolution, but then again, I didn't look beyond the Pinephone implementation which has a fixed screen on the device. Might do that in a bit!
Searching it on google it shows how to get this information on Linux:
So, there some way to get the EDID from the VideoCore
Hmmm, does that work for the RPi-OS though? I haven't seen a method documented anywhere but this might require looking at Linux code again