From patchwork Mon Aug 20 12:35:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1348271 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 8E9AC3FC33 for ; Mon, 20 Aug 2012 12:42:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A5349E78B for ; Mon, 20 Aug 2012 05:42:48 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id F2AC59E74D for ; Mon, 20 Aug 2012 05:36:00 -0700 (PDT) Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M92003S50BWVCU0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 20 Aug 2012 21:35:58 +0900 (KST) X-AuditID: cbfee61a-b7fc66d0000043b7-97-50322f2e77cb Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A9.A4.17335.E2F22305; Mon, 20 Aug 2012 21:35:58 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.51.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9200B9O0BWMOD0@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 20 Aug 2012 21:35:58 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 07/10] drm/exynos: make sure that hardware overlay for fimd is disabled Date: Mon, 20 Aug 2012 21:35:52 +0900 Message-id: <1345466155-9154-8-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1345466155-9154-1-git-send-email-inki.dae@samsung.com> References: <1345466155-9154-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsVy+t9jQV09faMAgwXt6hZXvr5nc2D0uN99 nCmAMYrLJiU1J7MstUjfLoErY/uyCWwF37gqWp69YGxgnMrZxcjJISFgInH7zkVmCFtM4sK9 9WxdjFwcQgLTGSXWTbjADOGsZ5K4dqidFaSKTUBVYuKK+2wgtoiAqUTHpKUsIDazQKHEwp6n YLawQKTEpEXbwWwWoPp7K3+B2bwCzhIrZk5nhdimILHg3luwOZwCLhKr77wDiwsB1fy8sI99 AiPvAkaGVYyiqQXJBcVJ6bmGesWJucWleel6yfm5mxjBXn8mtYNxZYPFIUYBDkYlHt6T0w0D hFgTy4orcw8xSnAwK4nw/hExChDiTUmsrEotyo8vKs1JLT7EKM3BoiTOy98HVC2QnliSmp2a WpBaBJNl4uCUamBkKtMIZV27Yve+reLN394obeNYaDlL3OUhX+Pqru2b2SqNP53cKRo5y3Hq JKOzbjfK54T35kpeXjNZeXpZq3PULU2/3bvlTuSVXK9MmRn0e98fIdFZl/+VNRe/0FI9lHPN 99XvTxtOPUpX0Ku9rXtKcnYE+zPlClGf2Q6u/mZKRfPYlln5qvgpsRRnJBpqMRcVJwIAMBKK c/YBAAA= X-TM-AS-MML: No Cc: kyungmin.park@samsung.com 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 the values set to registers will be updated into real registers at vsync so dma operation could be malfunctioned when accessed to memory after gem buffer was released. this patch makes sure that hw overlay is disabled before the gem buffer is released. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 0ec9d86..2378d80 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -570,10 +570,22 @@ static void fimd_win_disable(struct device *dev, int zpos) win_data->enabled = false; } +static void fimd_wait_for_vblank(struct device *dev) +{ + struct fimd_context *ctx = get_fimd_context(dev); + int ret; + + ret = wait_for((__raw_readl(ctx->regs + VIDCON1) & + VIDCON1_VSTATUS_BACKPORCH), 50); + if (ret < 0) + DRM_DEBUG_KMS("vblank wait timed out.\n"); +} + static struct exynos_drm_overlay_ops fimd_overlay_ops = { .mode_set = fimd_win_mode_set, .commit = fimd_win_commit, .disable = fimd_win_disable, + .wait_for_vblank = fimd_wait_for_vblank, }; static struct exynos_drm_manager fimd_manager = {