From patchwork Fri Aug 24 09:36:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1370521 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 E8B9C3FC71 for ; Fri, 24 Aug 2012 09:37:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD8889EDA2 for ; Fri, 24 Aug 2012 02:37:09 -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 ACC7F9E732 for ; Fri, 24 Aug 2012 02:36:58 -0700 (PDT) Received: from epcpsbgm2.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 <0M9900CDE6PG2IZ0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 24 Aug 2012 18:36:57 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-5c-50374b386045 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id FB.58.18282.83B47305; Fri, 24 Aug 2012 18:36:56 +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 <0M9900BHR6PKRQ60@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 24 Aug 2012 18:36:56 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: make sure that hardware overlay for fimd is disabled Date: Fri, 24 Aug 2012 18:36:56 +0900 Message-id: <1345801016-3945-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1345466155-9154-8-git-send-email-inki.dae@samsung.com> References: <1345466155-9154-8-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jQV0Lb/MAg78zrS2ufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXRvfCE+wFO7grjn15xtbAeIKzi5GTQ0LARGLLm5ksELaYxIV7 69m6GLk4hASmM0ocWTGPGcJZzySx6f1GRpAqNgFViYkr7rOB2CICphIdk5aCdTMLFEos7HkK ZHNwCAuESSz6rgESZgEq3/rjB1g5r4CzxMeZy9khlilILLj3FizOKeAi8bdnGSuILQRUc2Tr ZKYJjLwLGBlWMYqmFiQXFCel5xrpFSfmFpfmpesl5+duYgT7/Jn0DsZVDRaHGAU4GJV4eHe0 mAUIsSaWFVfmHmKU4GBWEuGd/xgoxJuSWFmVWpQfX1Sak1p8iFGag0VJnJe/zzBASCA9sSQ1 OzW1ILUIJsvEwSnVwGhQ7tBwfsXW/Oiz4k8r+F/ffZb1OSb0ZNURtasHVrP3Ln6ZO+/q2x3H rrAq2nBczO/TFeiZt/BTWbLdLYF+m8dnxCJC9/vd6d44zeyGLeNJsaj4mY02NvIB1ZPm53a5 5iTOnMKkYrnEVbF9W+a96TuXx6dvbuaWvTXlxa7fdmVH25jk1vl4LFNiKc5INNRiLipOBACv cPV29QEAAA== 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 Changelog v2: wait for VSYNC instead of BACKPORCH. Changelog v1: 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..478100e 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_VSYNC), 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 = {