diff options
Diffstat (limited to 'recipes/linux/linux-omap-2.6.29')
23 files changed, 1822 insertions, 0 deletions
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch b/recipes/linux/linux-omap-2.6.29/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch new file mode 100644 index 0000000000..ae777ed04e --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch @@ -0,0 +1,33 @@ +From 30c40f5e6b1794430f678bf23d3319354321cab7 Mon Sep 17 00:00:00 2001 +From: Imre Deak <imre.deak@nokia.com> +Date: Tue, 14 Apr 2009 14:50:11 +0200 +Subject: [PATCH] DSS2: do bootmem reserve for exclusive access + +BOOTMEM_DEFAULT would allow multiple reservations for the same location, +we need to reserve the region for our exclusive use. Also check if the +reserve succeeded. + +Signed-off-by: Imre Deak <imre.deak@nokia.com> +--- + arch/arm/plat-omap/vram.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c +index f24a110..520f260 100644 +--- a/arch/arm/plat-omap/vram.c ++++ b/arch/arm/plat-omap/vram.c +@@ -524,7 +524,10 @@ void __init omapfb_reserve_sdram(void) + return; + } + +- reserve_bootmem(paddr, size, BOOTMEM_DEFAULT); ++ if (reserve_bootmem(paddr, size, BOOTMEM_EXCLUSIVE) < 0) { ++ pr_err("FB: failed to reserve VRAM\n"); ++ return; ++ } + } else { + if (size > sdram_size) { + printk(KERN_ERR "Illegal SDRAM size for VRAM\n"); +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch b/recipes/linux/linux-omap-2.6.29/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch new file mode 100644 index 0000000000..4959a760b1 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch @@ -0,0 +1,35 @@ +From ed7a9223f6785be03951c55f3b0695b0d5635c80 Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com> +Date: Thu, 9 Apr 2009 15:04:44 +0200 +Subject: [PATCH] DSS2: Fix DISPC_VID_FIR value for omap34xx +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +The msbs of the DISPC_VID_FIR fields were incorrectly masked out on +omap34xx and thus 4:1 downscale did not work correctly. + +Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> +--- + drivers/video/omap2/dss/dispc.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c +index 076d3d4..b8a3329 100644 +--- a/drivers/video/omap2/dss/dispc.c ++++ b/drivers/video/omap2/dss/dispc.c +@@ -994,7 +994,10 @@ static void _dispc_set_fir(enum omap_plane plane, int hinc, int vinc) + + BUG_ON(plane == OMAP_DSS_GFX); + +- val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0); ++ if (cpu_is_omap24xx()) ++ val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0); ++ else ++ val = FLD_VAL(vinc, 28, 16) | FLD_VAL(hinc, 12, 0); + dispc_write_reg(fir_reg[plane-1], val); + } + +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0033-DSS2-Prefer-3-tap-filter.patch b/recipes/linux/linux-omap-2.6.29/dss2/0033-DSS2-Prefer-3-tap-filter.patch new file mode 100644 index 0000000000..f643ca64f3 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0033-DSS2-Prefer-3-tap-filter.patch @@ -0,0 +1,82 @@ +From 5390230ed12585a79683733209db34e9130b8e3b Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com> +Date: Thu, 9 Apr 2009 15:04:43 +0200 +Subject: [PATCH] DSS2: Prefer 3-tap filter +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +The 5-tap filter seems rather unstable. With some scaling settings it +works and with some it doesn't even though the functional clock remains +within the TRM limits. So prefer the 3-tap filter unless the functional +clock required for it is too high. + +Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> +--- + drivers/video/omap2/dss/dispc.c | 27 ++++++++++++--------------- + 1 files changed, 12 insertions(+), 15 deletions(-) + +diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c +index b8a3329..b631dd8 100644 +--- a/drivers/video/omap2/dss/dispc.c ++++ b/drivers/video/omap2/dss/dispc.c +@@ -1405,15 +1405,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height, + } + + static unsigned long calc_fclk(u16 width, u16 height, +- u16 out_width, u16 out_height, +- enum omap_color_mode color_mode, bool five_taps) ++ u16 out_width, u16 out_height) + { + unsigned int hf, vf; + +- if (five_taps) +- return calc_fclk_five_taps(width, height, +- out_width, out_height, color_mode); +- + /* + * FIXME how to determine the 'A' factor + * for the no downscaling case ? +@@ -1494,7 +1489,7 @@ static int _dispc_setup_plane(enum omap_plane plane, + } else { + /* video plane */ + +- unsigned long fclk; ++ unsigned long fclk = 0; + + if (out_width < width / maxdownscale || + out_width > width * 8) +@@ -1530,20 +1525,22 @@ static int _dispc_setup_plane(enum omap_plane plane, + /* Must use 5-tap filter? */ + five_taps = height > out_height * 2; + +- /* Try to use 5-tap filter whenever possible. */ +- if (cpu_is_omap34xx() && !five_taps && +- height > out_height && width <= 1024) { +- fclk = calc_fclk_five_taps(width, height, +- out_width, out_height, color_mode); +- if (fclk <= dispc_fclk_rate()) ++ if (!five_taps) { ++ fclk = calc_fclk(width, height, ++ out_width, out_height); ++ ++ /* Try 5-tap filter if 3-tap fclk is too high */ ++ if (cpu_is_omap34xx() && height > out_height && ++ fclk > dispc_fclk_rate()) + five_taps = true; + } + + if (width > (2048 >> five_taps)) + return -EINVAL; + +- fclk = calc_fclk(width, height, out_width, out_height, +- color_mode, five_taps); ++ if (five_taps) ++ fclk = calc_fclk_five_taps(width, height, ++ out_width, out_height, color_mode); + + DSSDBG("required fclk rate = %lu Hz\n", fclk); + DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate()); +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch b/recipes/linux/linux-omap-2.6.29/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch new file mode 100644 index 0000000000..fdfc25fb47 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch @@ -0,0 +1,135 @@ +From 946eb774e95cdc2f2fa5cdc24aa69229f82814b8 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Thu, 16 Apr 2009 17:56:00 +0300 +Subject: [PATCH] DSS2: VRAM: improve omap_vram_add_region() + +Combine postponed and non-posponed versions of omap_vram_add_region. +Make the func non-static, so it can be called from board files. +--- + arch/arm/plat-omap/include/mach/vram.h | 1 + + arch/arm/plat-omap/vram.c | 54 +++++++++++++------------------ + 2 files changed, 24 insertions(+), 31 deletions(-) + +diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h +index f176562..8639e08 100644 +--- a/arch/arm/plat-omap/include/mach/vram.h ++++ b/arch/arm/plat-omap/include/mach/vram.h +@@ -24,6 +24,7 @@ + + #include <asm/types.h> + ++extern int omap_vram_add_region(unsigned long paddr, size_t size); + extern int omap_vram_free(unsigned long paddr, size_t size); + extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr); + extern int omap_vram_reserve(unsigned long paddr, size_t size); +diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c +index 520f260..8e9fe77 100644 +--- a/arch/arm/plat-omap/vram.c ++++ b/arch/arm/plat-omap/vram.c +@@ -60,6 +60,7 @@ + * time when we cannot yet allocate the region list */ + #define MAX_POSTPONED_REGIONS 10 + ++static bool vram_initialized; + static int postponed_cnt __initdata; + static struct { + unsigned long paddr; +@@ -145,39 +146,32 @@ static void omap_vram_free_allocation(struct vram_alloc *va) + kfree(va); + } + +-static __init int omap_vram_add_region_postponed(unsigned long paddr, +- size_t size) +-{ +- if (postponed_cnt == MAX_POSTPONED_REGIONS) +- return -ENOMEM; +- +- postponed_regions[postponed_cnt].paddr = paddr; +- postponed_regions[postponed_cnt].size = size; +- +- ++postponed_cnt; +- +- return 0; +-} +- +-/* add/remove_region can be exported if there's need to add/remove regions +- * runtime */ +-static int omap_vram_add_region(unsigned long paddr, size_t size) ++int omap_vram_add_region(unsigned long paddr, size_t size) + { + struct vram_region *rm; + unsigned pages; + +- DBG("adding region paddr %08lx size %d\n", +- paddr, size); ++ if (vram_initialized) { ++ DBG("adding region paddr %08lx size %d\n", ++ paddr, size); + +- size &= PAGE_MASK; +- pages = size >> PAGE_SHIFT; ++ size &= PAGE_MASK; ++ pages = size >> PAGE_SHIFT; + +- rm = omap_vram_create_region(paddr, pages); +- if (rm == NULL) +- return -ENOMEM; ++ rm = omap_vram_create_region(paddr, pages); ++ if (rm == NULL) ++ return -ENOMEM; ++ ++ list_add(&rm->list, ®ion_list); ++ } else { ++ if (postponed_cnt == MAX_POSTPONED_REGIONS) ++ return -ENOMEM; + +- list_add(&rm->list, ®ion_list); ++ postponed_regions[postponed_cnt].paddr = paddr; ++ postponed_regions[postponed_cnt].size = size; + ++ ++postponed_cnt; ++ } + return 0; + } + +@@ -438,6 +432,8 @@ static __init int omap_vram_init(void) + { + int i, r; + ++ vram_initialized = 1; ++ + for (i = 0; i < postponed_cnt; i++) + omap_vram_add_region(postponed_regions[i].paddr, + postponed_regions[i].size); +@@ -472,10 +468,6 @@ static void __init omapfb_early_vram(char **p) + omapfb_def_sdram_vram_size = memparse(*p, p); + if (**p == ',') + omapfb_def_sdram_vram_start = simple_strtoul((*p) + 1, p, 16); +- +- printk("omapfb_early_vram, %d, 0x%x\n", +- omapfb_def_sdram_vram_size, +- omapfb_def_sdram_vram_start); + } + __early_param("vram=", omapfb_early_vram); + +@@ -538,7 +530,7 @@ void __init omapfb_reserve_sdram(void) + BUG_ON(paddr & ~PAGE_MASK); + } + +- omap_vram_add_region_postponed(paddr, size); ++ omap_vram_add_region(paddr, size); + + pr_info("Reserving %u bytes SDRAM for VRAM\n", size); + } +@@ -594,7 +586,7 @@ unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart, + reserved = pend_avail - paddr; + size_avail = pend_avail - reserved - pstart_avail; + +- omap_vram_add_region_postponed(paddr, size); ++ omap_vram_add_region(paddr, size); + + if (reserved) + pr_info("Reserving %lu bytes SRAM for VRAM\n", reserved); +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch b/recipes/linux/linux-omap-2.6.29/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch new file mode 100644 index 0000000000..b7b395458f --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch @@ -0,0 +1,66 @@ +From f825cafd5ee5c600218740507f85594c825b0c00 Mon Sep 17 00:00:00 2001 +From: Hardik Shah <hardik.shah@ti.com> +Date: Thu, 16 Apr 2009 18:47:49 +0530 +Subject: [PATCH] DSS2: Added the function pointer for getting default color. + +V4L2 Framework has a CID for getting/setting default color. +So added the function pointer for doing same. +SYSFS based getting the default color will remain same + +Signed-off-by: Hardik Shah <hardik.shah@ti.com> +--- + arch/arm/plat-omap/include/mach/display.h | 1 + + drivers/video/omap2/dss/manager.c | 11 +++++++---- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h +index b0a6272..073cdda 100644 +--- a/arch/arm/plat-omap/include/mach/display.h ++++ b/arch/arm/plat-omap/include/mach/display.h +@@ -414,6 +414,7 @@ struct omap_overlay_manager { + int (*apply)(struct omap_overlay_manager *mgr); + + void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color); ++ u32 (*get_default_color)(struct omap_overlay_manager *mgr); + void (*set_trans_key)(struct omap_overlay_manager *mgr, + enum omap_dss_color_key_type type, + u32 trans_key); +diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c +index 8ca0bbb..12cf7b0 100644 +--- a/drivers/video/omap2/dss/manager.c ++++ b/drivers/video/omap2/dss/manager.c +@@ -98,10 +98,8 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const cha + static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr, + char *buf) + { +- u32 default_color; +- +- default_color = dispc_get_default_color(mgr->id); +- return snprintf(buf, PAGE_SIZE, "%d", default_color); ++ return snprintf(buf, PAGE_SIZE, "%d", ++ mgr->get_default_color(mgr)); + } + + static ssize_t manager_default_color_store(struct omap_overlay_manager *mgr, +@@ -470,6 +468,10 @@ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr, + { + dispc_enable_trans_key(mgr->id, enable); + } ++static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr) ++{ ++ return dispc_get_default_color(mgr->id); ++} + + static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager) + { +@@ -512,6 +514,7 @@ int dss_init_overlay_managers(struct platform_device *pdev) + mgr->set_default_color = &omap_dss_mgr_set_def_color, + mgr->set_trans_key = &omap_dss_mgr_set_trans_key, + mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key, ++ mgr->get_default_color = &omap_dss_mgr_get_default_color; + mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC, + + dss_overlay_setup_dispc_manager(mgr); +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch b/recipes/linux/linux-omap-2.6.29/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch new file mode 100644 index 0000000000..c6e9f16b3a --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch @@ -0,0 +1,118 @@ +From 6c56dc10226c84f41917ac2117b0e654fa080d40 Mon Sep 17 00:00:00 2001 +From: Hardik Shah <hardik.shah@ti.com> +Date: Thu, 16 Apr 2009 19:00:11 +0530 +Subject: [PATCH] DSS2: Added support for setting and querying alpha blending. + +Signed-off-by: Hardik Shah <hardik.shah@ti.com> +--- + arch/arm/plat-omap/include/mach/display.h | 3 +++ + drivers/video/omap2/dss/dispc.c | 26 ++++++++++++++++++++++++++ + drivers/video/omap2/dss/dss.h | 2 ++ + drivers/video/omap2/dss/manager.c | 14 ++++++++++++++ + 4 files changed, 45 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h +index 073cdda..e1f615a 100644 +--- a/arch/arm/plat-omap/include/mach/display.h ++++ b/arch/arm/plat-omap/include/mach/display.h +@@ -415,11 +415,14 @@ struct omap_overlay_manager { + + void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color); + u32 (*get_default_color)(struct omap_overlay_manager *mgr); ++ bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr); + void (*set_trans_key)(struct omap_overlay_manager *mgr, + enum omap_dss_color_key_type type, + u32 trans_key); + void (*enable_trans_key)(struct omap_overlay_manager *mgr, + bool enable); ++ void (*enable_alpha_blending)(struct omap_overlay_manager *mgr, ++ bool enable); + }; + + enum omap_display_caps { +diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c +index b631dd8..7e551c2 100644 +--- a/drivers/video/omap2/dss/dispc.c ++++ b/drivers/video/omap2/dss/dispc.c +@@ -1847,6 +1847,32 @@ void dispc_enable_trans_key(enum omap_channel ch, bool enable) + REG_FLD_MOD(DISPC_CONFIG, enable, 12, 12); + enable_clocks(0); + } ++void dispc_enable_alpha_blending(enum omap_channel ch, bool enable) ++{ ++ enable_clocks(1); ++ if (ch == OMAP_DSS_CHANNEL_LCD) ++ REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18); ++ else /* OMAP_DSS_CHANNEL_DIGIT */ ++ REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19); ++ enable_clocks(0); ++} ++bool dispc_alpha_blending_enabled(enum omap_channel ch) ++{ ++ bool enabled; ++ ++ enable_clocks(1); ++ if (ch == OMAP_DSS_CHANNEL_LCD) ++ enabled = REG_GET(DISPC_CONFIG, 18, 18); ++ else if (ch == OMAP_DSS_CHANNEL_DIGIT) ++ enabled = REG_GET(DISPC_CONFIG, 18, 18); ++ else ++ BUG(); ++ enable_clocks(0); ++ ++ return enabled; ++ ++} ++ + + bool dispc_trans_key_enabled(enum omap_channel ch) + { +diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h +index 584dce6..1d01ff6 100644 +--- a/drivers/video/omap2/dss/dss.h ++++ b/drivers/video/omap2/dss/dss.h +@@ -294,7 +294,9 @@ void dispc_get_trans_key(enum omap_channel ch, + enum omap_dss_color_key_type *type, + u32 *trans_key); + void dispc_enable_trans_key(enum omap_channel ch, bool enable); ++void dispc_enable_alpha_blending(enum omap_channel ch, bool enable); + bool dispc_trans_key_enabled(enum omap_channel ch); ++bool dispc_alpha_blending_enabled(enum omap_channel ch); + + void dispc_set_lcd_timings(struct omap_video_timings *timings); + unsigned long dispc_fclk_rate(void); +diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c +index 12cf7b0..90acd28 100644 +--- a/drivers/video/omap2/dss/manager.c ++++ b/drivers/video/omap2/dss/manager.c +@@ -468,6 +468,16 @@ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr, + { + dispc_enable_trans_key(mgr->id, enable); + } ++static void omap_dss_mgr_enable_alpha_blending(struct omap_overlay_manager *mgr, ++ bool enable) ++{ ++ dispc_enable_alpha_blending(mgr->id, enable); ++} ++static bool omap_dss_mgr_get_alpha_blending_status( ++ struct omap_overlay_manager *mgr) ++{ ++ return dispc_alpha_blending_enabled(mgr->id); ++} + static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr) + { + return dispc_get_default_color(mgr->id); +@@ -514,6 +524,10 @@ int dss_init_overlay_managers(struct platform_device *pdev) + mgr->set_default_color = &omap_dss_mgr_set_def_color, + mgr->set_trans_key = &omap_dss_mgr_set_trans_key, + mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key, ++ mgr->enable_alpha_blending = ++ &omap_dss_mgr_enable_alpha_blending; ++ mgr->get_alpha_blending_status = ++ omap_dss_mgr_get_alpha_blending_status; + mgr->get_default_color = &omap_dss_mgr_get_default_color; + mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC, + +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch b/recipes/linux/linux-omap-2.6.29/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch new file mode 100644 index 0000000000..fc62b09512 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch @@ -0,0 +1,150 @@ +From 2c9edd6af31a812a9487dd8bc12322e105a29f44 Mon Sep 17 00:00:00 2001 +From: Hardik Shah <hardik.shah@ti.com> +Date: Fri, 17 Apr 2009 09:42:36 +0530 +Subject: [PATCH] DSS2: Added support for querying color keying. + +V4L2 Framework has a ioctl for getting/setting color keying. +So added the function manager pointers for doing same. + +Modifed the color keying sysfs entries to use manager +function pointer. Earlier they were calling direcly +dispc function to set/enable color keying. + +Some of color-keying function pointers in the overlay_manager +structure re-named to be more specific. + +Signed-off-by: Hardik Shah <hardik.shah@ti.com> +--- + arch/arm/plat-omap/include/mach/display.h | 6 ++++- + drivers/video/omap2/dss/manager.c | 36 +++++++++++++++++++++-------- + 2 files changed, 31 insertions(+), 11 deletions(-) + +diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h +index e1f615a..d0b4c83 100644 +--- a/arch/arm/plat-omap/include/mach/display.h ++++ b/arch/arm/plat-omap/include/mach/display.h +@@ -416,7 +416,11 @@ struct omap_overlay_manager { + void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color); + u32 (*get_default_color)(struct omap_overlay_manager *mgr); + bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr); +- void (*set_trans_key)(struct omap_overlay_manager *mgr, ++ bool (*get_trans_key_status)(struct omap_overlay_manager *mgr); ++ void (*get_trans_key_type_and_value)(struct omap_overlay_manager *mgr, ++ enum omap_dss_color_key_type *type, ++ u32 *trans_key); ++ void (*set_trans_key_type_and_value)(struct omap_overlay_manager *mgr, + enum omap_dss_color_key_type type, + u32 trans_key); + void (*enable_trans_key)(struct omap_overlay_manager *mgr, +diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c +index 90acd28..e0501c4 100644 +--- a/drivers/video/omap2/dss/manager.c ++++ b/drivers/video/omap2/dss/manager.c +@@ -124,7 +124,7 @@ static ssize_t manager_color_key_type_show(struct omap_overlay_manager *mgr, + { + enum omap_dss_color_key_type key_type; + +- dispc_get_trans_key(mgr->id, &key_type, NULL); ++ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL); + BUG_ON(key_type >= ARRAY_SIZE(color_key_type_str)); + + return snprintf(buf, PAGE_SIZE, "%s\n", color_key_type_str[key_type]); +@@ -143,8 +143,8 @@ static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr, + } + if (key_type == ARRAY_SIZE(color_key_type_str)) + return -EINVAL; +- dispc_get_trans_key(mgr->id, NULL, &key_value); +- dispc_set_trans_key(mgr->id, key_type, key_value); ++ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value); ++ mgr->set_trans_key_type_and_value(mgr, key_type, key_value); + + return size; + } +@@ -154,7 +154,7 @@ static ssize_t manager_color_key_value_show(struct omap_overlay_manager *mgr, + { + u32 key_value; + +- dispc_get_trans_key(mgr->id, NULL, &key_value); ++ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value); + + return snprintf(buf, PAGE_SIZE, "%d\n", key_value); + } +@@ -167,8 +167,8 @@ static ssize_t manager_color_key_value_store(struct omap_overlay_manager *mgr, + + if (sscanf(buf, "%d", &key_value) != 1) + return -EINVAL; +- dispc_get_trans_key(mgr->id, &key_type, NULL); +- dispc_set_trans_key(mgr->id, key_type, key_value); ++ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL); ++ mgr->set_trans_key_type_and_value(mgr, key_type, key_value); + + return size; + } +@@ -177,7 +177,7 @@ static ssize_t manager_color_key_enabled_show(struct omap_overlay_manager *mgr, + char *buf) + { + return snprintf(buf, PAGE_SIZE, "%d\n", +- dispc_trans_key_enabled(mgr->id)); ++ mgr->get_trans_key_status(mgr)); + } + + static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr, +@@ -188,7 +188,7 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr, + if (sscanf(buf, "%d", &enable) != 1) + return -EINVAL; + +- dispc_enable_trans_key(mgr->id, enable); ++ mgr->enable_trans_key(mgr, enable); + + return size; + } +@@ -456,12 +456,20 @@ static void omap_dss_mgr_set_def_color(struct omap_overlay_manager *mgr, + dispc_set_default_color(mgr->id, color); + } + +-static void omap_dss_mgr_set_trans_key(struct omap_overlay_manager *mgr, ++static void omap_dss_mgr_set_trans_key_type_and_value( ++ struct omap_overlay_manager *mgr, + enum omap_dss_color_key_type type, + u32 trans_key) + { + dispc_set_trans_key(mgr->id, type, trans_key); + } ++static void omap_dss_mgr_get_trans_key_type_and_value( ++ struct omap_overlay_manager *mgr, ++ enum omap_dss_color_key_type *type, ++ u32 *trans_key) ++{ ++ dispc_get_trans_key(mgr->id, type, trans_key); ++} + + static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr, + bool enable) +@@ -482,6 +490,10 @@ static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr) + { + return dispc_get_default_color(mgr->id); + } ++static bool omap_dss_mgr_get_trans_key_status(struct omap_overlay_manager *mgr) ++{ ++ return dispc_trans_key_enabled(mgr->id); ++} + + static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager) + { +@@ -522,8 +534,12 @@ int dss_init_overlay_managers(struct platform_device *pdev) + mgr->unset_display = &omap_dss_unset_display, + mgr->apply = &omap_dss_mgr_apply, + mgr->set_default_color = &omap_dss_mgr_set_def_color, +- mgr->set_trans_key = &omap_dss_mgr_set_trans_key, ++ mgr->set_trans_key_type_and_value = ++ &omap_dss_mgr_set_trans_key_type_and_value, ++ mgr->get_trans_key_type_and_value = ++ &omap_dss_mgr_get_trans_key_type_and_value, + mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key, ++ mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status, + mgr->enable_alpha_blending = + &omap_dss_mgr_enable_alpha_blending; + mgr->get_alpha_blending_status = +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch b/recipes/linux/linux-omap-2.6.29/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch new file mode 100644 index 0000000000..65cb113574 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch @@ -0,0 +1,56 @@ +From 9e8877f0e5b17d3ddd101d6a63aa86fdb14d35d5 Mon Sep 17 00:00:00 2001 +From: Hardik Shah <hardik.shah@ti.com> +Date: Fri, 17 Apr 2009 09:51:25 +0530 +Subject: [PATCH] DSS2:OMAPFB: Some color keying pointerd renamed in DSS2. Replicated in FB + +Signed-off-by: Hardik Shah <hardik.shah@ti.com> +--- + drivers/video/omap2/omapfb/omapfb-ioctl.c | 11 +++++++---- + 1 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c +index 7f18d2a..79d8916 100644 +--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c ++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c +@@ -288,7 +288,8 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr, + { + enum omap_dss_color_key_type kt; + +- if(!mgr->set_default_color || !mgr->set_trans_key || ++ if (!mgr->set_default_color || ++ !mgr->set_trans_key_type_and_value || + !mgr->enable_trans_key) + return 0; + +@@ -310,7 +311,7 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr, + } + + mgr->set_default_color(mgr, ck->background); +- mgr->set_trans_key(mgr, kt, ck->trans_key); ++ mgr->set_trans_key_type_and_value(mgr, kt, ck->trans_key); + mgr->enable_trans_key(mgr, 1); + + omapfb_color_keys[mgr->id] = *ck; +@@ -341,7 +342,8 @@ static int omapfb_set_color_key(struct fb_info *fbi, + goto err; + } + +- if(!mgr->set_default_color || !mgr->set_trans_key || ++ if (!mgr->set_default_color || ++ !mgr->set_trans_key_type_and_value || + !mgr->enable_trans_key) { + r = -ENODEV; + goto err; +@@ -377,7 +379,8 @@ static int omapfb_get_color_key(struct fb_info *fbi, + goto err; + } + +- if(!mgr->set_default_color || !mgr->set_trans_key || ++ if (!mgr->set_default_color || ++ !mgr->set_trans_key_type_and_value || + !mgr->enable_trans_key) { + r = -ENODEV; + goto err; +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch b/recipes/linux/linux-omap-2.6.29/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch new file mode 100644 index 0000000000..af8c2cd09b --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch @@ -0,0 +1,59 @@ +From 6f1f0c7b19ecb468824b79f9d181ef0da41b7d7d Mon Sep 17 00:00:00 2001 +From: Hardik Shah <hardik.shah@ti.com> +Date: Fri, 17 Apr 2009 13:58:21 +0530 +Subject: [PATCH] DSS2: Add sysfs entry to for the alpha blending support. + +Signed-off-by: Hardik Shah <hardik.shah@ti.com> +--- + drivers/video/omap2/dss/manager.c | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c +index e0501c4..7965a84 100644 +--- a/drivers/video/omap2/dss/manager.c ++++ b/drivers/video/omap2/dss/manager.c +@@ -192,6 +192,22 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr, + + return size; + } ++static ssize_t manager_alpha_blending_enabled_show( ++ struct omap_overlay_manager *mgr, char *buf) ++{ ++ return snprintf(buf, PAGE_SIZE, "%d\n", ++ mgr->get_alpha_blending_status(mgr)); ++} ++static ssize_t manager_alpha_blending_enabled_store( ++ struct omap_overlay_manager *mgr, ++ const char *buf, size_t size) ++{ ++ int enable; ++ if (sscanf(buf, "%d", &enable) != 1) ++ return -EINVAL; ++ mgr->enable_alpha_blending(mgr, enable); ++ return size; ++} + + + struct manager_attribute { +@@ -215,6 +231,10 @@ static MANAGER_ATTR(color_key_value, S_IRUGO|S_IWUSR, + manager_color_key_value_show, manager_color_key_value_store); + static MANAGER_ATTR(color_key_enabled, S_IRUGO|S_IWUSR, + manager_color_key_enabled_show, manager_color_key_enabled_store); ++static MANAGER_ATTR(alpha_blending_enabled, S_IRUGO|S_IWUSR, ++ manager_alpha_blending_enabled_show, ++ manager_alpha_blending_enabled_store); ++ + + static struct attribute *manager_sysfs_attrs[] = { + &manager_attr_name.attr, +@@ -223,6 +243,7 @@ static struct attribute *manager_sysfs_attrs[] = { + &manager_attr_color_key_type.attr, + &manager_attr_color_key_value.attr, + &manager_attr_color_key_enabled.attr, ++ &manager_attr_alpha_blending_enabled.attr, + NULL + }; + +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch b/recipes/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch new file mode 100644 index 0000000000..66be75f3f7 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch @@ -0,0 +1,97 @@ +From a5129f272a48aa22629137c9c31e60eddb8c3f5d Mon Sep 17 00:00:00 2001 +From: Hardik Shah <hardik.shah@ti.com> +Date: Fri, 17 Apr 2009 14:24:46 +0530 +Subject: [PATCH] DSS2: Provided proper exclusion for destination color keying and alpha blending. + +OMAP does not support destination color key and alpha blending +simultaneously. So this patch does not allow the user +so set both at a time. + +Signed-off-by: Hardik Shah <hardik.shah@ti.com> +--- + drivers/video/omap2/dss/manager.c | 50 ++++++++++++++++++++++++++++++++++++- + 1 files changed, 49 insertions(+), 1 deletions(-) + +diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c +index 7965a84..108489c 100644 +--- a/drivers/video/omap2/dss/manager.c ++++ b/drivers/video/omap2/dss/manager.c +@@ -137,12 +137,26 @@ static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr, + u32 key_value; + + for (key_type = OMAP_DSS_COLOR_KEY_GFX_DST; +- key_type < ARRAY_SIZE(color_key_type_str); key_type++) { ++ key_type < ARRAY_SIZE(color_key_type_str); key_type++) { + if (sysfs_streq(buf, color_key_type_str[key_type])) + break; + } + if (key_type == ARRAY_SIZE(color_key_type_str)) + return -EINVAL; ++ /* OMAP does not support destination color key and alpha blending ++ * simultaneously. So if alpha blending and color keying both are ++ * enabled then refrain from setting the color key type to ++ * gfx-destination ++ */ ++ if (!key_type) { ++ bool color_key_enabled; ++ bool alpha_blending_enabled; ++ color_key_enabled = mgr->get_trans_key_status(mgr); ++ alpha_blending_enabled = mgr->get_alpha_blending_status(mgr); ++ if (color_key_enabled && alpha_blending_enabled) ++ return -EINVAL; ++ } ++ + mgr->get_trans_key_type_and_value(mgr, NULL, &key_value); + mgr->set_trans_key_type_and_value(mgr, key_type, key_value); + +@@ -188,6 +202,23 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr, + if (sscanf(buf, "%d", &enable) != 1) + return -EINVAL; + ++ /* OMAP does not support destination color keying and ++ * alpha blending simultaneously. so if alpha blending ++ * is enabled refrain from enabling destination color ++ * keying. ++ */ ++ if (enable) { ++ bool enabled; ++ enabled = mgr->get_alpha_blending_status(mgr); ++ if (enabled) { ++ enum omap_dss_color_key_type key_type; ++ mgr->get_trans_key_type_and_value(mgr, ++ &key_type, NULL); ++ if (!key_type) ++ return -EINVAL; ++ } ++ ++ } + mgr->enable_trans_key(mgr, enable); + + return size; +@@ -205,6 +236,23 @@ static ssize_t manager_alpha_blending_enabled_store( + int enable; + if (sscanf(buf, "%d", &enable) != 1) + return -EINVAL; ++ /* OMAP does not support destination color keying and ++ * alpha blending simultaneously. so if destination ++ * color keying is enabled refrain from enabling ++ * alpha blending ++ */ ++ if (enable) { ++ bool enabled; ++ enabled = mgr->get_trans_key_status(mgr); ++ if (enabled) { ++ enum omap_dss_color_key_type key_type; ++ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL); ++ if (!key_type) ++ return -EINVAL; ++ ++ } ++ ++ } + mgr->enable_alpha_blending(mgr, enable); + return size; + } +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch b/recipes/linux/linux-omap-2.6.29/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch new file mode 100644 index 0000000000..6785ade279 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch @@ -0,0 +1,71 @@ +From 9bcac9b9e678f476c83b5679b1215b6bc946130a Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com> +Date: Mon, 20 Apr 2009 16:26:18 +0200 +Subject: [PATCH] DSS2: Disable vertical offset with fieldmode +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +When using fieldmode each field is basically a separate picture so the +vertical filter should start at phase 0 for both fields. + +Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> +--- + drivers/video/omap2/dss/dispc.c | 23 +++++++++-------------- + 1 files changed, 9 insertions(+), 14 deletions(-) + +diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c +index 7e551c2..f15614b 100644 +--- a/drivers/video/omap2/dss/dispc.c ++++ b/drivers/video/omap2/dss/dispc.c +@@ -1029,12 +1029,12 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu) + static void _dispc_set_scaling(enum omap_plane plane, + u16 orig_width, u16 orig_height, + u16 out_width, u16 out_height, +- bool ilace, bool five_taps) ++ bool ilace, bool five_taps, ++ bool fieldmode) + { + int fir_hinc; + int fir_vinc; + int hscaleup, vscaleup; +- int fieldmode = 0; + int accu0 = 0; + int accu1 = 0; + u32 l; +@@ -1072,17 +1072,12 @@ static void _dispc_set_scaling(enum omap_plane plane, + + dispc_write_reg(dispc_reg_att[plane], l); + +- if (ilace) { +- if (fieldmode) { +- accu0 = fir_vinc / 2; +- accu1 = 0; +- } else { +- accu0 = 0; +- accu1 = fir_vinc / 2; +- if (accu1 >= 1024/2) { +- accu0 = 1024/2; +- accu1 -= accu0; +- } ++ if (ilace && !fieldmode) { ++ accu0 = 0; ++ accu1 = fir_vinc / 2; ++ if (accu1 >= 1024/2) { ++ accu0 = 1024/2; ++ accu1 -= accu0; + } + } + +@@ -1582,7 +1577,7 @@ static int _dispc_setup_plane(enum omap_plane plane, + if (plane != OMAP_DSS_GFX) { + _dispc_set_scaling(plane, width, height, + out_width, out_height, +- ilace, five_taps); ++ ilace, five_taps, fieldmode); + _dispc_set_vid_size(plane, out_width, out_height); + _dispc_set_vid_color_conv(plane, cconv); + } +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch b/recipes/linux/linux-omap-2.6.29/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch new file mode 100644 index 0000000000..5264911b41 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch @@ -0,0 +1,34 @@ +From 9c6de0fed6e8a598d026d348533fdf731b737d55 Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com> +Date: Mon, 20 Apr 2009 16:26:19 +0200 +Subject: [PATCH] DSS2: Don't enable fieldmode automatically +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +The only case where enabling fieldmode automatically seems reasonable +is when source and destination heights are equal. Some kind of user +controllable knob should be added so the user could enable field mode +when the source is interlaced. + +Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> +--- + drivers/video/omap2/dss/dispc.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c +index f15614b..1c036c1 100644 +--- a/drivers/video/omap2/dss/dispc.c ++++ b/drivers/video/omap2/dss/dispc.c +@@ -1450,7 +1450,7 @@ static int _dispc_setup_plane(enum omap_plane plane, + if (paddr == 0) + return -EINVAL; + +- if (ilace && height >= out_height) ++ if (ilace && height == out_height) + fieldmode = 1; + + if (ilace) { +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch b/recipes/linux/linux-omap-2.6.29/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch new file mode 100644 index 0000000000..76e37817c4 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch @@ -0,0 +1,170 @@ +From 35e88797e93b107ba602dee1e2ac8ea761dccd4b Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com> +Date: Mon, 20 Apr 2009 16:26:20 +0200 +Subject: [PATCH] DSS2: Swap field 0 and field 1 registers +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +The values for the registers which have alternate values for each field +were reveresed to what the hardware expects. For the hardware field 0 +is the even field or the bottom field, field 1 is the odd field or the +top field. So simply swap the register values. + +Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> +--- + drivers/video/omap2/dss/dispc.c | 66 ++++++++++++++++++++++----------------- + 1 files changed, 37 insertions(+), 29 deletions(-) + +diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c +index 1c036c1..9bab6cf 100644 +--- a/drivers/video/omap2/dss/dispc.c ++++ b/drivers/video/omap2/dss/dispc.c +@@ -1072,12 +1072,16 @@ static void _dispc_set_scaling(enum omap_plane plane, + + dispc_write_reg(dispc_reg_att[plane], l); + ++ /* ++ * field 0 = even field = bottom field ++ * field 1 = odd field = top field ++ */ + if (ilace && !fieldmode) { +- accu0 = 0; +- accu1 = fir_vinc / 2; +- if (accu1 >= 1024/2) { +- accu0 = 1024/2; +- accu1 -= accu0; ++ accu1 = 0; ++ accu0 = fir_vinc / 2; ++ if (accu0 >= 1024/2) { ++ accu1 = 1024/2; ++ accu0 -= accu1; + } + } + +@@ -1266,34 +1270,38 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror, + fbh = width; + } + ++ /* ++ * field 0 = even field = bottom field ++ * field 1 = odd field = top field ++ */ + switch (rotation + mirror * 4) { + case 0: +- *offset0 = 0; ++ *offset1 = 0; + if (fieldmode) +- *offset1 = screen_width * ps; ++ *offset0 = screen_width * ps; + else +- *offset1 = 0; ++ *offset0 = 0; + *row_inc = pixinc(1 + (screen_width - fbw) + + (fieldmode ? screen_width : 0), + ps); + *pix_inc = pixinc(1, ps); + break; + case 1: +- *offset0 = screen_width * (fbh - 1) * ps; ++ *offset1 = screen_width * (fbh - 1) * ps; + if (fieldmode) +- *offset1 = *offset0 + ps; ++ *offset0 = *offset1 + ps; + else +- *offset1 = *offset0; ++ *offset0 = *offset1; + *row_inc = pixinc(screen_width * (fbh - 1) + 1 + + (fieldmode ? 1 : 0), ps); + *pix_inc = pixinc(-screen_width, ps); + break; + case 2: +- *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps; ++ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps; + if (fieldmode) +- *offset1 = *offset0 - screen_width * ps; ++ *offset0 = *offset1 - screen_width * ps; + else +- *offset1 = *offset0; ++ *offset0 = *offset1; + *row_inc = pixinc(-1 - + (screen_width - fbw) - + (fieldmode ? screen_width : 0), +@@ -1301,11 +1309,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror, + *pix_inc = pixinc(-1, ps); + break; + case 3: +- *offset0 = (fbw - 1) * ps; ++ *offset1 = (fbw - 1) * ps; + if (fieldmode) +- *offset1 = *offset0 - ps; ++ *offset0 = *offset1 - ps; + else +- *offset1 = *offset0; ++ *offset0 = *offset1; + *row_inc = pixinc(-screen_width * (fbh - 1) - 1 - + (fieldmode ? 1 : 0), ps); + *pix_inc = pixinc(screen_width, ps); +@@ -1313,11 +1321,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror, + + /* mirroring */ + case 0 + 4: +- *offset0 = (fbw - 1) * ps; ++ *offset1 = (fbw - 1) * ps; + if (fieldmode) +- *offset1 = *offset0 + screen_width * ps; ++ *offset0 = *offset1 + screen_width * ps; + else +- *offset1 = *offset0; ++ *offset0 = *offset1; + *row_inc = pixinc(screen_width * 2 - 1 + + (fieldmode ? screen_width : 0), + ps); +@@ -1325,11 +1333,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror, + break; + + case 1 + 4: +- *offset0 = 0; ++ *offset1 = 0; + if (fieldmode) +- *offset1 = *offset0 + screen_width * ps; ++ *offset0 = *offset1 + screen_width * ps; + else +- *offset1 = *offset0; ++ *offset0 = *offset1; + *row_inc = pixinc(-screen_width * (fbh - 1) + 1 + + (fieldmode ? 1 : 0), + ps); +@@ -1337,11 +1345,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror, + break; + + case 2 + 4: +- *offset0 = screen_width * (fbh - 1) * ps; ++ *offset1 = screen_width * (fbh - 1) * ps; + if (fieldmode) +- *offset1 = *offset0 + screen_width * ps; ++ *offset0 = *offset1 + screen_width * ps; + else +- *offset1 = *offset0; ++ *offset0 = *offset1; + *row_inc = pixinc(1 - screen_width * 2 - + (fieldmode ? screen_width : 0), + ps); +@@ -1349,11 +1357,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror, + break; + + case 3 + 4: +- *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps; ++ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps; + if (fieldmode) +- *offset1 = *offset0 + screen_width * ps; ++ *offset0 = *offset1 + screen_width * ps; + else +- *offset1 = *offset0; ++ *offset0 = *offset1; + *row_inc = pixinc(screen_width * (fbh - 1) - 1 - + (fieldmode ? 1 : 0), + ps); +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch b/recipes/linux/linux-omap-2.6.29/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch new file mode 100644 index 0000000000..32def9e8d5 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch @@ -0,0 +1,76 @@ +From a9b3500bd14609750a2337e866e1df62627c1bac Mon Sep 17 00:00:00 2001 +From: Imre Deak <imre.deak@nokia.com> +Date: Mon, 20 Apr 2009 14:55:33 +0200 +Subject: [PATCH] DSS2: add sysfs entry for seting the rotate type + +This can help in utilizing VRAM memory better. Since with VRFB rotation +we waste a lot of physical memory due to the VRFB HW design, provide the +possibility to turn it off and free the extra memory for the use by other +planes for example. +--- + drivers/video/omap2/omapfb/omapfb-sysfs.c | 42 ++++++++++++++++++++++++++++- + 1 files changed, 41 insertions(+), 1 deletions(-) + +diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c +index 2c88718..4e3da42 100644 +--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c ++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c +@@ -43,6 +43,46 @@ static ssize_t show_rotate_type(struct device *dev, + return snprintf(buf, PAGE_SIZE, "%d\n", ofbi->rotation_type); + } + ++static ssize_t store_rotate_type(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct fb_info *fbi = dev_get_drvdata(dev); ++ struct omapfb_info *ofbi = FB2OFB(fbi); ++ struct omapfb2_device *fbdev = ofbi->fbdev; ++ enum omap_dss_rotation_type rot_type; ++ int r; ++ ++ rot_type = simple_strtoul(buf, NULL, 0); ++ ++ if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB) ++ return -EINVAL; ++ ++ omapfb_lock(fbdev); ++ ++ r = 0; ++ if (rot_type == ofbi->rotation_type) ++ goto out; ++ ++ r = -EBUSY; ++ if (ofbi->region.size) ++ goto out; ++ ++ ofbi->rotation_type = rot_type; ++ ++ /* ++ * Since the VRAM for this FB is not allocated at the moment we don't need to ++ * do any further parameter checking at this point. ++ */ ++ ++ r = count; ++out: ++ omapfb_unlock(fbdev); ++ ++ return r; ++} ++ ++ + static ssize_t show_mirror(struct device *dev, + struct device_attribute *attr, char *buf) + { +@@ -327,7 +367,7 @@ static ssize_t show_virt(struct device *dev, + } + + static struct device_attribute omapfb_attrs[] = { +- __ATTR(rotate_type, S_IRUGO, show_rotate_type, NULL), ++ __ATTR(rotate_type, S_IRUGO | S_IWUSR, show_rotate_type, store_rotate_type), + __ATTR(mirror, S_IRUGO | S_IWUSR, show_mirror, store_mirror), + __ATTR(size, S_IRUGO | S_IWUSR, show_size, store_size), + __ATTR(overlays, S_IRUGO | S_IWUSR, show_overlays, store_overlays), +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0045-DSS2-Fixed-line-endings-from-to.patch b/recipes/linux/linux-omap-2.6.29/dss2/0045-DSS2-Fixed-line-endings-from-to.patch new file mode 100644 index 0000000000..9382469850 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0045-DSS2-Fixed-line-endings-from-to.patch @@ -0,0 +1,48 @@ +From b0e081456a9b094109c04467d041ff693843ca47 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Tue, 21 Apr 2009 09:25:16 +0300 +Subject: [PATCH] DSS2: Fixed line endings from , to ; + +--- + drivers/video/omap2/dss/manager.c | 18 +++++++++--------- + 1 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c +index 108489c..bf059e0 100644 +--- a/drivers/video/omap2/dss/manager.c ++++ b/drivers/video/omap2/dss/manager.c +@@ -599,22 +599,22 @@ int dss_init_overlay_managers(struct platform_device *pdev) + break; + } + +- mgr->set_display = &omap_dss_set_display, +- mgr->unset_display = &omap_dss_unset_display, +- mgr->apply = &omap_dss_mgr_apply, +- mgr->set_default_color = &omap_dss_mgr_set_def_color, ++ mgr->set_display = &omap_dss_set_display; ++ mgr->unset_display = &omap_dss_unset_display; ++ mgr->apply = &omap_dss_mgr_apply; ++ mgr->set_default_color = &omap_dss_mgr_set_def_color; + mgr->set_trans_key_type_and_value = +- &omap_dss_mgr_set_trans_key_type_and_value, ++ &omap_dss_mgr_set_trans_key_type_and_value; + mgr->get_trans_key_type_and_value = +- &omap_dss_mgr_get_trans_key_type_and_value, +- mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key, +- mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status, ++ &omap_dss_mgr_get_trans_key_type_and_value; ++ mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key; ++ mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status; + mgr->enable_alpha_blending = + &omap_dss_mgr_enable_alpha_blending; + mgr->get_alpha_blending_status = + omap_dss_mgr_get_alpha_blending_status; + mgr->get_default_color = &omap_dss_mgr_get_default_color; +- mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC, ++ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC; + + dss_overlay_setup_dispc_manager(mgr); + +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch b/recipes/linux/linux-omap-2.6.29/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch new file mode 100644 index 0000000000..4ae5fbdd9a --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch @@ -0,0 +1,26 @@ +From 0f88992b2681aed4f31dc7dd3926b357bbc95154 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Tue, 21 Apr 2009 10:11:55 +0300 +Subject: [PATCH] DSS2: DSI: decrease sync timeout from 60s to 2s + +The framedone-problem should be ok now, so we shouldn't get long waits. +--- + drivers/video/omap2/dss/dsi.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c +index 50af925..d59ad38 100644 +--- a/drivers/video/omap2/dss/dsi.c ++++ b/drivers/video/omap2/dss/dsi.c +@@ -3216,7 +3216,7 @@ static void dsi_push_set_mirror(struct omap_display *display, int mirror) + + static int dsi_wait_sync(struct omap_display *display) + { +- long wait = msecs_to_jiffies(60000); ++ long wait = msecs_to_jiffies(2000); + struct completion compl; + + DSSDBGF(""); +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch b/recipes/linux/linux-omap-2.6.29/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch new file mode 100644 index 0000000000..0b0f104b30 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch @@ -0,0 +1,44 @@ +From 7ddd5eaa7bc345c3719d613a46a95b7e8052ad2c Mon Sep 17 00:00:00 2001 +From: Imre Deak <imre.deak@nokia.com> +Date: Tue, 21 Apr 2009 15:18:36 +0200 +Subject: [PATCH] DSS2: fix return value for rotate_type sysfs function + +Signed-off-by: Imre Deak <imre.deak@nokia.com> +--- + drivers/video/omap2/omapfb/omapfb-sysfs.c | 9 ++++----- + 1 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c +index 4e3da42..13028ae 100644 +--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c ++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c +@@ -64,9 +64,10 @@ static ssize_t store_rotate_type(struct device *dev, + if (rot_type == ofbi->rotation_type) + goto out; + +- r = -EBUSY; +- if (ofbi->region.size) ++ if (ofbi->region.size) { ++ r = -EBUSY; + goto out; ++ } + + ofbi->rotation_type = rot_type; + +@@ -74,12 +75,10 @@ static ssize_t store_rotate_type(struct device *dev, + * Since the VRAM for this FB is not allocated at the moment we don't need to + * do any further parameter checking at this point. + */ +- +- r = count; + out: + omapfb_unlock(fbdev); + +- return r; ++ return r ? r : count; + } + + +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch b/recipes/linux/linux-omap-2.6.29/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch new file mode 100644 index 0000000000..cc6663fa21 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch @@ -0,0 +1,123 @@ +From e34564db95627ad20e918b240c45e2bd5555f7e8 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Wed, 22 Apr 2009 10:06:08 +0300 +Subject: [PATCH] OMAP2/3: DMA: implement trans copy and const fill + +Implement transparent copy and constant fill features for OMAP2/3. + +Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> +--- + arch/arm/plat-omap/dma.c | 81 +++++++++++++++++++++------------ + arch/arm/plat-omap/include/mach/dma.h | 1 + + 2 files changed, 52 insertions(+), 30 deletions(-) + +diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c +index 3fd0e77..060ac71 100755 +--- a/arch/arm/plat-omap/dma.c ++++ b/arch/arm/plat-omap/dma.c +@@ -310,41 +310,62 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params); + + void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) + { +- u16 w; +- + BUG_ON(omap_dma_in_1510_mode()); + +- if (cpu_class_is_omap2()) { +- REVISIT_24XX(); +- return; +- } ++ if (cpu_class_is_omap1()) { ++ u16 w; + +- w = dma_read(CCR2(lch)); +- w &= ~0x03; ++ w = dma_read(CCR2(lch)); ++ w &= ~0x03; + +- switch (mode) { +- case OMAP_DMA_CONSTANT_FILL: +- w |= 0x01; +- break; +- case OMAP_DMA_TRANSPARENT_COPY: +- w |= 0x02; +- break; +- case OMAP_DMA_COLOR_DIS: +- break; +- default: +- BUG(); ++ switch (mode) { ++ case OMAP_DMA_CONSTANT_FILL: ++ w |= 0x01; ++ break; ++ case OMAP_DMA_TRANSPARENT_COPY: ++ w |= 0x02; ++ break; ++ case OMAP_DMA_COLOR_DIS: ++ break; ++ default: ++ BUG(); ++ } ++ dma_write(w, CCR2(lch)); ++ ++ w = dma_read(LCH_CTRL(lch)); ++ w &= ~0x0f; ++ /* Default is channel type 2D */ ++ if (mode) { ++ dma_write((u16)color, COLOR_L(lch)); ++ dma_write((u16)(color >> 16), COLOR_U(lch)); ++ w |= 1; /* Channel type G */ ++ } ++ dma_write(w, LCH_CTRL(lch)); + } +- dma_write(w, CCR2(lch)); + +- w = dma_read(LCH_CTRL(lch)); +- w &= ~0x0f; +- /* Default is channel type 2D */ +- if (mode) { +- dma_write((u16)color, COLOR_L(lch)); +- dma_write((u16)(color >> 16), COLOR_U(lch)); +- w |= 1; /* Channel type G */ ++ if (cpu_class_is_omap2()) { ++ u32 val; ++ ++ val = dma_read(CCR(lch)); ++ val &= ~((1 << 17) | (1 << 16)); ++ ++ switch (mode) { ++ case OMAP_DMA_CONSTANT_FILL: ++ val |= 1 << 16; ++ break; ++ case OMAP_DMA_TRANSPARENT_COPY: ++ val |= 1 << 17; ++ break; ++ case OMAP_DMA_COLOR_DIS: ++ break; ++ default: ++ BUG(); ++ } ++ dma_write(val, CCR(lch)); ++ ++ color &= 0xffffff; ++ dma_write(color, COLOR(lch)); + } +- dma_write(w, LCH_CTRL(lch)); + } + EXPORT_SYMBOL(omap_set_dma_color_mode); + +diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h +index 224b077..4e34f47 100644 +--- a/arch/arm/plat-omap/include/mach/dma.h ++++ b/arch/arm/plat-omap/include/mach/dma.h +@@ -144,6 +144,7 @@ + #define OMAP_DMA4_CSSA_U(n) 0 + #define OMAP_DMA4_CDSA_L(n) 0 + #define OMAP_DMA4_CDSA_U(n) 0 ++#define OMAP1_DMA_COLOR(n) 0 + + /*----------------------------------------------------------------------------*/ + +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch b/recipes/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch new file mode 100644 index 0000000000..e9fc76ce15 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch @@ -0,0 +1,101 @@ +From 02034cc79f69512a6037f03ad1243c28f59fdd8a Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Wed, 22 Apr 2009 10:25:20 +0300 +Subject: [PATCH] DSS2: VRAM: clear allocated area with DMA + +Use DMA constant fill feature to clear VRAM area when +someone allocates it. +--- + arch/arm/plat-omap/vram.c | 57 +++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 57 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c +index 8e9fe77..90276ac 100644 +--- a/arch/arm/plat-omap/vram.c ++++ b/arch/arm/plat-omap/vram.c +@@ -31,11 +31,13 @@ + #include <linux/seq_file.h> + #include <linux/bootmem.h> + #include <linux/omapfb.h> ++#include <linux/completion.h> + + #include <asm/setup.h> + + #include <mach/sram.h> + #include <mach/vram.h> ++#include <mach/dma.h> + + #ifdef DEBUG + #define DBG(format, ...) printk(KERN_DEBUG "VRAM: " format, ## __VA_ARGS__) +@@ -276,6 +278,59 @@ int omap_vram_reserve(unsigned long paddr, size_t size) + } + EXPORT_SYMBOL(omap_vram_reserve); + ++static void _omap_vram_dma_cb(int lch, u16 ch_status, void *data) ++{ ++ struct completion *compl = data; ++ complete(compl); ++} ++ ++static int _omap_vram_clear(u32 paddr, unsigned pages) ++{ ++ struct completion compl; ++ unsigned elem_count; ++ unsigned frame_count; ++ int r; ++ int lch; ++ ++ init_completion(&compl); ++ ++ r = omap_request_dma(OMAP_DMA_NO_DEVICE, "VRAM DMA", ++ _omap_vram_dma_cb, ++ &compl, &lch); ++ if (r) { ++ pr_err("VRAM: request_dma failed for memory clear\n"); ++ return -EBUSY; ++ } ++ ++ elem_count = pages * PAGE_SIZE / 4; ++ frame_count = 1; ++ ++ omap_set_dma_transfer_params(lch, OMAP_DMA_DATA_TYPE_S32, ++ elem_count, frame_count, ++ OMAP_DMA_SYNC_ELEMENT, ++ 0, 0); ++ ++ omap_set_dma_dest_params(lch, 0, OMAP_DMA_AMODE_POST_INC, ++ paddr, 0, 0); ++ ++ omap_set_dma_color_mode(lch, OMAP_DMA_CONSTANT_FILL, 0x000000); ++ ++ omap_start_dma(lch); ++ ++ if (wait_for_completion_timeout(&compl, msecs_to_jiffies(1000)) == 0) { ++ omap_stop_dma(lch); ++ pr_err("VRAM: dma timeout while clearing memory\n"); ++ r = -EIO; ++ goto err; ++ } ++ ++ r = 0; ++err: ++ omap_free_dma(lch); ++ ++ return r; ++} ++ + static int _omap_vram_alloc(int mtype, unsigned pages, unsigned long *paddr) + { + struct vram_region *rm; +@@ -313,6 +368,8 @@ found: + + *paddr = start; + ++ _omap_vram_clear(start, pages); ++ + return 0; + } + +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch b/recipes/linux/linux-omap-2.6.29/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch new file mode 100644 index 0000000000..8c5edd0c3d --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch @@ -0,0 +1,53 @@ +From 07482193cccdfe9ede1f47d72790dfbe54343505 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Wed, 22 Apr 2009 10:26:06 +0300 +Subject: [PATCH] DSS2: OMAPFB: remove fb clearing code + +VRAM manager does the clearing now when the area is allocated. +--- + drivers/video/omap2/omapfb/omapfb-main.c | 8 -------- + 1 files changed, 0 insertions(+), 8 deletions(-) + +diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c +index cd63740..76e7c6c 100644 +--- a/drivers/video/omap2/omapfb/omapfb-main.c ++++ b/drivers/video/omap2/omapfb/omapfb-main.c +@@ -1174,7 +1174,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size, + struct omapfb2_mem_region *rg; + void __iomem *vaddr; + int r; +- int clear = 0; + + rg = &ofbi->region; + memset(rg, 0, sizeof(*rg)); +@@ -1184,7 +1183,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size, + if (!paddr) { + DBG("allocating %lu bytes for fb %d\n", size, ofbi->id); + r = omap_vram_alloc(OMAPFB_MEMTYPE_SDRAM, size, &paddr); +- clear = 1; + } else { + DBG("reserving %lu bytes at %lx for fb %d\n", size, paddr, + ofbi->id); +@@ -1206,9 +1204,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size, + } + + DBG("allocated VRAM paddr %lx, vaddr %p\n", paddr, vaddr); +- +- if (clear) +- memset_io(vaddr, 0, size); + } else { + void __iomem *va; + +@@ -1232,9 +1227,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size, + rg->vrfb.vaddr[0] = va; + + vaddr = NULL; +- +- if (clear) +- memset_io(va, 0, size); + } + + rg->paddr = paddr; +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch b/recipes/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch new file mode 100644 index 0000000000..93ff3205d3 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch @@ -0,0 +1,170 @@ +From b47aef28536f3c276d232c41cd3084c69389dca4 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Wed, 22 Apr 2009 14:11:52 +0300 +Subject: [PATCH] DSS2: VRAM: use debugfs, not procfs + +--- + arch/arm/plat-omap/vram.c | 103 +++++++++++++++------------------------------ + 1 files changed, 34 insertions(+), 69 deletions(-) + +diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c +index 90276ac..e847579 100644 +--- a/arch/arm/plat-omap/vram.c ++++ b/arch/arm/plat-omap/vram.c +@@ -27,11 +27,11 @@ + #include <linux/mm.h> + #include <linux/list.h> + #include <linux/dma-mapping.h> +-#include <linux/proc_fs.h> + #include <linux/seq_file.h> + #include <linux/bootmem.h> + #include <linux/omapfb.h> + #include <linux/completion.h> ++#include <linux/debugfs.h> + + #include <asm/setup.h> + +@@ -398,88 +398,54 @@ int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr) + } + EXPORT_SYMBOL(omap_vram_alloc); + +-#ifdef CONFIG_PROC_FS +-static void *r_next(struct seq_file *m, void *v, loff_t *pos) +-{ +- struct list_head *l = v; +- +- (*pos)++; +- +- if (list_is_last(l, ®ion_list)) +- return NULL; +- +- return l->next; +-} +- +-static void *r_start(struct seq_file *m, loff_t *pos) +-{ +- loff_t p = *pos; +- struct list_head *l = ®ion_list; +- +- mutex_lock(®ion_mutex); +- +- do { +- l = l->next; +- if (l == ®ion_list) +- return NULL; +- } while (p--); +- +- return l; +-} +- +-static void r_stop(struct seq_file *m, void *v) +-{ +- mutex_unlock(®ion_mutex); +-} +- +-static int r_show(struct seq_file *m, void *v) ++#if defined(CONFIG_DEBUG_FS) ++static int vram_debug_show(struct seq_file *s, void *unused) + { + struct vram_region *vr; + struct vram_alloc *va; + unsigned size; + +- vr = list_entry(v, struct vram_region, list); +- +- size = vr->pages << PAGE_SHIFT; +- +- seq_printf(m, "%08lx-%08lx (%d bytes)\n", +- vr->paddr, vr->paddr + size - 1, +- size); ++ mutex_lock(®ion_mutex); + +- list_for_each_entry(va, &vr->alloc_list, list) { +- size = va->pages << PAGE_SHIFT; +- seq_printf(m, " %08lx-%08lx (%d bytes)\n", +- va->paddr, va->paddr + size - 1, ++ list_for_each_entry(vr, ®ion_list, list) { ++ size = vr->pages << PAGE_SHIFT; ++ seq_printf(s, "%08lx-%08lx (%d bytes)\n", ++ vr->paddr, vr->paddr + size - 1, + size); +- } + ++ list_for_each_entry(va, &vr->alloc_list, list) { ++ size = va->pages << PAGE_SHIFT; ++ seq_printf(s, " %08lx-%08lx (%d bytes)\n", ++ va->paddr, va->paddr + size - 1, ++ size); ++ } ++ } + ++ mutex_unlock(®ion_mutex); + + return 0; + } + +-static const struct seq_operations resource_op = { +- .start = r_start, +- .next = r_next, +- .stop = r_stop, +- .show = r_show, +-}; +- +-static int vram_open(struct inode *inode, struct file *file) ++static int vram_debug_open(struct inode *inode, struct file *file) + { +- return seq_open(file, &resource_op); ++ return single_open(file, vram_debug_show, inode->i_private); + } + +-static const struct file_operations proc_vram_operations = { +- .open = vram_open, +- .read = seq_read, +- .llseek = seq_lseek, +- .release = seq_release, ++static const struct file_operations vram_debug_fops = { ++ .open = vram_debug_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, + }; + +-static int __init omap_vram_create_proc(void) ++static int __init omap_vram_create_debugfs(void) + { +- proc_create("omap-vram", 0, NULL, &proc_vram_operations); ++ struct dentry *d; ++ ++ d = debugfs_create_file("vram", S_IRUGO, NULL, ++ NULL, &vram_debug_fops); ++ if (IS_ERR(d)) ++ return PTR_ERR(d); + + return 0; + } +@@ -487,7 +453,7 @@ static int __init omap_vram_create_proc(void) + + static __init int omap_vram_init(void) + { +- int i, r; ++ int i; + + vram_initialized = 1; + +@@ -495,10 +461,9 @@ static __init int omap_vram_init(void) + omap_vram_add_region(postponed_regions[i].paddr, + postponed_regions[i].size); + +-#ifdef CONFIG_PROC_FS +- r = omap_vram_create_proc(); +- if (r) +- return -ENOMEM; ++#ifdef CONFIG_DEBUG_FS ++ if (omap_vram_create_debugfs()) ++ pr_err("VRAM: Failed to create debugfs file\n"); + #endif + + return 0; +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch b/recipes/linux/linux-omap-2.6.29/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch new file mode 100644 index 0000000000..b8f89b6239 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch @@ -0,0 +1,34 @@ +From 635fa66abe6e502c9b78b1dc66757bf67fd163e1 Mon Sep 17 00:00:00 2001 +From: Imre Deak <imre.deak@nokia.com> +Date: Wed, 22 Apr 2009 14:40:48 +0200 +Subject: [PATCH] DSS2: VRAM: fix section mismatch warning + +postponed_regions are accessed from the non __init +omap_vram_add_region(). + +Signed-off-by: Imre Deak <imre.deak@nokia.com> +--- + arch/arm/plat-omap/vram.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c +index e847579..b126a64 100644 +--- a/arch/arm/plat-omap/vram.c ++++ b/arch/arm/plat-omap/vram.c +@@ -63,11 +63,11 @@ + #define MAX_POSTPONED_REGIONS 10 + + static bool vram_initialized; +-static int postponed_cnt __initdata; ++static int postponed_cnt; + static struct { + unsigned long paddr; + size_t size; +-} postponed_regions[MAX_POSTPONED_REGIONS] __initdata; ++} postponed_regions[MAX_POSTPONED_REGIONS]; + + struct vram_alloc { + struct list_head list; +-- +1.5.6.5 + diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch b/recipes/linux/linux-omap-2.6.29/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch new file mode 100644 index 0000000000..f591fb700a --- /dev/null +++ b/recipes/linux/linux-omap-2.6.29/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch @@ -0,0 +1,41 @@ +From c7ce3c5e9f7e28900b8ea9c3e1afe41dcdc0863d Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen <tomi.valkeinen@nokia.com> +Date: Thu, 23 Apr 2009 10:46:53 +0300 +Subject: [PATCH] DSS2: disable LCD & DIGIT before resetting DSS + +This seems to fix the synclost problem that we get, if the bootloader +starts the DSS and the kernel resets it. +--- + drivers/video/omap2/dss/dss.c | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c +index adc1f34..aab9758 100644 +--- a/drivers/video/omap2/dss/dss.c ++++ b/drivers/video/omap2/dss/dss.c +@@ -285,6 +285,11 @@ int dss_init(bool skip_init) + } + + if (!skip_init) { ++ /* disable LCD and DIGIT output. This seems to fix the synclost ++ * problem that we get, if the bootloader starts the DSS and ++ * the kernel resets it */ ++ omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440); ++ + /* We need to wait here a bit, otherwise we sometimes start to + * get synclost errors, and after that only power cycle will + * restore DSS functionality. I have no idea why this happens. +@@ -294,10 +299,7 @@ int dss_init(bool skip_init) + msleep(50); + + _omap_dss_reset(); +- + } +- else +- printk("DSS SKIP RESET\n"); + + /* autoidle */ + REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0); +-- +1.5.6.5 + |