Commit 89b2b6186d259014c217d887463a5030d0c5f23a

Authored by Philipp Tomsich
Committed by Simon Glass
1 parent d4bee08419

rockchip: video: Kconfig: set MAX_XRES and MAX_YRES via Kconfig

This introduces two new Kconfig options that configure the maximum
allowable framebuffer size (i.e. the memory reservation/allocation for
the framebuffer):
 - VIDEO_ROCKCHIP_MAX_XRES
 - VIDEO_ROCKCHIP_MAX_YRES
The resulting memory allocation will cover 4 byte per pixel for these
resolutions.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 20 additions and 1 deletions Side-by-side Diff

drivers/video/rockchip/Kconfig
... ... @@ -19,6 +19,24 @@
19 19 This driver supports the on-chip video output device, and targets the
20 20 Rockchip RK3288 and RK3399.
21 21  
  22 +config VIDEO_ROCKCHIP_MAX_XRES
  23 + int "Maximum horizontal resolution (for memory allocation purposes)"
  24 + depends on VIDEO_ROCKCHIP
  25 + default 1920
  26 + help
  27 + The maximum horizontal resolution to support for the framebuffer.
  28 + This configuration is used for reserving/allocating memory for the
  29 + framebuffer during device-model binding/probing.
  30 +
  31 +config VIDEO_ROCKCHIP_MAX_YRES
  32 + int "Maximum vertical resolution (for memory allocation purposes)"
  33 + depends on VIDEO_ROCKCHIP
  34 + default 1080
  35 + help
  36 + The maximum vertical resolution to support for the framebuffer.
  37 + This configuration is used for reserving/allocating memory for the
  38 + framebuffer during device-model binding/probing.
  39 +
22 40 if VIDEO_ROCKCHIP
23 41  
24 42 config DISPLAY_ROCKCHIP_EDP
drivers/video/rockchip/rk_vop.c
... ... @@ -357,7 +357,8 @@
357 357 {
358 358 struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
359 359  
360   - plat->size = 1920 * 1200 * 4;
  360 + plat->size = 4 * (CONFIG_VIDEO_ROCKCHIP_MAX_XRES *
  361 + CONFIG_VIDEO_ROCKCHIP_MAX_YRES);
361 362  
362 363 return 0;
363 364 }