rg = ofbi->region;
down_write_nested(&rg->lock, rg->id);
+ atomic_inc(&rg->lock_count);
if (atomic_read(&rg->map_count)) {
r = -EBUSY;
}
out:
+ atomic_dec(&rg->lock_count);
up_write(&rg->lock);
return r;
DBG("check_fb_var %d\n", ofbi->id);
+ WARN_ON(!atomic_read(&ofbi->region->lock_count));
+
r = fb_mode_to_dss_mode(var, &mode);
if (r) {
DBG("cannot convert var to omap dss mode\n");
int rotation = var->rotate;
int i;
+ WARN_ON(!atomic_read(&ofbi->region->lock_count));
+
for (i = 0; i < ofbi->num_overlays; i++) {
if (ovl != ofbi->overlays[i])
continue;
fill_fb(fbi);
#endif
+ WARN_ON(!atomic_read(&ofbi->region->lock_count));
+
for (i = 0; i < ofbi->num_overlays; i++) {
ovl = ofbi->overlays[i];
rg = ofbi->region;
down_write_nested(&rg->lock, rg->id);
+ atomic_inc(&rg->lock_count);
if (atomic_read(&rg->map_count)) {
r = -EBUSY;
r = count;
out:
+ atomic_dec(&rg->lock_count);
up_write(&rg->lock);
unlock_fb_info(fbi);
bool map; /* kernel mapped by the driver */
atomic_t map_count;
struct rw_semaphore lock;
+ atomic_t lock_count;
};
/* appended to fb_info */
omapfb_get_mem_region(struct omapfb2_mem_region *rg)
{
down_read_nested(&rg->lock, rg->id);
+ atomic_inc(&rg->lock_count);
return rg;
}
static inline void omapfb_put_mem_region(struct omapfb2_mem_region *rg)
{
+ atomic_dec(&rg->lock_count);
up_read(&rg->lock);
}