summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2012-09-19 11:02:43 +0900
committerInki Dae <inki.dae@samsung.com>2012-10-04 10:06:01 +0900
commit291257cf4cb0da1e32b672b88e73d22d845c8f93 (patch)
tree8da8e2b51c144842dc35d0ebe76f05a8d2769cec
parent32aeab17457c13e6a448ba0f6f3c03d6705e5592 (diff)
drm/exynos: support drm_wait_vblank feature for VIDI
this patch adds drm_wait_vblank support to Virtual Display module so user can use DRM_IOCT_WAIT_VBLANK ioctl with this patch. for this, you should set _DRM_VBLANK_EXYNOS_VIDI flags to vblwait->request.type Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c22
-rw-r--r--include/drm/exynos_drm.h10
2 files changed, 31 insertions, 1 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index c95f7dedb8a..54b44159caf 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -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);
}
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
index c20b0018153..0d1c503042d 100644
--- a/include/drm/exynos_drm.h
+++ b/include/drm/exynos_drm.h
@@ -107,6 +107,16 @@ struct drm_exynos_vidi_connection {
uint64_t edid;
};
+/* Indicate Exynos specific vblank flags */
+enum e_drm_exynos_vblank {
+ /*
+ * this flags is used for Virtual Display module
+ * to use DRM_IOCTL_WAIT_VBLANK feature. for this,
+ * user should set this flag to vblwait->request.type
+ */
+ _DRM_VBLANK_EXYNOS_VIDI = 2,
+};
+
/* memory type definitions. */
enum e_drm_exynos_gem_mem_type {
/* Physically Continuous memory and used as default. */