|
@@ -56,6 +56,7 @@ struct vidi_context {
|
|
|
unsigned int connected;
|
|
|
bool vblank_on;
|
|
|
bool suspended;
|
|
|
+ bool direct_vblank;
|
|
|
struct work_struct work;
|
|
|
struct mutex lock;
|
|
|
};
|
|
@@ -224,6 +225,15 @@ static int vidi_enable_vblank(struct device *dev)
|
|
|
if (!test_and_set_bit(0, &ctx->irq_flags))
|
|
|
ctx->vblank_on = true;
|
|
|
|
|
|
+ ctx->direct_vblank = true;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * in case of page flip request, vidi_finish_pageflip function
|
|
|
+ * will not be called because direct_vblank is true and then
|
|
|
+ * that function will be called by overlay_ops->commit callback
|
|
|
+ */
|
|
|
+ schedule_work(&ctx->work);
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -425,7 +435,17 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
|
|
|
/* refresh rate is about 50Hz. */
|
|
|
usleep_range(16000, 20000);
|
|
|
|
|
|
- drm_handle_vblank(subdrv->drm_dev, manager->pipe);
|
|
|
+ mutex_lock(&ctx->lock);
|
|
|
+
|
|
|
+ if (ctx->direct_vblank) {
|
|
|
+ drm_handle_vblank(subdrv->drm_dev, manager->pipe);
|
|
|
+ ctx->direct_vblank = false;
|
|
|
+ mutex_unlock(&ctx->lock);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ mutex_unlock(&ctx->lock);
|
|
|
+
|
|
|
vidi_finish_pageflip(subdrv->drm_dev, manager->pipe);
|
|
|
}
|
|
|
|