From patchwork Tue Nov 20 14:21:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush K X-Patchwork-Id: 1773701 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 5AD673FCAE for ; Tue, 20 Nov 2012 14:00:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC47BE6296 for ; Tue, 20 Nov 2012 06:00:07 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F7F5E62C8 for ; Tue, 20 Nov 2012 05:59:19 -0800 (PST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDS00JP4HIAT301@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 20 Nov 2012 22:59:17 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AE.A0.01231.5BC8BA05; Tue, 20 Nov 2012 22:59:17 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-29-50ab8cb563b2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 8E.A0.01231.5BC8BA05; Tue, 20 Nov 2012 22:59:17 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MDS003RIHH85A90@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 20 Nov 2012 22:59:17 +0900 (KST) From: Prathyush K To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: modify burst size based on overlay size Date: Tue, 20 Nov 2012 19:51:48 +0530 Message-id: <1353421308-5395-1-git-send-email-prathyush.k@samsung.com> X-Mailer: git-send-email 1.7.0.4 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKLMWRmVeSWpSXmKPExsWyRsSkSndrz+oAg+WTNCyufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxpF/p9kKzopXTFzWztTAeFWoi5GTQ0LAROL23hXsELaYxIV7 69m6GLk4hASWMkp86fvLClN07N0vdojEdEaJXV07WSCc1UwS51Y3MIJUsQloS/yacxesQ0RA WeLvxFVgcWYBCYkj7WfZQGxhAReJk6cOgtksAqoSf0+tYgKxeQXcgGouMEFsU5BoXXaIHaJG QOLb5ENAyziA4rISmw4wg+yVENjBJvHs0kOosyUlDq64wTKBUXABI8MqRtHUguSC4qT0XEO9 4sTc4tK8dL3k/NxNjMCwOv3vmdQOxpUNFocYBTgYlXh4HyasChBiTSwrrsw9xCjBwawkwhtf uDpAiDclsbIqtSg/vqg0J7X4EKMP0CUTmaVEk/OBIZ9XEm9obGJuamxqaWRkZmqKQ1hJnLfZ IyVASCA9sSQ1OzW1ILUIZhwTB6dUA2NyUecjjXvtB3gMDBKEFhTwf1Bw+HRq3dEOybDFH9Tq N3sYxx+ZvipiduLnR0czdyy3cPZXf3x17+bOnmtcky63zD59puqWTZltcFTINAelB3On13zd vfeD3ufTzzZfZyousV8sY/jxeaLvYXeuBY69f///Pvlrfku4yrItKj9eq6n27a1IlddTYinO SDTUYi4qTgQAokEiHFgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsVy+t9jQd2tPasDDCa8kbe48vU9mwOjx/3u 40wBjFENjDYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5 QGOVFMoSc0qBQgGJxcVK+naYJoSGuOlawDRG6PqGBMH1GBmggYQ1jBlH/p1mKzgrXjFxWTtT A+NVoS5GTg4JAROJY+9+sUPYYhIX7q1n62Lk4hASmM4osatrJwuEs5pJ4tzqBkaQKjYBbYlf c+6ygtgiAsoSfyeuAoszC0hIHGk/ywZiCwu4SJw8dRDMZhFQlfh7ahUTiM0r4AZUc4EJYpuC ROuyQ+wTGLkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAgO2mdSOxhXNlgcYhTgYFTi 4X2YsCpAiDWxrLgy9xCjBAezkghvfOHqACHelMTKqtSi/Pii0pzU4kOMPkDbJzJLiSbnAyMq ryTe0NjE3NTY1NLEwsTMEoewkjhvs0dKgJBAemJJanZqakFqEcw4Jg5OqQbGToPy5wuCVkku Kin6F7jx9QuDxJsPUps+5B7RneCkz88RXPvno73Uj8Lv7vLb9acUn72eG3F43uQNrZzpwX29 hkLtnrHTjr9fMKF9C8+3t8d3C0csy+u/d+moRp6Usfxny9C9QtbyzbP+82Z96g483q4yuXfW 3B/Hd7NWP5RI0HBUt9Wqe8unxFKckWioxVxUnAgAOZ1Yb4cCAAA= X-CFilter-Loop: Reflected 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 BURST size of fimd is adjusted based on the number of bytes to be read. This is calculated based on the overlay width and the number of bits per pixel. There are three burst lengths supported - 4 words, 8 words and 16 words where each word is 8 bytes long. Signed-off-by: Prathyush K --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 34 ++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 19f12d1..655b2dd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -384,6 +384,7 @@ static void fimd_win_set_pixfmt(struct device *dev, unsigned int win) struct fimd_context *ctx = get_fimd_context(dev); struct fimd_win_data *win_data = &ctx->win_data[win]; unsigned long val; + unsigned long bytes; DRM_DEBUG_KMS("%s\n", __FILE__); @@ -393,48 +394,63 @@ static void fimd_win_set_pixfmt(struct device *dev, unsigned int win) case 1: val |= WINCON0_BPPMODE_1BPP; val |= WINCONx_BITSWP; - val |= WINCONx_BURSTLEN_4WORD; + bytes = win_data->fb_width >> 3; break; case 2: val |= WINCON0_BPPMODE_2BPP; val |= WINCONx_BITSWP; - val |= WINCONx_BURSTLEN_8WORD; + bytes = win_data->fb_width >> 2; break; case 4: val |= WINCON0_BPPMODE_4BPP; val |= WINCONx_BITSWP; - val |= WINCONx_BURSTLEN_8WORD; + bytes = win_data->fb_width >> 1; break; case 8: val |= WINCON0_BPPMODE_8BPP_PALETTE; - val |= WINCONx_BURSTLEN_8WORD; val |= WINCONx_BYTSWP; + bytes = win_data->fb_width; break; case 16: val |= WINCON0_BPPMODE_16BPP_565; val |= WINCONx_HAWSWP; - val |= WINCONx_BURSTLEN_16WORD; + bytes = win_data->fb_width << 1; break; case 24: val |= WINCON0_BPPMODE_24BPP_888; val |= WINCONx_WSWP; - val |= WINCONx_BURSTLEN_16WORD; + bytes = win_data->fb_width * 3; break; case 32: val |= WINCON1_BPPMODE_28BPP_A4888 | WINCON1_BLD_PIX | WINCON1_ALPHA_SEL; val |= WINCONx_WSWP; - val |= WINCONx_BURSTLEN_16WORD; + bytes = win_data->fb_width << 2; break; default: DRM_DEBUG_KMS("invalid pixel size so using unpacked 24bpp.\n"); - + bytes = win_data->fb_width * 3; val |= WINCON0_BPPMODE_24BPP_888; val |= WINCONx_WSWP; - val |= WINCONx_BURSTLEN_16WORD; break; } + /* + * Adjust the burst size based on the number of bytes to be read. + * Each WORD of the BURST is 8 bytes long. There are 3 BURST sizes + * supported by fimd. + * WINCONx_BURSTLEN_4WORD = 32 bytes + * WINCONx_BURSTLEN_8WORD = 64 bytes + * WINCONx_BURSTLEN_16WORD = 128 bytes + */ + if (bytes < 128) + if (bytes < 64) + val |= WINCONx_BURSTLEN_4WORD; + else + val |= WINCONx_BURSTLEN_8WORD; + else + val |= WINCONx_BURSTLEN_16WORD; + DRM_DEBUG_KMS("bpp = %d\n", win_data->bpp); writel(val, ctx->regs + WINCON(win));