From patchwork Mon Aug 10 13:54:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 6984711 Return-Path: X-Original-To: patchwork-linux-fbdev@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 6D46D9F358 for ; Mon, 10 Aug 2015 13:59:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C42B2071E for ; Mon, 10 Aug 2015 13:59:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BCA22206EE for ; Mon, 10 Aug 2015 13:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752621AbbHJN7n (ORCPT ); Mon, 10 Aug 2015 09:59:43 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:35574 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751917AbbHJN7m convert rfc822-to-8bit (ORCPT ); Mon, 10 Aug 2015 09:59:42 -0400 Received: by pdrg1 with SMTP id g1so71959091pdr.2; Mon, 10 Aug 2015 06:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=RG1Wmytnh3ZR5a3CMgU18a5+Mp3ZIDbF7Iw/rONX5a4=; b=K8ijiQ50XTwSAm8UL9ybt/LOIIewH5Eih+p3XgwNXDh4zvDTCJGeHyEORv7cFeSRA1 myQvX/Mee8v3oVukF4gGQVf+E8+SP5KAkj5jluRfG7I5SpD64XEbGtLzf3UFvTnS5Wl5 Opk3ler2WL9QwX7Rcj6IkS3XI8L159irHmX7kXbM/SPPpdhyPkSOwnwpCg8s/IA1Bj5v npdaeihYIDtkHcl2tWUz3EGROGddJhra/FrOmM28UeyNOrO7zGbPYGJBqu4rUHC6lVKX B5akBWB++hpM/+v7fhncJNWQyRPpkNNvzfJmI6NieRTDP5Kuo+NAhspDqVx4fAfVS25u Iccw== X-Received: by 10.70.92.67 with SMTP id ck3mr44487856pdb.106.1439215181818; Mon, 10 Aug 2015 06:59:41 -0700 (PDT) Received: from [192.168.1.120] ([118.194.244.47]) by smtp.gmail.com with ESMTPSA id sa9sm20066476pbc.18.2015.08.10.06.55.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Aug 2015 06:59:41 -0700 (PDT) From: yalin wang Subject: [PATCH] fbdev/nvidia:change reverse_order() macro Message-Id: Date: Mon, 10 Aug 2015 21:54:47 +0800 To: adaplas@gmail.com, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, linux-fbdev@vger.kernel.org, open list Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) X-Mailer: Apple Mail (2.2098) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 This change reverse_order() to swab32(bitrev32()), so that it can have better performance on some platforms. Signed-off-by: yalin wang --- drivers/video/fbdev/nvidia/nv_accel.c | 4 ++-- drivers/video/fbdev/nvidia/nv_local.h | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/video/fbdev/nvidia/nv_accel.c b/drivers/video/fbdev/nvidia/nv_accel.c index ad6472a..c21cb34 100644 --- a/drivers/video/fbdev/nvidia/nv_accel.c +++ b/drivers/video/fbdev/nvidia/nv_accel.c @@ -382,7 +382,7 @@ static void nvidiafb_mono_color_expand(struct fb_info *info, for (j = RECT_EXPAND_TWO_COLOR_DATA_MAX_DWORDS; j--;) { tmp = data[k++]; - reverse_order(&tmp); + tmp = reverse_order(tmp); NVDmaNext(par, tmp); } @@ -394,7 +394,7 @@ static void nvidiafb_mono_color_expand(struct fb_info *info, for (j = dsize; j--;) { tmp = data[k++]; - reverse_order(&tmp); + tmp = reverse_order(tmp); NVDmaNext(par, tmp); } } diff --git a/drivers/video/fbdev/nvidia/nv_local.h b/drivers/video/fbdev/nvidia/nv_local.h index 68e508d..a0eb1f3 100644 --- a/drivers/video/fbdev/nvidia/nv_local.h +++ b/drivers/video/fbdev/nvidia/nv_local.h @@ -97,18 +97,13 @@ #ifdef __LITTLE_ENDIAN +#include #include -#define reverse_order(l) \ -do { \ - u8 *a = (u8 *)(l); \ - a[0] = bitrev8(a[0]); \ - a[1] = bitrev8(a[1]); \ - a[2] = bitrev8(a[2]); \ - a[3] = bitrev8(a[3]); \ -} while(0) +#define reverse_order(v) swab32(bitrev32(v)) + #else -#define reverse_order(l) do { } while(0) +#define reverse_order(v) (v) #endif /* __LITTLE_ENDIAN */ #endif /* __NV_LOCAL_H__ */