From patchwork Wed Mar 6 05:20:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leela Krishna Amudala X-Patchwork-Id: 2223541 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 3E580DF23A for ; Wed, 6 Mar 2013 07:23:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3CEE0E5FFD for ; Tue, 5 Mar 2013 23:23:01 -0800 (PST) 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 4B86FE62F3 for ; Tue, 5 Mar 2013 21:01:22 -0800 (PST) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJ8005PR39DLG60@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 06 Mar 2013 14:01:18 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id EF.22.02494.E9DC6315; Wed, 06 Mar 2013 14:01:18 +0900 (KST) X-AuditID: cbfee68d-b7f636d0000009be-2b-5136cd9e46de Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 8D.69.03918.E9DC6315; Wed, 06 Mar 2013 14:01:18 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([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 <0MJ8000VX37WU3L0@mmp2.samsung.com>; Wed, 06 Mar 2013 14:01:18 +0900 (KST) From: Leela Krishna Amudala To: dri-devel@lists.freedesktop.org Subject: [PATCH V2] drm/exynos: fimd: calculate the correct address offset Date: Wed, 06 Mar 2013 00:20:28 -0500 Message-id: <1362547228-678-1-git-send-email-l.krishna@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDLMWRmVeSWpSXmKPExsWyRsSkVnfeWbNAg3dfdCyufH3PZjHp/gQW ixf3LrI4MHvc7z7O5NG3ZRVjAFMUl01Kak5mWWqRvl0CV8bDPW/YC/4LV6zbcJu1gXGFQBcj J4eEgInE4j1z2CFsMYkL99azdTFycQgJLGWUaHh7mA2m6OLSVlaIxHRGibuzn7BDOL1MEtdX 9TCDVLEJGEvcn7uZCcQWEVCW+DtxFSOIzSxgKLHzSzcLiC0s4CVx5+1WsKksAqoSD5qvA/Vy cPAKOEucWJMNsUxO4sOeR2DzJQQus0n8bG9jhqgXkPg2+RALSL2EgKzEpgPMEPWSEgdX3GCZ wCi4gJFhFaNoakFyQXFSepGhXnFibnFpXrpecn7uJkZgyJ3+96x3B+PtA9aHGJOBxk1klhJN zgeGbF5JvKGxibmpsamZkaWlpSlpwkrivHKXZAKFBNITS1KzU1MLUovii0pzUosPMTJxcEo1 MN7xsJjPm+r2ol9DdnXezQhGdeFwxxrb7Ubvm5kapYq9Xt64PIvhyNzfkjN0Ppz4ccE6dNGB NhvbmqojcT57c88e37GtdHMcy1X2F18NJzz5ddvPfzKXrD/bxq+tP45Hsty6L9d96zbPT7mo p+JfbkZneSg8+ZYlI7Dp8e2LYb6S/5a8kf915LMSS3FGoqEWc1FxIgBnhlFUTwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRmVeSWpSXmKPExsVy+t9jQd15Z80CDf7NUrG48vU9m8Wk+xNY LF7cu8jiwOxxv/s4k0ffllWMAUxRDYw2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW 5koKeYm5qbZKLj4Bum6ZOUBblBTKEnNKgUIBicXFSvp2mCaEhrjpWsA0Ruj6hgTB9RgZoIGE NYwZD/e8YS/4L1yxbsNt1gbGFQJdjJwcEgImEheXtrJC2GISF+6tZ+ti5OIQEpjOKHF39hN2 CKeXSeL6qh5mkCo2AWOJ+3M3M4HYIgLKEn8nrmIEsZkFDCV2fulmAbGFBbwk7rzdygZiswio Sjxovg7Uy8HBK+AscWJNNsQyOYkPex6xT2DkXsDIsIpRNLUguaA4KT3XUK84Mbe4NC9dLzk/ dxMjOKCfSe1gXNlgcYhRgINRiYfXQsksUIg1say4MvcQowQHs5IIL9cZoBBvSmJlVWpRfnxR aU5q8SHGZKDlE5mlRJPzgdGWVxJvaGxibmpsamliYWJmSZqwkjgv46knAUIC6YklqdmpqQWp RTBbmDg4pRoYI3ye39Q2VfMWL5nB8MRwVUZZW+38pf1KZp4lKhG7d9rJp7/jPPRme7DtytMr VVZNXZpxTid+2QSZn6slKzvenczRL8nfLJ94K6BO1EplZ/67a3yrP9+9197/I/eCuri14aLX G1eX2C26OtP34nqprRdWu+bOdhcrKWixMdGqkJCMz3jIEzRdiaU4I9FQi7moOBEAD6CTVKwC AAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Tue, 05 Mar 2013 22:41:18 -0800 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 Calculate the correct address offset values for alpha and color key control registers and clear size control register for window 0 Signed-off-by: Leela Krishna Amudala --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..78bab4a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -38,21 +38,22 @@ /* position control register for hardware window 0, 2 ~ 4.*/ #define VIDOSD_A(win) (VIDOSD_BASE + 0x00 + (win) * 16) #define VIDOSD_B(win) (VIDOSD_BASE + 0x04 + (win) * 16) +/* size control register is avaliable only for windows 0, 1 and 2. */ /* size control register for hardware window 0. */ #define VIDOSD_C_SIZE_W0 (VIDOSD_BASE + 0x08) -/* alpha control register for hardware window 1 ~ 4. */ -#define VIDOSD_C(win) (VIDOSD_BASE + 0x18 + (win) * 16) -/* size control register for hardware window 1 ~ 4. */ +/* size control register for hardware window 1 ~ 2. */ #define VIDOSD_D(win) (VIDOSD_BASE + 0x0C + (win) * 16) +/* alpha control register for hardware window 1 ~ 4. */ +#define VIDOSD_C(win) (VIDOSD_BASE + 0x08 + (win) * 16) #define VIDWx_BUF_START(win, buf) (VIDW_BUF_START(buf) + (win) * 8) #define VIDWx_BUF_END(win, buf) (VIDW_BUF_END(buf) + (win) * 8) #define VIDWx_BUF_SIZE(win, buf) (VIDW_BUF_SIZE(buf) + (win) * 4) /* color key control register for hardware window 1 ~ 4. */ -#define WKEYCON0_BASE(x) ((WKEYCON0 + 0x140) + (x * 8)) +#define WKEYCON0_BASE(x) ((WKEYCON0 + 0x140) + ((x - 1) * 8)) /* color key value register for hardware window 1 ~ 4. */ -#define WKEYCON1_BASE(x) ((WKEYCON1 + 0x140) + (x * 8)) +#define WKEYCON1_BASE(x) ((WKEYCON1 + 0x140) + ((x - 1) * 8)) /* FIMD has totally five hardware windows. */ #define WINDOWS_NR 5 @@ -782,11 +783,14 @@ static void fimd_clear_win(struct fimd_context *ctx, int win) writel(0, ctx->regs + WINCON(win)); writel(0, ctx->regs + VIDOSD_A(win)); writel(0, ctx->regs + VIDOSD_B(win)); - writel(0, ctx->regs + VIDOSD_C(win)); + if (win != 0) + writel(0, ctx->regs + VIDOSD_C(win)); if (win == 1 || win == 2) writel(0, ctx->regs + VIDOSD_D(win)); + if (win == 0) + writel(0, ctx->regs + VIDOSD_C_SIZE_W0); val = readl(ctx->regs + SHADOWCON); val &= ~SHADOWCON_WINx_PROTECT(win); writel(val, ctx->regs + SHADOWCON);