This is part 1 of 5 of a patchset implementing the following in MeeGo kernel:
- Add OMAP DSS2 patches for supporting upgraded SGX driver: linux-2.6.35-OMAP-DSS2-in_use-flag-for-dss_cache.patch linux-2.6.35-OMAP-DSS2-Keep-track-whether-overlay-managers-are-en.patch linux-2.6.35-OMAP-DSS2-Add-GO-notifiers.patch - Upgrade N900 SGX drivers to 201003002 in order to not have a non-production snapshot of the drivers. Fixes BMC#5711 - Add SGX platform device to N900 board file. These patches apply in order: linux-2.6.35-OMAP-DSS2-in_use-flag-for-dss_cache.patch linux-2.6.35-OMAP-DSS2-Keep-track-whether-overlay-managers-are-en.patch linux-2.6.35-OMAP-DSS2-Add-GO-notifiers.patch linux-2.6-N900-add-sgx-platform-device.patch linux-2.6-SGX-N900-upgrade-201003002.patch
From 0dc42cc67c0db79ddb0ec9ce3f84ff7afacce39d Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen <[email protected]> Date: Tue, 27 Apr 2010 17:34:02 +0300 Subject: [PATCH] OMAP: DSS2: in_use flag for dss_cache This patch introduces in_use flag for manager_cache_data. The flag can be enabled with omap_dss_lock_cache() and disabled with omap_dss_unlock_cache(). When the flag is enabled, manager->apply doesn't change the cache for that manager. When the flag is disabled with omap_dss_unlock_cache(), the settings will be applied. This was not required previously as all updates were done with one transfer to the panel, and the cache values were written to hardware registers at the start of the transfer. Thus there was no need to lock the cache. When the update is done in two parts, the two parts have to be transferred with the same DSS settings. This means that we need to lock the cache for the duration of the transfer so that nobody will change it. Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Carsten Valdemar Munk <[email protected]> --- Index: linux-2.6.34-master/arch/arm/plat-omap/include/plat/display.h =================================================================== --- linux-2.6.34-master.orig/arch/arm/plat-omap/include/plat/display.h 2010-08-04 09:14:12.000000000 +0000 +++ linux-2.6.34-master/arch/arm/plat-omap/include/plat/display.h 2010-08-04 09:14:32.000000000 +0000 @@ -541,6 +541,9 @@ int omap_dss_get_num_overlays(void); struct omap_overlay *omap_dss_get_overlay(int num); +void omap_dss_lock_cache(void); +void omap_dss_unlock_cache(void); + void omapdss_default_get_resolution(struct omap_dss_device *dssdev, u16 *xres, u16 *yres); int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev); Index: linux-2.6.34-master/drivers/video/omap2/dss/manager.c =================================================================== --- linux-2.6.34-master.orig/drivers/video/omap2/dss/manager.c 2010-08-04 09:14:20.000000000 +0000 +++ linux-2.6.34-master/drivers/video/omap2/dss/manager.c 2010-08-04 09:15:42.000000000 +0000 @@ -440,8 +440,12 @@ /* manual update region */ u16 x, y, w, h; + + bool in_use; }; +static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr); + static struct { spinlock_t lock; struct overlay_cache_data overlay_cache[3]; @@ -450,7 +454,26 @@ bool irq_enabled; } dss_cache; +void omap_dss_lock_cache(void) +{ + unsigned long flags; + spin_lock_irqsave(&dss_cache.lock, flags); + BUG_ON(dss_cache.manager_cache[0].in_use); + dss_cache.manager_cache[0].in_use = true; + spin_unlock_irqrestore(&dss_cache.lock, flags); +} +EXPORT_SYMBOL(omap_dss_lock_cache); +void omap_dss_unlock_cache(void) +{ + unsigned long flags; + spin_lock_irqsave(&dss_cache.lock, flags); + BUG_ON(!dss_cache.manager_cache[0].in_use); + dss_cache.manager_cache[0].in_use = false; + spin_unlock_irqrestore(&dss_cache.lock, flags); + omap_dss_mgr_apply(omap_dss_get_overlay_manager(0)); +} +EXPORT_SYMBOL(omap_dss_unlock_cache); static int omap_dss_set_device(struct omap_overlay_manager *mgr, struct omap_dss_device *dssdev) @@ -1178,6 +1201,12 @@ continue; oc = &dss_cache.overlay_cache[ovl->id]; + if (ovl->manager) { + mc = &dss_cache.manager_cache[ovl->manager->id]; + + if (mc->in_use) + continue; + } if (!overlay_enabled(ovl)) { if (oc->enabled) { @@ -1247,6 +1276,9 @@ mc = &dss_cache.manager_cache[mgr->id]; + if (mc->in_use) + continue; + if (mgr->device_changed) { mgr->device_changed = false; mgr->info_dirty = true; @@ -1305,6 +1337,13 @@ oc = &dss_cache.overlay_cache[ovl->id]; + if (ovl->manager) { + mc = &dss_cache.manager_cache[ovl->manager->id]; + + if (mc->in_use) + continue; + } + if (!oc->enabled) continue;
_______________________________________________ MeeGo-dev mailing list [email protected] http://lists.meego.com/listinfo/meego-dev
