diff options
author | Jani Nikula <ext-jani.1.nikula@nokia.com> | 2010-06-16 15:26:36 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-05-11 14:19:24 +0300 |
commit | 7a0987bf2cf2683901d0cd7f1504023da2584c5f (patch) | |
tree | fe5db5f868acb5c17578759c9d71c0cdf3b08aa1 /drivers/video/omap2/omapfb | |
parent | b4de838e9ff17695c462e6532a347746c446d10a (diff) | |
download | blackbird-op-linux-7a0987bf2cf2683901d0cd7f1504023da2584c5f.tar.gz blackbird-op-linux-7a0987bf2cf2683901d0cd7f1504023da2584c5f.zip |
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/omapfb')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-ioctl.c | 12 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 12 |
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 3e4ee4dc2fb5..cff450392b79 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) p.display_info.xres = xres; p.display_info.yres = yres; - p.display_info.width = 0; - p.display_info.height = 0; + + 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; + } if (copy_to_user((void __user *)arg, &p.display_info, sizeof(p.display_info))) diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 606f6eec4e17..c0c846c8f231 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) var->xres, var->yres, var->xres_virtual, var->yres_virtual); - var->height = -1; - var->width = -1; + if (display && display->driver->get_dimensions) { + u32 w, h; + display->driver->get_dimensions(display, &w, &h); + var->width = DIV_ROUND_CLOSEST(w, 1000); + var->height = DIV_ROUND_CLOSEST(h, 1000); + } else { + var->height = -1; + var->width = -1; + } + var->grayscale = 0; if (display && display->driver->get_timings) { |