From patchwork Wed Apr 8 15:39:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 6181051 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0B06D9F1C4 for ; Wed, 8 Apr 2015 15:39:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 283CA20306 for ; Wed, 8 Apr 2015 15:39:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 19DC5202C8 for ; Wed, 8 Apr 2015 15:39:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B70C56E6CB; Wed, 8 Apr 2015 08:39:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AFB46E6CB for ; Wed, 8 Apr 2015 08:39:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id E5A2660062B From: Daniel Stone To: inki.dae@samsung.com Subject: [PATCH 1/1] drm/exynos: Fix FIMD buffer size calculation Date: Wed, 8 Apr 2015 16:39:06 +0100 Message-Id: <1428507546-14449-1-git-send-email-daniels@collabora.com> X-Mailer: git-send-email 2.3.5 Cc: gustavo.padovan@collabora.co.uk, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Commit adacb228d72b ("drm: Exynos: Respect framebuffer pitch for FIMD/Mixer") fixed the buffer size calculation by using the FB pitch value but later commit 26b9c2813ede1 ("drm/exynos: remove struct *_win_data abstraction on planes") added a regression so fix the buffer size calculation again. Tested on Chromebook Snow / Peach Pit. Fixes: 26b9c2813ede1 ("drm/exynos: remove struct *_win_data abstraction on planes") Signed-off-by: Daniel Stone Tested-by: Javier Martinez Canillas Reviewed-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 7964b278eefb..90111b87c963 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -662,7 +662,7 @@ static void fimd_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) writel(val, ctx->regs + VIDWx_BUF_START(win, 0)); /* buffer end address */ - size = plane->pitch * plane->crtc_height * (plane->bpp >> 3); + size = plane->pitch * plane->crtc_height; val = (unsigned long)(dma_addr + size); writel(val, ctx->regs + VIDWx_BUF_END(win, 0)); @@ -672,7 +672,7 @@ static void fimd_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) plane->crtc_width, plane->crtc_height); /* buffer size */ - buf_offsize = (plane->fb_width - plane->crtc_width) * (plane->bpp >> 3); + buf_offsize = plane->pitch - (plane->crtc_width * (plane->bpp >> 3)); line_size = plane->crtc_width * (plane->bpp >> 3); val = VIDW_BUF_SIZE_OFFSET(buf_offsize) | VIDW_BUF_SIZE_PAGEWIDTH(line_size) |