aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb/omapfb-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-ioctl.c')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c46
1 files changed, 15 insertions, 31 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 532a31b3d96b..d30b45d72649 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -28,10 +28,10 @@
28#include <linux/omapfb.h> 28#include <linux/omapfb.h>
29#include <linux/vmalloc.h> 29#include <linux/vmalloc.h>
30#include <linux/export.h> 30#include <linux/export.h>
31#include <linux/sizes.h>
31 32
32#include <video/omapdss.h> 33#include <video/omapdss.h>
33#include <video/omapvrfb.h> 34#include <video/omapvrfb.h>
34#include <plat/vram.h>
35 35
36#include "omapfb.h" 36#include "omapfb.h"
37 37
@@ -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);
@@ -279,7 +283,7 @@ static int omapfb_query_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
279 return 0; 283 return 0;
280} 284}
281 285
282static int omapfb_update_window_nolock(struct fb_info *fbi, 286static int omapfb_update_window(struct fb_info *fbi,
283 u32 x, u32 y, u32 w, u32 h) 287 u32 x, u32 y, u32 w, u32 h)
284{ 288{
285 struct omap_dss_device *display = fb2display(fbi); 289 struct omap_dss_device *display = fb2display(fbi);
@@ -299,27 +303,6 @@ static int omapfb_update_window_nolock(struct fb_info *fbi,
299 return display->driver->update(display, x, y, w, h); 303 return display->driver->update(display, x, y, w, h);
300} 304}
301 305
302/* This function is exported for SGX driver use */
303int omapfb_update_window(struct fb_info *fbi,
304 u32 x, u32 y, u32 w, u32 h)
305{
306 struct omapfb_info *ofbi = FB2OFB(fbi);
307 struct omapfb2_device *fbdev = ofbi->fbdev;
308 int r;
309
310 if (!lock_fb_info(fbi))
311 return -ENODEV;
312 omapfb_lock(fbdev);
313
314 r = omapfb_update_window_nolock(fbi, x, y, w, h);
315
316 omapfb_unlock(fbdev);
317 unlock_fb_info(fbi);
318
319 return r;
320}
321EXPORT_SYMBOL(omapfb_update_window);
322
323int omapfb_set_update_mode(struct fb_info *fbi, 306int omapfb_set_update_mode(struct fb_info *fbi,
324 enum omapfb_update_mode mode) 307 enum omapfb_update_mode mode)
325{ 308{
@@ -646,7 +629,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
646 break; 629 break;
647 } 630 }
648 631
649 r = omapfb_update_window_nolock(fbi, p.uwnd_o.x, p.uwnd_o.y, 632 r = omapfb_update_window(fbi, p.uwnd_o.x, p.uwnd_o.y,
650 p.uwnd_o.width, p.uwnd_o.height); 633 p.uwnd_o.width, p.uwnd_o.height);
651 break; 634 break;
652 635
@@ -663,7 +646,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
663 break; 646 break;
664 } 647 }
665 648
666 r = omapfb_update_window_nolock(fbi, p.uwnd.x, p.uwnd.y, 649 r = omapfb_update_window(fbi, p.uwnd.x, p.uwnd.y,
667 p.uwnd.width, p.uwnd.height); 650 p.uwnd.width, p.uwnd.height);
668 break; 651 break;
669 652
@@ -853,14 +836,15 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
853 break; 836 break;
854 837
855 case OMAPFB_GET_VRAM_INFO: { 838 case OMAPFB_GET_VRAM_INFO: {
856 unsigned long vram, free, largest;
857
858 DBG("ioctl GET_VRAM_INFO\n"); 839 DBG("ioctl GET_VRAM_INFO\n");
859 840
860 omap_vram_get_info(&vram, &free, &largest); 841 /*
861 p.vram_info.total = vram; 842 * We don't have the ability to get this vram info anymore.
862 p.vram_info.free = free; 843 * Fill in something that should keep the applications working.
863 p.vram_info.largest_free_block = largest; 844 */
845 p.vram_info.total = SZ_1M * 64;
846 p.vram_info.free = SZ_1M * 64;
847 p.vram_info.largest_free_block = SZ_1M * 64;
864 848
865 if (copy_to_user((void __user *)arg, &p.vram_info, 849 if (copy_to_user((void __user *)arg, &p.vram_info,
866 sizeof(p.vram_info))) 850 sizeof(p.vram_info)))