* [RFC] fbdev/nvidia:change reverse_order() macro
@ 2015-08-20 6:52 yalin wang
2015-08-20 11:04 ` Tomi Valkeinen
0 siblings, 1 reply; 2+ messages in thread
From: yalin wang @ 2015-08-20 6:52 UTC (permalink / raw)
To: adaplas, plagnioj, tomi.valkeinen, linux-fbdev, linux-kernel; +Cc: yalin wang
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC] fbdev/nvidia:change reverse_order() macro
2015-08-20 6:52 [RFC] fbdev/nvidia:change reverse_order() macro yalin wang
@ 2015-08-20 11:04 ` Tomi Valkeinen
0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2015-08-20 11:04 UTC (permalink / raw)
To: yalin wang, adaplas, plagnioj, linux-fbdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 540 bytes --]
On 20/08/15 09:52, yalin wang wrote:
> 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(-)
I have more or less the same comments here as for the riva patch, except
in this one I'd change the macro to an static inline function.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-20 11:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 6:52 [RFC] fbdev/nvidia:change reverse_order() macro yalin wang
2015-08-20 11:04 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).