diff options
Diffstat (limited to 'drivers/video/samsung/s3cfb_main.c')
-rw-r--r-- | drivers/video/samsung/s3cfb_main.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/video/samsung/s3cfb_main.c b/drivers/video/samsung/s3cfb_main.c index a723306..fadea40 100644 --- a/drivers/video/samsung/s3cfb_main.c +++ b/drivers/video/samsung/s3cfb_main.c @@ -387,6 +387,18 @@ static ssize_t fimd_dump_show(struct device *dev, } static DEVICE_ATTR(fimd_dump, 0444, fimd_dump_show, NULL); +#ifdef CONFIG_FB_S5P_VSYNC_SYSFS +static ssize_t s3c_fb_vsync_time(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct s3cfb_global *fbdev = fbfimd->fbdev[0]; + + return snprintf(buf, PAGE_SIZE, "%llu", ktime_to_ns(fbdev->vsync_info.timestamp)); +} + +static DEVICE_ATTR(vsync_time, S_IRUGO, s3c_fb_vsync_time, NULL); +#endif + #if 0 /* def CONFIG_FB_S5P_MIPI_DSIM */ void s3cfb_display_on_remote(void) { @@ -430,6 +442,7 @@ static int s3cfb_wait_for_vsync_thread(void *data) msecs_to_jiffies(VSYNC_TIMEOUT_MSEC)); if (ret > 0) { +#if defined(CONFIG_FB_S5P_VSYNC_SEND_UEVENTS) char *envp[2]; char buf[64]; snprintf(buf, sizeof(buf), "VSYNC=%llu", @@ -438,6 +451,10 @@ static int s3cfb_wait_for_vsync_thread(void *data) envp[1] = NULL; kobject_uevent_env(&fbdev->dev->kobj, KOBJ_CHANGE, envp); +#endif +#if defined(CONFIG_FB_S5P_VSYNC_SYSFS) + sysfs_notify(&fbdev->dev->kobj, NULL, "vsync_time"); +#endif } } @@ -667,6 +684,12 @@ static int s3cfb_probe(struct platform_device *pdev) if (ret < 0) dev_err(fbdev[0]->dev, "failed to add sysfs entries\n"); +#ifdef CONFIG_FB_S5P_VSYNC_SYSFS + ret = device_create_file(fbdev[i]->dev, &dev_attr_vsync_time); + if (ret < 0) + dev_err(fbdev[0]->dev, "failed to add sysfs entries\n"); +#endif + ret = device_create_file(fbdev[i]->dev, &dev_attr_ielcd_dump); if (ret < 0) dev_err(fbdev[0]->dev, "failed to add sysfs entries\n"); |