aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorJani Nikula <ext-jani.1.nikula@nokia.com>2010-06-16 08:26:36 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-11 07:19:24 -0400
commit7a0987bf2cf2683901d0cd7f1504023da2584c5f (patch)
treefe5db5f868acb5c17578759c9d71c0cdf3b08aa1 /drivers/video/omap2
parentb4de838e9ff17695c462e6532a347746c446d10a (diff)
OMAP: DSS2: Add method for querying display dimensions from DSS drivers
Add get_dimensions() to struct omap_dss_driver. Use the call, if supported by the driver, in OMAPFB. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c12
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 3e4ee4dc2fb..cff450392b7 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -895,8 +895,16 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
895 895
896 p.display_info.xres = xres; 896 p.display_info.xres = xres;
897 p.display_info.yres = yres; 897 p.display_info.yres = yres;
898 p.display_info.width = 0; 898
899 p.display_info.height = 0; 899 if (display->driver->get_dimensions) {
900 u32 w, h;
901 display->driver->get_dimensions(display, &w, &h);
902 p.display_info.width = w;
903 p.display_info.height = h;
904 } else {
905 p.display_info.width = 0;
906 p.display_info.height = 0;
907 }
900 908
901 if (copy_to_user((void __user *)arg, &p.display_info, 909 if (copy_to_user((void __user *)arg, &p.display_info,
902 sizeof(p.display_info))) 910 sizeof(p.display_info)))
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 606f6eec4e1..c0c846c8f23 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -702,8 +702,16 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
702 var->xres, var->yres, 702 var->xres, var->yres,
703 var->xres_virtual, var->yres_virtual); 703 var->xres_virtual, var->yres_virtual);
704 704
705 var->height = -1; 705 if (display && display->driver->get_dimensions) {
706 var->width = -1; 706 u32 w, h;
707 display->driver->get_dimensions(display, &w, &h);
708 var->width = DIV_ROUND_CLOSEST(w, 1000);
709 var->height = DIV_ROUND_CLOSEST(h, 1000);
710 } else {
711 var->height = -1;
712 var->width = -1;
713 }
714
707 var->grayscale = 0; 715 var->grayscale = 0;
708 716
709 if (display && display->driver->get_timings) { 717 if (display && display->driver->get_timings) {