MLK-11687 video: mxsfb: remove timestamp in wait for vsync ioctl
authorFancy Fang <chen.fang@freescale.com>
Wed, 14 Oct 2015 09:37:13 +0000 (17:37 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:55 +0000 (14:48 -0500)
Remove the timestamp usage in the 'MXCFB_WAIT_FOR_VSYNC'
ioctl handler, since the 64 bit timestamp would cause
data overflow when writing it to user memory.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
(cherry picked from commit 4bfbf67a384f1292d217769b77858c08f38fe658)

Conflicts:
drivers/video/mxsfb.c

drivers/video/fbdev/mxsfb.c

index 7e0e445..ea7a34e 100644 (file)
@@ -216,7 +216,6 @@ struct mxsfb_info {
        struct regulator *reg_lcd;
        bool wait4vsync;
        struct completion vsync_complete;
-       ktime_t vsync_nf_timestamp;
        struct completion flip_complete;
        int cur_blank;
        int restore_blank;
@@ -413,7 +412,6 @@ static irqreturn_t mxsfb_irq_handler(int irq, void *dev_id)
                writel(CTRL1_VSYNC_EDGE_IRQ_EN,
                             host->base + LCDC_CTRL1 + REG_CLR);
                host->wait4vsync = 0;
-               host->vsync_nf_timestamp = ktime_get();
                complete(&host->vsync_complete);
        }
 
@@ -870,16 +868,7 @@ static int mxsfb_ioctl(struct fb_info *fb_info, unsigned int cmd,
 
        switch (cmd) {
        case MXCFB_WAIT_FOR_VSYNC:
-               {
-                       long long timestamp;
-                       struct mxsfb_info *host = to_imxfb_host(fb_info);
-                       ret = mxsfb_wait_for_vsync(fb_info);
-                       timestamp = ktime_to_ns(host->vsync_nf_timestamp);
-                       if ((ret == 0) && copy_to_user((void *)arg,
-                               &timestamp, sizeof(timestamp))) {
-                           ret = -EFAULT;
-                       }
-               }
+               ret = mxsfb_wait_for_vsync(fb_info);
                break;
        default:
                break;