summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorguoyin.chen <guoyin.chen@freescale.com>2013-07-22 16:14:24 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2013-07-22 17:29:40 +0800
commita55944b9f145da4da0b0dfe64521f265c23b061e (patch)
tree874ba11b38c01ac19d9aabd699eb4e4591e48443 /drivers
parent842dceecb17182572b0ce1d2d0c0e9a560652eb0 (diff)
ENGR00272031 Lcdif FB:Add timestamp in MXCFB_WAIT_FOR_VSYNC's return value
Android Framework need the timestamp from VSYNC to driver the UI update Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mxc/mxc_elcdif_fb.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/video/mxc/mxc_elcdif_fb.c b/drivers/video/mxc/mxc_elcdif_fb.c
index ebec7bcfcfa6..b3691b540522 100644
--- a/drivers/video/mxc/mxc_elcdif_fb.c
+++ b/drivers/video/mxc/mxc_elcdif_fb.c
@@ -75,6 +75,7 @@ struct mxc_elcdif_fb_data {
bool running;
struct completion vsync_complete;
struct completion frame_done_complete;
+ ktime_t vsync_nf_timestamp;
struct semaphore flip_sem;
struct fb_var_screeninfo var;
u32 pseudo_palette[16];
@@ -775,6 +776,7 @@ static irqreturn_t lcd_irq_handler(int irq, void *dev_id)
__raw_writel(BM_ELCDIF_CTRL1_VSYNC_EDGE_IRQ_EN,
elcdif_base + HW_ELCDIF_CTRL1_CLR);
data->wait4vsync = 0;
+ data->vsync_nf_timestamp = ktime_get();
complete(&data->vsync_complete);
}
if ((status_lcd & BM_ELCDIF_CTRL1_CUR_FRAME_DONE_IRQ) &&
@@ -1125,7 +1127,19 @@ static int mxc_elcdif_fb_ioctl(struct fb_info *info, unsigned int cmd,
switch (cmd) {
case MXCFB_WAIT_FOR_VSYNC:
- ret = mxc_elcdif_fb_wait_for_vsync(info);
+ {
+ struct mxc_elcdif_fb_data *data =
+ (struct mxc_elcdif_fb_data *)info->par;
+ long long timestamp;
+ ret = mxc_elcdif_fb_wait_for_vsync(info);
+ timestamp = ktime_to_ns(data->vsync_nf_timestamp);
+ if ((ret == 0) && copy_to_user((void *)arg,
+ &timestamp, sizeof(timestamp))) {
+ ret = -EFAULT;
+ break;
+ }
+ }
+
break;
case MXCFB_GET_FB_BLANK:
{