]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
OMAPDSS: OMAPFB: Use omapdss_display_get_dimensions()
authorDandawate Saket <dsaket@ti.com>
Thu, 27 Jun 2013 07:07:19 +0000 (00:07 -0700)
committerPraneeth Bajjuri <praneeth@ti.com>
Fri, 12 Jul 2013 22:28:58 +0000 (17:28 -0500)
Use generic omapdss_display_get_dimensions() to get the panel
dimensions.

Change-Id: I33d5d19fe0a48d0dc2a90c49e3439c9bbd56074c
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dandawate Saket <dsaket@ti.com>
drivers/video/omap2/dss/display.c
drivers/video/omap2/omapfb/omapfb-ioctl.c
drivers/video/omap2/omapfb/omapfb-main.c
include/video/omapdss.h [changed mode: 0644->0755]

index 0aa8ad8f96679db07b11c6221f7a3eff9f150ffe..cb34f5700bec8a79dd36a3f46c2191b7331eca02 100644 (file)
@@ -39,6 +39,18 @@ void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
 }
 EXPORT_SYMBOL(omapdss_default_get_resolution);
 
+void omapdss_display_get_dimensions(struct omap_dss_device *dssdev,
+                               u32 *width_in_um, u32 *height_in_um)
+{
+       if (dssdev->driver->get_dimensions) {
+               dssdev->driver->get_dimensions(dssdev,
+                                               width_in_um, width_in_um);
+       } else {
+               *width_in_um = dssdev->panel.width_in_um;
+               *height_in_um = dssdev->panel.height_in_um;
+       }
+}
+
 int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)
 {
        switch (dssdev->type) {
index be2abdd0afe8ed1ba2397cc4bcd8cceaa0748c08..ff5e497342bff4b1f7bd0b25f268ef3838b124cc 100644 (file)
@@ -876,6 +876,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
 
        case OMAPFB_GET_DISPLAY_INFO: {
                u16 xres, yres;
+               u32 w, h;
 
                DBG("ioctl GET_DISPLAY_INFO\n");
 
@@ -889,15 +890,9 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                p.display_info.xres = xres;
                p.display_info.yres = yres;
 
-               if (display->driver->get_dimensions) {
-                       u32 w, h;
-                       display->driver->get_dimensions(display, &w, &h);
-                       p.display_info.width = w;
-                       p.display_info.height = h;
-               } else {
-                       p.display_info.width = 0;
-                       p.display_info.height = 0;
-               }
+               omapdss_display_get_dimensions(display, &w, &h);
+               p.display_info.width = w;
+               p.display_info.height = h;
 
                if (copy_to_user((void __user *)arg, &p.display_info,
                                        sizeof(p.display_info)))
index fc0a1bc6744b9737964310ccc23b2b1d6a7aea8e..d62b536e57593d5d46972343f2111c928174ec90 100644 (file)
@@ -670,6 +670,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
        enum omap_color_mode mode = 0;
        int i;
        int r;
+       u32 w = 0, h = 0;
 
        DBG("check_fb_var %d\n", ofbi->id);
 
@@ -707,9 +708,10 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
                        var->xres, var->yres,
                        var->xres_virtual, var->yres_virtual);
 
-       if (display && display->driver->get_dimensions) {
-               u32 w, h;
-               display->driver->get_dimensions(display, &w, &h);
+       if (display)
+               omapdss_display_get_dimensions(display, &w, &h);
+
+       if (w && h) {
                var->width = DIV_ROUND_CLOSEST(w, 1000);
                var->height = DIV_ROUND_CLOSEST(h, 1000);
        } else {
old mode 100644 (file)
new mode 100755 (executable)
index 6819d0a..5c5d15a
@@ -797,10 +797,8 @@ struct omap_dss_device {
                enum omap_dss_dsi_mode dsi_mode;
                struct omap_dss_dsi_videomode_timings dsi_vm_timings;
                struct s3d_disp_info s3d_info;
-
                u32 width_in_um;
                u32 height_in_um;
-
        } panel;
 
        struct {
@@ -1010,6 +1008,8 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
 #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
 #define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
 
+void omapdss_display_get_dimensions(struct omap_dss_device *dssdev,
+                                u32 *width_in_um, u32 *height_in_um);
 void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
                bool enable);
 int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);