From patchwork Wed May 7 11:25:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 4127411 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BF5859F334 for ; Wed, 7 May 2014 12:29:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECEC6201FA for ; Wed, 7 May 2014 12:29:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D7E8B2010F for ; Wed, 7 May 2014 12:29:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CC356E500; Wed, 7 May 2014 05:29:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 993046E4F0 for ; Wed, 7 May 2014 04:26:28 -0700 (PDT) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5700F82BS3V750@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 07 May 2014 20:26:27 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 51.57.11120.2681A635; Wed, 07 May 2014 20:26:27 +0900 (KST) X-AuditID: cbfee68f-b7eff6d000002b70-9d-536a18628022 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 0F.DE.27725.2681A635; Wed, 07 May 2014 20:26:26 +0900 (KST) Received: from localhost.localdomain ([107.108.83.245]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N57009SYBRJD8B0@mmp1.samsung.com>; Wed, 07 May 2014 20:26:26 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: use 4WORD dma burst length for small fbs Date: Wed, 07 May 2014 16:55:22 +0530 Message-id: <1399461922-27131-1-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsWyRsSkWjdZIivYYMcUFosrX9+zWUy6P4HF 4vuuL+wWM87vY7K4sGIju8XCF/EWUxYdZnVg99g56y67x/3u40wefVtWMXp83iQXwBLFZZOS mpNZllqkb5fAlbHh7memggP8FROWvGVqYHzC08XIySEhYCKx4+tzVghbTOLCvfVsXYxcHEIC SxklDv6+zQJTdPNEJzOILSSwiFHi4hxRiKJ2JolZy7+xgSTYBHQlZh98xghiiwgoS/yduArM ZhbYziix9LBqFyMHh7CAq8SzY1kgJouAqsT7m4YgFbwCHhL/pjSxg4QlBBQk5kyygdj6m02i bVkCiM0iICDxbfIhFogSWYlNB5ghSiQlDq64wTKBUXABI8MqRtHUguSC4qT0ImO94sTc4tK8 dL3k/NxNjMAQPf3vWf8OxrsHrA8xJgONm8gsJZqcDwzxvJJ4Q2MzIwtTE1NjI3NLM9KElcR5 7z9MChISSE8sSc1OTS1ILYovKs1JLT7EyMTBKdXAOHnG7Onv9Hd7rPA4cm7tj9DnKxddUIhv Pswvqmtt22SvNZErIye2YKb7amON56u8GHW5/zbemJQ3daJk4ie1LfXLa1ZFxuTycgU4bZOr efhTuftmFMs72USNlQE2FzwXLfvpdaPj/fkpGkZv/R82LHds/b0xpGqN4cFtfMY1U4PO3V5n O395mBJLcUaioRZzUXEiAFHRlHhnAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsVy+t9jAd0kiaxgg+lzzSyufH3PZjHp/gQW i++7vrBbzDi/j8niwoqN7BYLX8RbTFl0mNWB3WPnrLvsHve7jzN59G1ZxejxeZNcAEtUA6NN RmpiSmqRQmpecn5KZl66rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2Si0+ArltmDtAFSgpliTml QKGAxOJiJX07TBNCQ9x0LWAaI3R9Q4LgeowM0EDCGsaMDXc/MxUc4K+YsOQtUwPjE54uRk4O CQETiZsnOpkhbDGJC/fWs4HYQgKLGCUuzhHtYuQCstuZJGYt/waWYBPQlZh98BkjiC0ioCzx d+IqMJtZYDujxNLDql2MHBzCAq4Sz45lgZgsAqoS728aglTwCnhI/JvSxA4SlhBQkJgzyWYC I/cCRoZVjKKpBckFxUnpuYZ6xYm5xaV56XrJ+bmbGMEx8ExqB+PKBotDjAIcjEo8vBZvM4KF WBPLiitzDzFKcDArifB282cFC/GmJFZWpRblxxeV5qQWH2JMBto9kVlKNDkfGJ95JfGGxibm psamliYWJmaWpAkrifMeaLUOFBJITyxJzU5NLUgtgtnCxMEp1cBYyH7OYPfzgH17Nv975tda rqKSHOLV3C+z1LL5tm9vdzR7hKTJ8uVGybuBnltjL3j0xnHeI732XRZp0eu2fDBXmj03gf96 96pDX04K8s2zXsxq8iMoKaFMeuEzq7vz2GoSb0lrL3uxr289O+eyxsu3hMNTzjoK7Nu6e47q Itma+6JrOyZ5eCuxFGckGmoxFxUnAgAG9qZVxQIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 07 May 2014 05:29:55 -0700 Cc: linux-samsung-soc@vger.kernel.org, Prathyush K , joshi@samsung.com, Rahul Sharma X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rahul Sharma In case of exynos, setting dma-burst to 16Word causes permanent tearing for very small buffers, e.g. cursor buffer. Burst Mode switching, which is based on overlay size is not recommended as overlay size varies a lot towards the end of the screen. This causes unstable DMA which results into tearing again. Rendering small buffers with lower burst size doesn't cause any noticable performance overhead. 128 pixel width is selected based on mulitple experiments with exynos5 SoCs. Signed-off-by: Rahul Sharma Signed-off-by: Prathyush K --- Based on Inki Dae's exynos-drm-next branch. drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 40fd6cc..ef56077 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -38,6 +38,7 @@ */ #define FIMD_DEFAULT_FRAMERATE 60 +#define MIN_FB_WIDTH_FOR_16WORD_BURST 128 /* position control register for hardware window 0, 2 ~ 4.*/ #define VIDOSD_A(win) (VIDOSD_BASE + 0x00 + (win) * 16) @@ -446,6 +447,19 @@ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win) DRM_DEBUG_KMS("bpp = %d\n", win_data->bpp); + /* + * In case of exynos, setting dma-burst to 16Word causes permanent + * tearing for very small buffers, e.g. cursor buffer. Burst Mode + * switching which is based on overlay size is not recommended as + * overlay size varies alot towards the end of the screen and rapid + * movement causes unstable DMA which results into iommu crash/tear. + */ + + if (win_data->fb_width < MIN_FB_WIDTH_FOR_16WORD_BURST) { + val &= ~WINCONx_BURSTLEN_MASK; + val |= WINCONx_BURSTLEN_4WORD; + } + writel(val, ctx->regs + WINCON(win)); }