From 6f66d2245dc6359f7de98796f5d999a308f74179 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 2 Jul 2009 11:49:07 +0300 Subject: [PATCH 141/146] DSS2: VRAM: add CONFIG_OMAP2_VRAM flag CONFIG_OMAP2_VRAM controls wheter VRAM manager is compiled in or not. Signed-off-by: Tomi Valkeinen --- arch/arm/plat-omap/Kconfig | 3 +++ arch/arm/plat-omap/Makefile | 3 ++- arch/arm/plat-omap/include/mach/vram.h | 22 ++++++++++++++++++++-- arch/arm/plat-omap/vram.c | 9 ++------- drivers/video/omap2/omapfb/Kconfig | 1 + 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index efe85d0..ca06037 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -183,6 +183,9 @@ config OMAP_SERIAL_WAKE to data on the serial RX line. This allows you to wake the system from serial console. +config OMAP2_VRAM + bool + endmenu endif diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index cfc0967..3232edc 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o vram.o vrfb.o io.o + usb.o fb.o vrfb.o io.o obj-m := obj-n := obj- := @@ -25,3 +25,4 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y) # OMAP mailbox framework obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o +obj-$(CONFIG_OMAP2_VRAM) += vram.o diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h index f6bb9fb..4f2c2e6 100644 --- a/arch/arm/plat-omap/include/mach/vram.h +++ b/arch/arm/plat-omap/include/mach/vram.h @@ -21,6 +21,7 @@ #ifndef __OMAP_VRAM_H__ #define __OMAP_VRAM_H__ +#include #include #define OMAP_VRAM_MEMTYPE_SDRAM 0 @@ -33,8 +34,10 @@ extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr); extern int omap_vram_reserve(unsigned long paddr, size_t size); extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram, unsigned long *largest_free_block); -extern void omap2_set_sdram_vram(u32 size, u32 start); -extern void omap2_set_sram_vram(u32 size, u32 start); + +#ifdef CONFIG_OMAP2_VRAM +extern void omap_vram_set_sdram_vram(u32 size, u32 start); +extern void omap_vram_set_sram_vram(u32 size, u32 start); extern void omap_vram_reserve_sdram(void); extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart, @@ -42,4 +45,19 @@ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart, unsigned long sram_size, unsigned long pstart_avail, unsigned long size_avail); +#else +static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { } +static inline void omap_vram_set_sram_vram(u32 size, u32 start) { } + +static inline void omap_vram_reserve_sdram(void) { } +static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart, + unsigned long sram_vstart, + unsigned long sram_size, + unsigned long pstart_avail, + unsigned long size_avail) +{ + return 0; +} +#endif + #endif diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c index 89ae1cf..634ce23 100644 --- a/arch/arm/plat-omap/vram.c +++ b/arch/arm/plat-omap/vram.c @@ -46,8 +46,6 @@ /* Maximum size, in reality this is smaller if SRAM is partially locked. */ #define OMAP2_SRAM_SIZE 0xa0000 /* 640k */ -#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) - /* postponed regions are used to temporarily store region information at boot * time when we cannot yet allocate the region list */ #define MAX_POSTPONED_REGIONS 10 @@ -644,17 +642,14 @@ unsigned long __init omap_vram_reserve_sram(unsigned long sram_pstart, return reserved; } -void __init omap2_set_sdram_vram(u32 size, u32 start) +void __init omap_vram_set_sdram_vram(u32 size, u32 start) { omap_vram_sdram_start = start; omap_vram_sdram_size = size; } -void __init omap2_set_sram_vram(u32 size, u32 start) +void __init omap_vram_set_sram_vram(u32 size, u32 start) { omap_vram_sram_start = start; omap_vram_sram_size = size; } - -#endif - diff --git a/drivers/video/omap2/omapfb/Kconfig b/drivers/video/omap2/omapfb/Kconfig index 4f66033..220c58b 100644 --- a/drivers/video/omap2/omapfb/Kconfig +++ b/drivers/video/omap2/omapfb/Kconfig @@ -2,6 +2,7 @@ menuconfig FB_OMAP2 tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)" depends on FB && OMAP2_DSS + select OMAP2_VRAM select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT -- 1.6.2.4