From e8e3fa9fbeb128efc8baca55ebc9fcef5c9c3b63 Mon Sep 17 00:00:00 2001 From: Dandawate Saket Date: Tue, 24 Jul 2012 13:41:31 -0700 Subject: [PATCH] OMAPDSS: OMAPFB : Add support for VRAM size read Add support to read vram size set by board file. This value is then used in to create framebuffers in vram. If the board file doesnt set the memory region then vram which can fit in only 1 flip chain buffer is allocated. Change-Id: I5c53af56eafe70ae1fba0212f2a17e66e4381c88 Signed-off-by: Dandawate Saket --- drivers/video/omap2/omapfb/omapfb-main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index ca585ef37f2..c6214e5d18c 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -1566,6 +1566,23 @@ static int omapfb_allocate_all_fbs(struct omapfb2_device *fbdev) memset(&vram_paddrs, 0, sizeof(vram_paddrs)); } + if (fbdev->dev->platform_data) { + struct omapfb_platform_data *opd; + opd = fbdev->dev->platform_data; + for (i = 0; i < opd->mem_desc.region_cnt; ++i) { + if (!vram_sizes[i]) { + unsigned long size; + unsigned long paddr; + + size = opd->mem_desc.region[i].size; + paddr = opd->mem_desc.region[i].paddr; + + vram_sizes[i] = size; + vram_paddrs[i] = paddr; + } + } + } + for (i = 0; i < fbdev->num_fbs; i++) { /* allocate memory automatically only for fb0, or if * excplicitly defined with vram or plat data option */ -- 2.39.2