Change-Id: I76ff8489f3e71f21de3461c0834424b5d1bf1962
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
case RK_FBIOSET_VSYNC_ENABLE:
if (copy_from_user(&enable, argp, sizeof(enable)))
return -EFAULT;
case RK_FBIOSET_VSYNC_ENABLE:
if (copy_from_user(&enable, argp, sizeof(enable)))
return -EFAULT;
- dev_drv->vsync_info.active = enable;
+ if (enable)
+ dev_drv->vsync_info.active++;
+ else
+ dev_drv->vsync_info.active--;
case RK_FBIOGET_DSP_ADDR:
dev_drv->ops->get_dsp_addr(dev_drv, dsp_addr);
if (copy_to_user(argp, &dsp_addr, sizeof(dsp_addr)))
case RK_FBIOGET_DSP_ADDR:
dev_drv->ops->get_dsp_addr(dev_drv, dsp_addr);
if (copy_to_user(argp, &dsp_addr, sizeof(dsp_addr)))
ktime_t timestamp = dev_drv->vsync_info.timestamp;
int ret = wait_event_interruptible(dev_drv->vsync_info.wait,
!ktime_equal(timestamp, dev_drv->vsync_info.timestamp) &&
ktime_t timestamp = dev_drv->vsync_info.timestamp;
int ret = wait_event_interruptible(dev_drv->vsync_info.wait,
!ktime_equal(timestamp, dev_drv->vsync_info.timestamp) &&
- (dev_drv->vsync_info.active || dev_drv->vsync_info.irq_stop));
+ (dev_drv->vsync_info.active > 0 || dev_drv->vsync_info.irq_stop));
if (!ret)
sysfs_notify(&fbi->dev->kobj, NULL, "vsync");
if (!ret)
sysfs_notify(&fbi->dev->kobj, NULL, "vsync");
struct rk_fb_vsync {
wait_queue_head_t wait;
ktime_t timestamp;
struct rk_fb_vsync {
wait_queue_head_t wait;
ktime_t timestamp;
bool irq_stop;
int irq_refcount;
struct mutex irq_lock;
bool irq_stop;
int irq_refcount;
struct mutex irq_lock;