From: yalin wang <yalin.wang2010@gmail.com>
To: adaplas@gmail.com, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com,
linux-fbdev@vger.kernel.org,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH] fbdev/nvidia:change reverse_order() macro
Date: Mon, 10 Aug 2015 13:54:47 +0000 [thread overview]
Message-ID: <CFFA680A-6341-403E-BE80-39967A7A8D08@gmail.com> (raw)
This change reverse_order() to swab32(bitrev32()), so that
it can have better performance on some platforms.
Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
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 <linux/swab.h>
#include <linux/bitrev.h>
-#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__ */
--
1.9.1
reply other threads:[~2015-08-10 13:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CFFA680A-6341-403E-BE80-39967A7A8D08@gmail.com \
--to=yalin.wang2010@gmail.com \
--cc=adaplas@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox