From patchwork Thu May 19 14:17:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Scheurer, Amber" X-Patchwork-Id: 797792 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4JEIBoV016616 for ; Thu, 19 May 2011 14:18:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933404Ab1ESOSJ (ORCPT ); Thu, 19 May 2011 10:18:09 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:59408 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933305Ab1ESOSI (ORCPT ); Thu, 19 May 2011 10:18:08 -0400 Received: from dlep26.itg.ti.com ([157.170.170.121]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4JEI71g015014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 19 May 2011 09:18:07 -0500 Received: from dlee73.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4JEI7Na012301; Thu, 19 May 2011 09:18:07 -0500 (CDT) Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE73.ent.ti.com (157.170.170.88) with Microsoft SMTP Server id 8.3.106.1; Thu, 19 May 2011 09:18:07 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4JEI74Z016863; Thu, 19 May 2011 09:18:07 -0500 Received: from localhost (a0393674u.apr.dhcp.ti.com [172.24.137.179]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id p4JEI5f02022; Thu, 19 May 2011 09:18:05 -0500 (CDT) From: Amber Jain To: CC: , , Amber Jain Subject: [PATCH v2 3/5] OMAP: DSS2: Use for loop where ever possible in SR(), RR() Date: Thu, 19 May 2011 19:47:52 +0530 Message-ID: <1305814674-21589-4-git-send-email-amber@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1305814674-21589-1-git-send-email-amber@ti.com> References: <1305814674-21589-1-git-send-email-amber@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 19 May 2011 14:18:11 +0000 (UTC) Use for loop instead of individual entries for OVL_FIR_COEF_H, OVL_FIR_COEF_HV, OVL_FIR_COEF_V and OVL_CONV_COEF in SR() and RR(). Signed-off-by: Amber Jain --- Changes since v1: - removed previously added for loops from DUMPREG() as that was not getting printed correctly. drivers/video/omap2/dss/dispc.c | 174 ++++++++++---------------------------- 1 files changed, 46 insertions(+), 128 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index fd8f68e..d16eb70 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -129,6 +129,7 @@ static inline u32 dispc_read_reg(const u16 idx) void dispc_save_context(void) { + int i; if (cpu_is_omap24xx()) return; @@ -204,38 +205,17 @@ void dispc_save_context(void) SR(OVL_ACCU0(OMAP_DSS_VIDEO1)); SR(OVL_ACCU1(OMAP_DSS_VIDEO1)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 0)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 1)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 2)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 3)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 4)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 5)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 6)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 7)); - - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 0)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 1)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 2)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 3)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 4)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 5)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 6)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 7)); - - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 0)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 1)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 2)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 3)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 4)); - - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 0)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 1)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 2)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 3)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 4)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 5)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 6)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 7)); + for (i = 0; i < 8; i++) + SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, i)); + + for (i = 0; i < 8; i++) + SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, i)); + + for (i = 0; i < 5; i++) + SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, i)); + + for (i = 0; i < 8; i++) + SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, i)); SR(OVL_PRELOAD(OMAP_DSS_VIDEO1)); @@ -253,38 +233,17 @@ void dispc_save_context(void) SR(OVL_ACCU0(OMAP_DSS_VIDEO2)); SR(OVL_ACCU1(OMAP_DSS_VIDEO2)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 0)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 1)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 2)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 3)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 4)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 5)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 6)); - SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 7)); - - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 0)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 1)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 2)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 3)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 4)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 5)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 6)); - SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 7)); - - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 0)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 1)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 2)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 3)); - SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 4)); - - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 0)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 1)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 2)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 3)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 4)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 5)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 6)); - SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 7)); + for (i = 0; i < 8; i++) + SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, i)); + + for (i = 0; i < 8; i++) + SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, i)); + + for (i = 0; i < 5; i++) + SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, i)); + + for (i = 0; i < 8; i++) + SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, i)); SR(OVL_PRELOAD(OMAP_DSS_VIDEO2)); @@ -294,6 +253,7 @@ void dispc_save_context(void) void dispc_restore_context(void) { + int i; RR(SYSCONFIG); /*RR(IRQENABLE);*/ /*RR(CONTROL);*/ @@ -366,38 +326,17 @@ void dispc_restore_context(void) RR(OVL_ACCU0(OMAP_DSS_VIDEO1)); RR(OVL_ACCU1(OMAP_DSS_VIDEO1)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 0)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 1)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 2)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 3)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 4)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 5)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 6)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 7)); - - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 0)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 1)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 2)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 3)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 4)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 5)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 6)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 7)); - - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 0)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 1)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 2)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 3)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 4)); - - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 0)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 1)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 2)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 3)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 4)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 5)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 6)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 7)); + for (i = 0; i < 8; i++) + RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, i)); + + for (i = 0; i < 8; i++) + RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, i)); + + for (i = 0; i < 5; i++) + RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, i)); + + for (i = 0; i < 8; i++) + RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, i)); RR(OVL_PRELOAD(OMAP_DSS_VIDEO1)); @@ -415,38 +354,17 @@ void dispc_restore_context(void) RR(OVL_ACCU0(OMAP_DSS_VIDEO2)); RR(OVL_ACCU1(OMAP_DSS_VIDEO2)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 0)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 1)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 2)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 3)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 4)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 5)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 6)); - RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 7)); - - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 0)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 1)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 2)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 3)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 4)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 5)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 6)); - RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 7)); - - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 0)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 1)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 2)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 3)); - RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 4)); - - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 0)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 1)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 2)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 3)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 4)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 5)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 6)); - RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 7)); + for (i = 0; i < 8; i++) + RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, i)); + + for (i = 0; i < 8; i++) + RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, i)); + + for (i = 0; i < 5; i++) + RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, i)); + + for (i = 0; i < 8; i++) + RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, i)); RR(OVL_PRELOAD(OMAP_DSS_VIDEO2));