]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
rockchip: video: Kconfig: set MAX_XRES and MAX_YRES via Kconfig
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Wed, 31 May 2017 15:59:29 +0000 (17:59 +0200)
committerSimon Glass <sjg@chromium.org>
Thu, 8 Jun 2017 03:30:49 +0000 (21:30 -0600)
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>
drivers/video/rockchip/Kconfig
drivers/video/rockchip/rk_vop.c

index 4ad2da579f28fe9ec65974124a866d3cad131aa6..b1d7c62fcade5880966de345c7b5d99141203dbe 100644 (file)
@@ -19,6 +19,24 @@ menuconfig VIDEO_ROCKCHIP
          This driver supports the on-chip video output device, and targets the
          Rockchip RK3288 and RK3399.
 
+config VIDEO_ROCKCHIP_MAX_XRES
+        int "Maximum horizontal resolution (for memory allocation purposes)"
+       depends on VIDEO_ROCKCHIP
+       default 1920
+       help
+         The maximum horizontal resolution to support for the framebuffer.
+         This configuration is used for reserving/allocating memory for the
+         framebuffer during device-model binding/probing.
+
+config VIDEO_ROCKCHIP_MAX_YRES
+        int "Maximum vertical resolution (for memory allocation purposes)"
+       depends on VIDEO_ROCKCHIP
+       default 1080
+       help
+         The maximum vertical resolution to support for the framebuffer.
+         This configuration is used for reserving/allocating memory for the
+         framebuffer during device-model binding/probing.
+
 if VIDEO_ROCKCHIP
 
 config DISPLAY_ROCKCHIP_EDP
index 48bfcd4f3406d7eb24edc239c36ffe5c79c62026..c612b554fc4641ae7fbda7dbc3a58c2e87c53541 100644 (file)
@@ -357,7 +357,8 @@ static int rk_vop_bind(struct udevice *dev)
 {
        struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
 
-       plat->size = 1920 * 1200 * 4;
+       plat->size = 4 * (CONFIG_VIDEO_ROCKCHIP_MAX_XRES *
+                         CONFIG_VIDEO_ROCKCHIP_MAX_YRES);
 
        return 0;
 }