@@ -525,6 +525,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;
@@ -792,6 +793,23 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
break;
}
+ case OMAPFB_GET_DISPLAY_INFO: {
+ DBG("ioctl GET_DISPLAY_INFO\n");
+
+ if (display == NULL) {
+ r = -ENODEV;
+ break;
+ }
+
+ p.display_info.width = display->panel.timings.x_res;
+ p.display_info.height = display->panel.timings.y_res;
+
+ 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;
@@ -58,6 +58,7 @@
#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_RESERVE_BUFFER OMAP_IOW(63, struct omapfb_res_buf_info)
+#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(64, struct omapfb_display_info)
#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
@@ -216,6 +217,12 @@ struct omapfb_tearsync_info {
__u16 reserved2;
};
+struct omapfb_display_info {
+ __u16 width;
+ __u16 height;
+ __u32 reserved[5];
+};
+
#ifdef __KERNEL__
#include <plat/board.h>