From patchwork Fri Mar 8 04:28:52 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: 2235201 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 2A259DF215 for ; Fri, 8 Mar 2013 06:36:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 249A5E6C63 for ; Thu, 7 Mar 2013 22:36:36 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 6274EE6BF6 for ; Thu, 7 Mar 2013 20:08:32 -0800 (PST) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJB00LOGQ50KWJ0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 08 Mar 2013 13:08:31 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 5E.F4.23273.F3469315; Fri, 08 Mar 2013 13:08:31 +0900 (KST) X-AuditID: cbfee691-b7faa6d000005ae9-32-5139643f91e7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D4.CA.03880.F3469315; Fri, 08 Mar 2013 13:08:31 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJB003L4Q62XWA0@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 08 Mar 2013 13:08:31 +0900 (KST) From: Leela Krishna Amudala To: dri-devel@lists.freedesktop.org Subject: [PATCH V4] drm/exynos: fimd: calculate the correct address offset Date: Thu, 07 Mar 2013 23:28:52 -0500 Message-id: <1362716932-3884-1-git-send-email-l.krishna@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDLMWRmVeSWpSXmKPExsWyRsSkTtc+xTLQoOuziMWVr+/ZHBg97ncf ZwpgjOKySUnNySxLLdK3S+DK+PzoBmvBLaGKOS80Gxjn8HcxcnJICJhI/D57lxXCFpO4cG89 G4gtJLCUUWLb3kyYmjOd09i7GLmA4osYJS79n8gC4Wxkkmh90sQOUsUmYCxxf+5mJhBbREBZ 4u/EVYwgNrOAocTOL90sILawgJfE6m/LwGwWAVWJGz9XgW3jFXCRmP1lAyPENjmJD3segW2T ENjBJvH5+VZmiAYBiW+TDwE1cwAlZCU2HWCGqJeUOLjiBssERsEFjAyrGEVTC5ILipPSi0z1 ihNzi0vz0vWS83M3MQJD6vS/ZxN3MN4/YH2IMRlo3ERmKdHkfGBI5pXEGxqbmJsam5oZWVpa mpImrCTOK39JJlBIID2xJDU7NbUgtSi+qDQntfgQIxMHp1QDY8/pQ+0OTpq5qxc9WbLF6k22 kv8q29NTgrqLGDO5kk5sUXvRFBieMXvisnVGkpJZX0xLrCeWX42Y+q/j1DO9CVIlnxO1fLJ9 D/tzmLpt9Z3w/TePLt/E+h3RvPvv1F4/lhHef+CadO2ylq0l/3+oq989a2WevcYlT/tY75Ht TaV9nNFFJTN+KbEUZyQaajEXFScCAMR438U/AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xgK59imWgwfZOPosrX9+zOTB63O8+ zhTAGNXAaJORmpiSWqSQmpecn5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkD NFZJoSwxpxQoFJBYXKykb4dpQmiIm64FTGOErm9IEFyPkQEaSFjDmPH50Q3WgltCFXNeaDYw zuHvYuTkkBAwkTjTOY0dwhaTuHBvPVsXIxeHkMAiRolL/yeyQDgbmSRanzSBVbEJGEvcn7uZ CcQWEVCW+DtxFSOIzSxgKLHzSzcLiC0s4CWx+tsyMJtFQFXixs9VbCA2r4CLxOwvGxghtslJ fNjziH0CI/cCRoZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGMEh+0x6B+OqBotDjAIcjEo8 vBWbLAKFWBPLiitzDzFKcDArifD+lrEMFOJNSaysSi3Kjy8qzUktPsSYDLR9IrOUaHI+MJ7y SuINjU3MTY1NLU0sTMwsSRNWEudlPPUkQEggPbEkNTs1tSC1CGYLEwenVANj1GoB9sPKTooG DJYqn3qyVtVUGBsz3n4wt+VKxjTf9TmnuJiWKDw8VfHs536hxU/nXy/TStXKa/y6+WLQfkfT yDtpAaf99Nmjb2Z7mOnJX5z22NCsabFTW3lHqtiZ5xM/b5p9up3J6Jh/9ptLixd9qj7T8Lrf eF04y6N7rHqzF2vq3t6W/d1QiaU4I9FQi7moOBEAOuE/s50CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 07 Mar 2013 22:35:37 -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 based on exynos4 and exynos5 user manuals. Also remove VIDOSD_C_SIZE_W0 macro and fix comments about registers for size and alpha. Signed-off-by: Leela Krishna Amudala Acked-by: Joonyoung Shim --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..f5f2b25 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -38,11 +38,12 @@ /* 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 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 windows 0 and alpha control register + * for hardware windows 1 ~ 4 + */ +#define VIDOSD_C(win) (VIDOSD_BASE + 0x08 + (win) * 16) +/* size control register for hardware windows 1 ~ 2. */ #define VIDOSD_D(win) (VIDOSD_BASE + 0x0C + (win) * 16) #define VIDWx_BUF_START(win, buf) (VIDW_BUF_START(buf) + (win) * 8) @@ -50,9 +51,9 @@ #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 @@ -581,7 +582,7 @@ static void fimd_win_commit(struct device *dev, int zpos) if (win != 3 && win != 4) { u32 offset = VIDOSD_D(win); if (win == 0) - offset = VIDOSD_C_SIZE_W0; + offset = VIDOSD_C(win); val = win_data->ovl_width * win_data->ovl_height; writel(val, ctx->regs + offset);