From patchwork Wed Dec 26 11:27:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush K X-Patchwork-Id: 1910931 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 515F0DFAC4 for ; Wed, 26 Dec 2012 11:08:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D2A3E6177 for ; Wed, 26 Dec 2012 03:08:42 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id DF8C6E60C9 for ; Wed, 26 Dec 2012 03:05:25 -0800 (PST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MFM00622XGYC0X0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 26 Dec 2012 20:05:25 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id CD.76.12699.5F9DAD05; Wed, 26 Dec 2012 20:05:25 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-18-50dad9f55c79 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 9D.76.12699.4F9DAD05; Wed, 26 Dec 2012 20:05:24 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MFM0029MXGTEU90@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 26 Dec 2012 20:05:24 +0900 (KST) From: Prathyush K To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/8] drm/exynos: enable vblank in fimd wait for vblank Date: Wed, 26 Dec 2012 06:27:40 -0500 Message-id: <1356521265-22749-4-git-send-email-prathyush.k@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1356521265-22749-1-git-send-email-prathyush.k@samsung.com> References: <1356521265-22749-1-git-send-email-prathyush.k@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsWyRsSkRvfrzVsBBi8+sFpc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujHn7NrAVPOCquHxrAXMD4zeOLkZODgkBE4mH3+awQdhiEhfu rQeyuTiEBJYySuzYPJEFpujFj2ksEIlFjBJ3bzxlh3A2Mkms3NzJDlLFJqAt8WvOXVYQW0RA WeLvxFWMIDazgITEkfazYCuEBdwkFhzeBlbPIqAq8fz1d7B6XgF3iROz17BCbJOT+LDnEVgN p4CHxIWNe8DiQkA1bQ8+sEL0Ckh8m3wI6CIOoHpZiU0HmEHukRC4zCaxfPd6qKslJQ6uuMEy gVF4ASPDKkbR1ILkguKk9FwjveLE3OLSvHS95PzcTYzAMDz975n0DsZVDRaHGAU4GJV4eDl/ 3QwQYk0sK67MPcQowcGsJMKrsOpWgBBvSmJlVWpRfnxRaU5q8SFGH6BLJjJLiSbnA2MkryTe 0NjE3NTY1NLIyMzUFIewkjhvs0dKgJBAemJJanZqakFqEcw4Jg5OqQZGC6btjKc6s2X/xWsX xh614XJQ3i3aGCrUs9i3X2nux6OXjpU/Orvgah5LYU3s+rop7BtnCfntETV7XnxjpgLPA4Nr V8Ja1+bfP80z6fH6mi9JT7U8nvVZvTf52SMfU7TvmmyT7ItPgpIXf/aa3nx8xlZpw/sXC6Sf 60rmTCs64JZ7n1ksckKqEktxRqKhFnNRcSIATIToVHACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xgO6Xm7cCDPqbbCyufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGENY8a8fRvYCh5wVVy+tYC5 gfEbRxcjJ4eEgInEix/TWCBsMYkL99azdTFycQgJLGKUuHvjKTuEs5FJYuXmTnaQKjYBbYlf c+6ygtgiAsoSfyeuYgSxmQUkJI60n2UDsYUF3CQWHN4GVs8ioCrx/PV3sHpeAXeJE7PXsEJs k5P4sOcRWA2ngIfEhY17wOJCQDVtDz6wTmDkXcDIsIpRNLUguaA4KT3XSK84Mbe4NC9dLzk/ dxMjOMifSe9gXNVgcYhRgINRiYeX89fNACHWxLLiytxDjBIczEoivAqrbgUI8aYkVlalFuXH F5XmpBYfYvQBumois5Rocj4wAvNK4g2NTcxNjU0tTSxMzCxxCCuJ8zZ7pAQICaQnlqRmp6YW pBbBjGPi4JRqYNTvXdDCu1RdabebF+NxmdNXmQ4Z1jQVXZ4bs83f84ZVNZN8kXLvf/ZCXg6/ qYVr5kvk3U9eUzxX+u5iF82MY7x1J0XNHjYuPtbo0xG16YNM37sfFx3k0+0TTBbdmJXMH9TU uyVwwR9V0wWPrPg7mqZMOj55AWv1560l/g/DufYZiet7aF4yVWIpzkg01GIuKk4EAPvg1PWf AgAA X-CFilter-Loop: Reflected X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This patch checks if vblank is enabled inside wait for vblank. If not enabled, vblank is temporarily enabled before waiting and then disabled afterwards. This ensures that the wait never times out. Signed-off-by: Prathyush K --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 4d1d9c1..f88eaa4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -335,10 +335,19 @@ static void fimd_disable_vblank(struct device *dev) static void fimd_wait_for_vblank(struct device *dev) { struct fimd_context *ctx = get_fimd_context(dev); + u32 val; + bool vblank_enabled = true; if (ctx->suspended) return; + val = readl(ctx->regs + VIDINTCON0); + + if (!(val & VIDINTCON0_INT_FRAME)) { + vblank_enabled = false; + fimd_enable_vblank(dev); + } + atomic_set(&ctx->wait_vsync_event, 1); /* @@ -349,6 +358,9 @@ static void fimd_wait_for_vblank(struct device *dev) !atomic_read(&ctx->wait_vsync_event), DRM_HZ/20)) DRM_DEBUG_KMS("vblank wait timed out.\n"); + + if (!vblank_enabled) + fimd_disable_vblank(dev); } static struct exynos_drm_manager_ops fimd_manager_ops = {