diff options
author | Thomas Huth <thuth@redhat.com> | 2015-08-03 23:06:37 +0200 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2015-08-05 16:01:39 +1000 |
commit | 59a135eb78378f1574549c93bbf421505576ec6e (patch) | |
tree | 9b084fbab14ac9b77af27d5db85c7ee4c9b425ff /include | |
parent | d0732f556d44e3b2aab427863fa47ba9ae0e1419 (diff) | |
download | SLOF-59a135eb78378f1574549c93bbf421505576ec6e.zip SLOF-59a135eb78378f1574549c93bbf421505576ec6e.tar.gz SLOF-59a135eb78378f1574549c93bbf421505576ec6e.tar.bz2 |
fbuffer: Implement MRMOVE as an accelerated primitive
The character drawing function fb8-draw-character uses "mrmove"
(which moves main memory contents to IO memory) to copy the data
of the character from main memory to the frame buffer. However,
the current implementation of "mrmove" performs quite badly on
board-qemu since it triggers a hypercall for each memory access
(e.g. for each 8 bytes that are transfered).
But since the KVMPPC_H_LOGICAL_MEMOP hypercall can transfer bigger
regions at once, we can accelerate the character drawing quite a
bit by simply mapping the "mrmove" to the same macro that is
already used for the "rmove" (which is normally only used for
copying from IO memory to IO memory, but on board-qemu it does
not matter). For keeping board-js2x in sync, this patch also
transforms the "mrmove" for js2x into primitives.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'include')
-rw-r--r-- | include/ppc970/cache.h | 18 | ||||
-rw-r--r-- | include/ppcp7/cache.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/ppc970/cache.h b/include/ppc970/cache.h index b748689..a53585b 100644 --- a/include/ppc970/cache.h +++ b/include/ppc970/cache.h @@ -83,4 +83,22 @@ cache_inhibited_access(uint64_t, 64) default: _RMOVE(s, d, size, type_c); break; \ } +/* main RAM to IO memory move */ +#define FAST_MRMOVE_TYPED(s, d, size, t) \ +{ \ + t *s1 = (s), *d1 = (d); \ + register t tmp; \ + while (size > 0) { \ + tmp = *s1++; SET_CI; *d1++ = tmp; CLR_CI; size -= sizeof(t); \ + } \ +} + +#define FAST_MRMOVE(s, d, size) \ + switch (((type_u)(s) | (type_u)(d) | (size)) & (sizeof(type_u)-1)) { \ + case 0: FAST_MRMOVE_TYPED(s, d, size, type_u); break; \ + case 4: FAST_MRMOVE_TYPED(s, d, size, type_l); break; \ + case 2: case 6: FAST_MRMOVE_TYPED(s, d, size, type_w); break; \ + default: FAST_MRMOVE_TYPED(s, d, size, type_c); break; \ + } + #endif diff --git a/include/ppcp7/cache.h b/include/ppcp7/cache.h index dc68371..64bcb00 100644 --- a/include/ppcp7/cache.h +++ b/include/ppcp7/cache.h @@ -122,6 +122,8 @@ static inline void ci_rmove(void *dst, void *src, unsigned long esize, } \ } while(0) +#define FAST_MRMOVE(s, d, size) _FASTRMOVE(s, d, size) + static inline uint16_t bswap16_load(uint64_t addr) { unsigned int val; |