aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-14 10:32:13 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-15 08:14:34 -0500
commit6dd2e42bd892b2e16080ceba451fd9c3ed633145 (patch)
tree9df20142518b3c6276a50a936925da494c7808c9
parent92fe0ff16a9299233104187bd6ceb2101501badc (diff)
OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO
Previously the only place to get the size of the display was from the DSS's sysfs interface, making, for example, configuring overlays and doing updates on manual displays more difficult. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c24
-rw-r--r--include/linux/omapfb.h9
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 4c4bafdfaa43..33fc1459a7c9 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -483,6 +483,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
483 struct omapfb_memory_read memory_read; 483 struct omapfb_memory_read memory_read;
484 struct omapfb_vram_info vram_info; 484 struct omapfb_vram_info vram_info;
485 struct omapfb_tearsync_info tearsync_info; 485 struct omapfb_tearsync_info tearsync_info;
486 struct omapfb_display_info display_info;
486 } p; 487 } p;
487 488
488 int r = 0; 489 int r = 0;
@@ -741,6 +742,29 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
741 break; 742 break;
742 } 743 }
743 744
745 case OMAPFB_GET_DISPLAY_INFO: {
746 u16 xres, yres;
747
748 DBG("ioctl GET_DISPLAY_INFO\n");
749
750 if (display == NULL) {
751 r = -ENODEV;
752 break;
753 }
754
755 display->get_resolution(display, &xres, &yres);
756
757 p.display_info.xres = xres;
758 p.display_info.yres = yres;
759 p.display_info.width = 0;
760 p.display_info.height = 0;
761
762 if (copy_to_user((void __user *)arg, &p.display_info,
763 sizeof(p.display_info)))
764 r = -EFAULT;
765 break;
766 }
767
744 default: 768 default:
745 dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd); 769 dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd);
746 r = -EINVAL; 770 r = -EINVAL;
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
index f46c40ac6d45..9bdd91486b49 100644
--- a/include/linux/omapfb.h
+++ b/include/linux/omapfb.h
@@ -57,6 +57,7 @@
57#define OMAPFB_WAITFORGO OMAP_IO(60) 57#define OMAPFB_WAITFORGO OMAP_IO(60)
58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) 58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) 59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
60#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info)
60 61
61#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff 62#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
62#define OMAPFB_CAPS_LCDC_MASK 0x00fff000 63#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
@@ -206,6 +207,14 @@ struct omapfb_tearsync_info {
206 __u16 reserved2; 207 __u16 reserved2;
207}; 208};
208 209
210struct omapfb_display_info {
211 __u16 xres;
212 __u16 yres;
213 __u32 width; /* phys width of the display in micrometers */
214 __u32 height; /* phys height of the display in micrometers */
215 __u32 reserved[5];
216};
217
209#ifdef __KERNEL__ 218#ifdef __KERNEL__
210 219
211#include <plat/board.h> 220#include <plat/board.h>