From patchwork Thu Mar 14 09:48:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2268721 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 E009B3FCF6 for ; Thu, 14 Mar 2013 09:49:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D11CCE6710 for ; Thu, 14 Mar 2013 02:49:00 -0700 (PDT) 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 8BFE2E5D2F for ; Thu, 14 Mar 2013 02:48:47 -0700 (PDT) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJN00IP79X7CNS0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 14 Mar 2013 18:48:46 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.41]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id E8.2D.05174.EFC91415; Thu, 14 Mar 2013 18:48:46 +0900 (KST) X-AuditID: cbfee68f-b7f4a6d000001436-89-51419cfeb1c7 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9B.13.17838.EFC91415; Thu, 14 Mar 2013 18:48:46 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.8.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 <0MJN000E89X9KO40@mmp2.samsung.com>; Thu, 14 Mar 2013 18:48:46 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/7] drm/exynos: Fix G2D core malfunctioning issue Date: Thu, 14 Mar 2013 18:48:45 +0900 Message-id: <1363254525-11735-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1363165441-7448-1-git-send-email-inki.dae@samsung.com> References: <1363165441-7448-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRmVeSWpSXmKPExsVy+t8zTd1/cxwDDa6/EbToPXeSyeLK1/ds FpPuT2CxeHHvIovF2aY37BYzJr9ks9i7czKjA7vH9m8PWD3udx9n8ujbsooxgDmKyyYlNSez LLVI3y6BK+PC5XvsBVNEK/bP2sXewHhKsIuRk0NCwETiy6qn7BC2mMSFe+vZuhi5OIQEljFK /F0+ixWu6NhsRojEdEaJtrkvWCCcLiaJV5tuMoJUsQmoSkxccZ8NxBYRMJXomLQUrIhZoJtR 4vmDv2CjhAVcJQ6c/ga0j4ODBahh24dckDCvgIvE++lbmSC2KUgsuPcWbA4nUHzv1YXMILaQ gLPEikmv2UFmSghMZpfYfGgP2GIWAQGJb5MPsYDMlBCQldh0gBlijqTEwRU3WCYwCi9gZFjF KJpakFxQnJReZKxXnJhbXJqXrpecn7uJERLW/TsY7x6wPsSYDDRuIrOUaHI+MC7ySuINjc2M LExNTI2NzC3NSBNWEudVa7EOFBJITyxJzU5NLUgtii8qzUktPsTIxMEp1cBY8XhZ9+mUR80n F2u5/rsfrziLiXGqZXv28xmuLB8NWAyCqhcVJx3Y9P/aX4Wy7qBpE/8GccoemVyavTN/4VQO IcWAV9PyE2RP105M/C2X+OyVohOrUcmHrpq9xfw7DZsCUlVsXmZHzeLn/pu7xq0vODRM0eh7 34QZfw4v4CkJTtvD29r1VlmJpTgj0VCLuag4EQCM8QvkgQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNIsWRmVeSWpSXmKPExsVy+t9jQd1/cxwDDZ51cFv0njvJZHHl63s2 i0n3J7BYvLh3kcXibNMbdosZk1+yWezdOZnRgd1j+7cHrB73u48zefRtWcUYwBzVwGiTkZqY klqkkJqXnJ+SmZduq+QdHO8cb2pmYKhraGlhrqSQl5ibaqvk4hOg65aZA7ReSaEsMacUKBSQ WFyspG+HaUJoiJuuBUxjhK5vSBBcj5EBGkhYx5hx4fI99oIpohX7Z+1ib2A8JdjFyMkhIWAi 8eXYbEYIW0ziwr31bF2MXBxCAtMZJdrmvmCBcLqYJF5tuglWxSagKjFxxX02EFtEwFSiY9JS sCJmgW5GiecP/rKCJIQFXCUOnP7G3sXIwcEC1LDtQy5ImFfAReL99K1MENsUJBbcews2hxMo vvfqQmYQW0jAWWLFpNfsExh5FzAyrGIUTS1ILihOSs811CtOzC0uzUvXS87P3cQIjppnUjsY VzZYHGIU4GBU4uE90O8QKMSaWFZcmXuIUYKDWUmE19PLMVCINyWxsiq1KD++qDQntfgQYzLQ UROZpUST84ERnVcSb2hsYmZkaWRmbGJubEyasJI474FW60AhgfTEktTs1NSC1CKYLUwcnFIN jMJfdO59ZzaZoWj2ZhLfKZ20sF9xF3Z4zp+5UjSgOWOSeqPOHYeUEveIG3wXnr15oKfReK/3 CP9+yVlCCb9tPN8+3dpS/C3utuVp30WWTHHHUy2PvDygycYSPmf6s+DybcG7T+tdTkpdefDo /386LfMU7x7Y9aDMXTuhuqFcbabGlE2xvttPrVViKc5INNRiLipOBAAF8qsT3gIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com, YoungJun Cho 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 From: YoungJun Cho This patch fixes G2D core malfunctioning issue once g2d dma is started. Without 'DMA_HOLD_CMD_REG' register setting, there is only one interrupt after the execution to all command lists have been completed. And that induces watchdog. So this patch sets 'LIST_HOLD' command to the register so that command execution interrupt can be occured whenever each command list execution is finished. Changelog v2: - Consider for interrupt setup to each command list and all command lists And correct typo. Signed-off-by: YoungJun Cho Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 095520f..1ff1144 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -82,7 +82,7 @@ #define G2D_DMA_LIST_DONE_COUNT_OFFSET 17 /* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2) #define G2D_LIST_HOLD (1 << 1) #define G2D_BITBLT_HOLD (1 << 0) @@ -592,10 +592,6 @@ static void g2d_dma_start(struct g2d_data *g2d, pm_runtime_get_sync(g2d->dev); clk_enable(g2d->gate_clk); - /* interrupt enable */ - writel_relaxed(G2D_INTEN_ACF | G2D_INTEN_UCF | G2D_INTEN_GCF, - g2d->regs + G2D_INTEN); - writel_relaxed(node->dma_addr, g2d->regs + G2D_DMA_SFR_BASE_ADDR); writel_relaxed(G2D_DMA_START, g2d->regs + G2D_DMA_COMMAND); } @@ -863,9 +859,23 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, cmdlist->data[cmdlist->last++] = G2D_SRC_BASE_ADDR; cmdlist->data[cmdlist->last++] = 0; + /* + * 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG + * and GCF bit should be set to INTEN register if user wants + * G2D interrupt event once current command list execution is + * finished. + * Otherwise only ACF bit should be set to INTEN register so + * that one interrupt is occured after all command lists + * have been completed. + */ if (node->event) { + cmdlist->data[cmdlist->last++] = G2D_INTEN; + cmdlist->data[cmdlist->last++] = G2D_INTEN_ACF | G2D_INTEN_GCF; cmdlist->data[cmdlist->last++] = G2D_DMA_HOLD_CMD; cmdlist->data[cmdlist->last++] = G2D_LIST_HOLD; + } else { + cmdlist->data[cmdlist->last++] = G2D_INTEN; + cmdlist->data[cmdlist->last++] = G2D_INTEN_ACF; } /* Check size of cmdlist: last 2 is about G2D_BITBLT_START */