diff mbox

[U-Boot,v4,2/9] rockchip: video: Kconfig: set MAX_XRES and MAX_YRES via Kconfig

Message ID 1496246386-61447-3-git-send-email-philipp.tomsich@theobroma-systems.com
State Accepted
Commit 89b2b6186d259014c217d887463a5030d0c5f23a
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Philipp Tomsich May 31, 2017, 3:59 p.m. UTC
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>

---

Changes in v4:
- added to break down into smaller changes

Changes in v3: None
Changes in v2: None

 drivers/video/rockchip/Kconfig  | 18 ++++++++++++++++++
 drivers/video/rockchip/rk_vop.c |  3 ++-
 2 files changed, 20 insertions(+), 1 deletion(-)

Comments

Simon Glass June 2, 2017, 2:54 a.m. UTC | #1
On 31 May 2017 at 09:59, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> 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>
>
> ---
>
> Changes in v4:
> - added to break down into smaller changes
>
> Changes in v3: None
> Changes in v2: None
>
>  drivers/video/rockchip/Kconfig  | 18 ++++++++++++++++++
>  drivers/video/rockchip/rk_vop.c |  3 ++-
>  2 files changed, 20 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Anatolij Gustschin June 2, 2017, 12:46 p.m. UTC | #2
On Wed, 31 May 2017 17:59:29 +0200
Philipp Tomsich philipp.tomsich@theobroma-systems.com wrote:
...
> Changes in v4:
> - added to break down into smaller changes
> 
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/video/rockchip/Kconfig  | 18 ++++++++++++++++++
>  drivers/video/rockchip/rk_vop.c |  3 ++-
>  2 files changed, 20 insertions(+), 1 deletion(-)

applied to u-boot-video/master, thanks!

--
Anatolij
diff mbox

Patch

diff --git a/drivers/video/rockchip/Kconfig b/drivers/video/rockchip/Kconfig
index 4ad2da5..b1d7c62 100644
--- a/drivers/video/rockchip/Kconfig
+++ b/drivers/video/rockchip/Kconfig
@@ -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
diff --git a/drivers/video/rockchip/rk_vop.c b/drivers/video/rockchip/rk_vop.c
index aa6ca8c..16d1484 100644
--- a/drivers/video/rockchip/rk_vop.c
+++ b/drivers/video/rockchip/rk_vop.c
@@ -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;
 }