aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb/omapfb.h
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 06:19:05 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 06:19:05 -0500
commit3ed37d9aba486dece93e05d68f691b80ee100900 (patch)
tree3e391eb45694c948c608a9c5ce99bc2cc0b52164 /drivers/video/omap2/omapfb/omapfb.h
parentc7e1eae537652330cec3fbf5f8f50000b2f24269 (diff)
Revert "OMAPFB: simplify locking"
This reverts commit b41deecbda70067b26a3a7704fdf967a7940935b. The simpler locking causes huge latencies when two processes use the omapfb, even if they use different framebuffers. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb.h')
-rw-r--r--drivers/video/omap2/omapfb/omapfb.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 2b5264475ed4..623cd872a367 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -62,6 +62,8 @@ struct omapfb2_mem_region {
62 bool alloc; /* allocated by the driver */ 62 bool alloc; /* allocated by the driver */
63 bool map; /* kernel mapped by the driver */ 63 bool map; /* kernel mapped by the driver */
64 atomic_t map_count; 64 atomic_t map_count;
65 struct rw_semaphore lock;
66 atomic_t lock_count;
65}; 67};
66 68
67/* appended to fb_info */ 69/* appended to fb_info */
@@ -189,4 +191,18 @@ static inline int omapfb_overlay_enable(struct omap_overlay *ovl,
189 return ovl->disable(ovl); 191 return ovl->disable(ovl);
190} 192}
191 193
194static inline struct omapfb2_mem_region *
195omapfb_get_mem_region(struct omapfb2_mem_region *rg)
196{
197 down_read_nested(&rg->lock, rg->id);
198 atomic_inc(&rg->lock_count);
199 return rg;
200}
201
202static inline void omapfb_put_mem_region(struct omapfb2_mem_region *rg)
203{
204 atomic_dec(&rg->lock_count);
205 up_read(&rg->lock);
206}
207
192#endif 208#endif