diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-07 09:47:28 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-07 09:51:36 -0500 |
commit | 636f4e1b45c6204c6912cefa2bdbe22e00784a43 (patch) | |
tree | a3b93ff53f91c714e9817c75de0060c3827a91c7 /drivers/video | |
parent | 09645d258334c650cb65a93f55d9acdcd4420d44 (diff) |
OMAPFB: move dssdev->sync call out from omapfb_realloc_fbmem
Currently omapfb_realloc_fbmem() calls dssdev->sync to ensure any
possible frame update is finished. This patch moves the call to
dssdev->sync from omapfb_realloc_fbmem to the callers of
omapfb_realloc_fbmem.
This keeps dssdev related calls out from omapfb_realloc_fbmem, which
makes sense as the function should only deal with fb memory. Also, this
seems to avoid a lockdep warning about possible circular locking.
However, the exact reason for that warning is still unclear.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-ioctl.c | 4 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 4 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-sysfs.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 94de47ea71a5..d30b45d72649 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c | |||
@@ -211,6 +211,7 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi) | |||
211 | { | 211 | { |
212 | struct omapfb_info *ofbi = FB2OFB(fbi); | 212 | struct omapfb_info *ofbi = FB2OFB(fbi); |
213 | struct omapfb2_device *fbdev = ofbi->fbdev; | 213 | struct omapfb2_device *fbdev = ofbi->fbdev; |
214 | struct omap_dss_device *display = fb2display(fbi); | ||
214 | struct omapfb2_mem_region *rg; | 215 | struct omapfb2_mem_region *rg; |
215 | int r = 0, i; | 216 | int r = 0, i; |
216 | size_t size; | 217 | size_t size; |
@@ -220,6 +221,9 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi) | |||
220 | 221 | ||
221 | size = PAGE_ALIGN(mi->size); | 222 | size = PAGE_ALIGN(mi->size); |
222 | 223 | ||
224 | if (display && display->driver->sync) | ||
225 | display->driver->sync(display); | ||
226 | |||
223 | rg = ofbi->region; | 227 | rg = ofbi->region; |
224 | 228 | ||
225 | down_write_nested(&rg->lock, rg->id); | 229 | down_write_nested(&rg->lock, rg->id); |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 1a69d7ca92e5..85130fa7ae5a 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -1611,7 +1611,6 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type) | |||
1611 | { | 1611 | { |
1612 | struct omapfb_info *ofbi = FB2OFB(fbi); | 1612 | struct omapfb_info *ofbi = FB2OFB(fbi); |
1613 | struct omapfb2_device *fbdev = ofbi->fbdev; | 1613 | struct omapfb2_device *fbdev = ofbi->fbdev; |
1614 | struct omap_dss_device *display = fb2display(fbi); | ||
1615 | struct omapfb2_mem_region *rg = ofbi->region; | 1614 | struct omapfb2_mem_region *rg = ofbi->region; |
1616 | unsigned long old_size = rg->size; | 1615 | unsigned long old_size = rg->size; |
1617 | unsigned long old_paddr = rg->paddr; | 1616 | unsigned long old_paddr = rg->paddr; |
@@ -1626,9 +1625,6 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type) | |||
1626 | if (old_size == size && old_type == type) | 1625 | if (old_size == size && old_type == type) |
1627 | return 0; | 1626 | return 0; |
1628 | 1627 | ||
1629 | if (display && display->driver->sync) | ||
1630 | display->driver->sync(display); | ||
1631 | |||
1632 | omapfb_free_fbmem(fbi); | 1628 | omapfb_free_fbmem(fbi); |
1633 | 1629 | ||
1634 | if (size == 0) { | 1630 | if (size == 0) { |
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c index 17aa174e187c..18fa9e1d0033 100644 --- a/drivers/video/omap2/omapfb/omapfb-sysfs.c +++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c | |||
@@ -441,6 +441,7 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr, | |||
441 | struct fb_info *fbi = dev_get_drvdata(dev); | 441 | struct fb_info *fbi = dev_get_drvdata(dev); |
442 | struct omapfb_info *ofbi = FB2OFB(fbi); | 442 | struct omapfb_info *ofbi = FB2OFB(fbi); |
443 | struct omapfb2_device *fbdev = ofbi->fbdev; | 443 | struct omapfb2_device *fbdev = ofbi->fbdev; |
444 | struct omap_dss_device *display = fb2display(fbi); | ||
444 | struct omapfb2_mem_region *rg; | 445 | struct omapfb2_mem_region *rg; |
445 | unsigned long size; | 446 | unsigned long size; |
446 | int r; | 447 | int r; |
@@ -455,6 +456,9 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr, | |||
455 | if (!lock_fb_info(fbi)) | 456 | if (!lock_fb_info(fbi)) |
456 | return -ENODEV; | 457 | return -ENODEV; |
457 | 458 | ||
459 | if (display && display->driver->sync) | ||
460 | display->driver->sync(display); | ||
461 | |||
458 | rg = ofbi->region; | 462 | rg = ofbi->region; |
459 | 463 | ||
460 | down_write_nested(&rg->lock, rg->id); | 464 | down_write_nested(&rg->lock, rg->id); |