aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2012-09-18 22:02:43 -0400
committerInki Dae <inki.dae@samsung.com>2012-10-03 21:06:01 -0400
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 c95f7dedb8a0..54b44159caf1 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 {
56 unsigned int connected; 56 unsigned int connected;
57 bool vblank_on; 57 bool vblank_on;
58 bool suspended; 58 bool suspended;
59 bool direct_vblank;
59 struct work_struct work; 60 struct work_struct work;
60 struct mutex lock; 61 struct mutex lock;
61}; 62};
@@ -224,6 +225,15 @@ static int vidi_enable_vblank(struct device *dev)
224 if (!test_and_set_bit(0, &ctx->irq_flags)) 225 if (!test_and_set_bit(0, &ctx->irq_flags))
225 ctx->vblank_on = true; 226 ctx->vblank_on = true;
226 227
228 ctx->direct_vblank = true;
229
230 /*
231 * in case of page flip request, vidi_finish_pageflip function
232 * will not be called because direct_vblank is true and then
233 * that function will be called by overlay_ops->commit callback
234 */
235 schedule_work(&ctx->work);
236
227 return 0; 237 return 0;
228} 238}
229 239
@@ -425,7 +435,17 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
425 /* refresh rate is about 50Hz. */ 435 /* refresh rate is about 50Hz. */
426 usleep_range(16000, 20000); 436 usleep_range(16000, 20000);
427 437
428 drm_handle_vblank(subdrv->drm_dev, manager->pipe); 438 mutex_lock(&ctx->lock);
439
440 if (ctx->direct_vblank) {
441 drm_handle_vblank(subdrv->drm_dev, manager->pipe);
442 ctx->direct_vblank = false;
443 mutex_unlock(&ctx->lock);
444 return;
445 }
446
447 mutex_unlock(&ctx->lock);
448
429 vidi_finish_pageflip(subdrv->drm_dev, manager->pipe); 449 vidi_finish_pageflip(subdrv->drm_dev, manager->pipe);
430} 450}
431 451
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
index c20b00181530..0d1c503042d5 100644
--- a/include/drm/exynos_drm.h
+++ b/include/drm/exynos_drm.h
@@ -107,6 +107,16 @@ struct drm_exynos_vidi_connection {
107 uint64_t edid; 107 uint64_t edid;
108}; 108};
109 109
110/* Indicate Exynos specific vblank flags */
111enum e_drm_exynos_vblank {
112 /*
113 * this flags is used for Virtual Display module
114 * to use DRM_IOCTL_WAIT_VBLANK feature. for this,
115 * user should set this flag to vblwait->request.type
116 */
117 _DRM_VBLANK_EXYNOS_VIDI = 2,
118};
119
110/* memory type definitions. */ 120/* memory type definitions. */
111enum e_drm_exynos_gem_mem_type { 121enum e_drm_exynos_gem_mem_type {
112 /* Physically Continuous memory and used as default. */ 122 /* Physically Continuous memory and used as default. */