From a582ae61e258a9e5565680fa01651efaf97f9e20 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 14 Jan 2010 17:32:13 +0200 Subject: [PATCH] --- yaml --- r: 184847 b: refs/heads/master c: 6dd2e42bd892b2e16080ceba451fd9c3ed633145 h: refs/heads/master i: 184845: c1d8b395b6cc268d1770d0045ef07fc1271cd76a 184843: 3fad390927464d4a790ce5e4eb228e0578a6e510 184839: 95e2eda1b0af63ddd05b49dd964ae896b84935d9 184831: 7d72d5cbd42dfc6ed2e3286a9455353e58a083a0 v: v3 --- [refs] | 2 +- .../drivers/video/omap2/omapfb/omapfb-ioctl.c | 24 +++++++++++++++++++ trunk/include/linux/omapfb.h | 9 +++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 44b2d4235c6e..ad5d5b8d8890 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 92fe0ff16a9299233104187bd6ceb2101501badc +refs/heads/master: 6dd2e42bd892b2e16080ceba451fd9c3ed633145 diff --git a/trunk/drivers/video/omap2/omapfb/omapfb-ioctl.c b/trunk/drivers/video/omap2/omapfb/omapfb-ioctl.c index 4c4bafdfaa43..33fc1459a7c9 100644 --- a/trunk/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/trunk/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -483,6 +483,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) struct omapfb_memory_read memory_read; struct omapfb_vram_info vram_info; struct omapfb_tearsync_info tearsync_info; + struct omapfb_display_info display_info; } p; int r = 0; @@ -741,6 +742,29 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) break; } + case OMAPFB_GET_DISPLAY_INFO: { + u16 xres, yres; + + DBG("ioctl GET_DISPLAY_INFO\n"); + + if (display == NULL) { + r = -ENODEV; + break; + } + + display->get_resolution(display, &xres, &yres); + + p.display_info.xres = xres; + p.display_info.yres = yres; + p.display_info.width = 0; + p.display_info.height = 0; + + if (copy_to_user((void __user *)arg, &p.display_info, + sizeof(p.display_info))) + r = -EFAULT; + break; + } + default: dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd); r = -EINVAL; diff --git a/trunk/include/linux/omapfb.h b/trunk/include/linux/omapfb.h index f46c40ac6d45..9bdd91486b49 100644 --- a/trunk/include/linux/omapfb.h +++ b/trunk/include/linux/omapfb.h @@ -57,6 +57,7 @@ #define OMAPFB_WAITFORGO OMAP_IO(60) #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) +#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info) #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 @@ -206,6 +207,14 @@ struct omapfb_tearsync_info { __u16 reserved2; }; +struct omapfb_display_info { + __u16 xres; + __u16 yres; + __u32 width; /* phys width of the display in micrometers */ + __u32 height; /* phys height of the display in micrometers */ + __u32 reserved[5]; +}; + #ifdef __KERNEL__ #include