At present the uclass stored frame buffer size is set to a hard
coded value, but we can calculate the correct value based on what
is configured.
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
{
struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
- /* Set the maximum supported resolution */
- uc_plat->size = 2560 * 1600 * 4;
+ /* Set the frame buffer size per configuration */
+ uc_plat->size = xsize * ysize * 32 / 8;
log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);
return 0;