Commit 20d54e48 authored by Thomas Zimmermann's avatar Thomas Zimmermann

fbdev: Rename fb_mem*() helpers

Update the names of the fb_mem*() helpers to be consistent with their
regular counterparts. Hence, fb_memset() now becomes fb_memset_io(),
fb_memcpy_fromfb() now becomes fb_memcpy_fromio() and fb_memcpy_tofb()
becomes fb_memcpy_toio(). No functional changes.

v6:
	* update new file fb_io_fops.c
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarSui Jingfeng <suijingfeng@loongson.cn>
Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-8-tzimmermann@suse.de
parent 8f8eaa1b
...@@ -20,23 +20,23 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, ...@@ -20,23 +20,23 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
} }
#define fb_pgprotect fb_pgprotect #define fb_pgprotect fb_pgprotect
static inline void fb_memcpy_fromfb(void *to, const volatile void __iomem *from, size_t n) static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
{ {
memcpy(to, (void __force *)from, n); memcpy(to, (void __force *)from, n);
} }
#define fb_memcpy_fromfb fb_memcpy_fromfb #define fb_memcpy_fromio fb_memcpy_fromio
static inline void fb_memcpy_tofb(volatile void __iomem *to, const void *from, size_t n) static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
{ {
memcpy((void __force *)to, from, n); memcpy((void __force *)to, from, n);
} }
#define fb_memcpy_tofb fb_memcpy_tofb #define fb_memcpy_toio fb_memcpy_toio
static inline void fb_memset(volatile void __iomem *addr, int c, size_t n) static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
{ {
memset((void __force *)addr, c, n); memset((void __force *)addr, c, n);
} }
#define fb_memset fb_memset #define fb_memset fb_memset_io
#include <asm-generic/fb.h> #include <asm-generic/fb.h>
......
...@@ -8,23 +8,23 @@ ...@@ -8,23 +8,23 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/string.h> #include <linux/string.h>
static inline void fb_memcpy_fromfb(void *to, const volatile void __iomem *from, size_t n) static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
{ {
memcpy(to, (void __force *)from, n); memcpy(to, (void __force *)from, n);
} }
#define fb_memcpy_fromfb fb_memcpy_fromfb #define fb_memcpy_fromio fb_memcpy_fromio
static inline void fb_memcpy_tofb(volatile void __iomem *to, const void *from, size_t n) static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
{ {
memcpy((void __force *)to, from, n); memcpy((void __force *)to, from, n);
} }
#define fb_memcpy_tofb fb_memcpy_tofb #define fb_memcpy_toio fb_memcpy_toio
static inline void fb_memset(volatile void __iomem *addr, int c, size_t n) static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
{ {
memset((void __force *)addr, c, n); memset((void __force *)addr, c, n);
} }
#define fb_memset fb_memset #define fb_memset fb_memset_io
#include <asm-generic/fb.h> #include <asm-generic/fb.h>
......
...@@ -18,23 +18,23 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, ...@@ -18,23 +18,23 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
int fb_is_primary_device(struct fb_info *info); int fb_is_primary_device(struct fb_info *info);
#define fb_is_primary_device fb_is_primary_device #define fb_is_primary_device fb_is_primary_device
static inline void fb_memcpy_fromfb(void *to, const volatile void __iomem *from, size_t n) static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
{ {
sbus_memcpy_fromio(to, from, n); sbus_memcpy_fromio(to, from, n);
} }
#define fb_memcpy_fromfb fb_memcpy_fromfb #define fb_memcpy_fromio fb_memcpy_fromio
static inline void fb_memcpy_tofb(volatile void __iomem *to, const void *from, size_t n) static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
{ {
sbus_memcpy_toio(to, from, n); sbus_memcpy_toio(to, from, n);
} }
#define fb_memcpy_tofb fb_memcpy_tofb #define fb_memcpy_toio fb_memcpy_toio
static inline void fb_memset(volatile void __iomem *addr, int c, size_t n) static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
{ {
sbus_memset_io(addr, c, n); sbus_memset_io(addr, c, n);
} }
#define fb_memset fb_memset #define fb_memset fb_memset_io
#include <asm-generic/fb.h> #include <asm-generic/fb.h>
......
...@@ -153,7 +153,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -153,7 +153,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
u8 m, b; u8 m, b;
// Clear cursor image with 1010101010... // Clear cursor image with 1010101010...
fb_memset(dst, 0xaa, 1024); fb_memset_io(dst, 0xaa, 1024);
offset = align - width*2; offset = align - width*2;
......
...@@ -332,7 +332,7 @@ static const struct fb_var_screeninfo chipsfb_var = { ...@@ -332,7 +332,7 @@ static const struct fb_var_screeninfo chipsfb_var = {
static void init_chips(struct fb_info *p, unsigned long addr) static void init_chips(struct fb_info *p, unsigned long addr)
{ {
fb_memset(p->screen_base, 0, 0x100000); fb_memset_io(p->screen_base, 0, 0x100000);
p->fix = chipsfb_fix; p->fix = chipsfb_fix;
p->fix.smem_start = addr; p->fix.smem_start = addr;
......
...@@ -42,7 +42,7 @@ ssize_t fb_io_read(struct fb_info *info, char __user *buf, size_t count, loff_t ...@@ -42,7 +42,7 @@ ssize_t fb_io_read(struct fb_info *info, char __user *buf, size_t count, loff_t
while (count) { while (count) {
c = (count > PAGE_SIZE) ? PAGE_SIZE : count; c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
dst = buffer; dst = buffer;
fb_memcpy_fromfb(dst, src, c); fb_memcpy_fromio(dst, src, c);
dst += c; dst += c;
src += c; src += c;
...@@ -117,7 +117,7 @@ ssize_t fb_io_write(struct fb_info *info, const char __user *buf, size_t count, ...@@ -117,7 +117,7 @@ ssize_t fb_io_write(struct fb_info *info, const char __user *buf, size_t count,
} }
c -= trailing; c -= trailing;
fb_memcpy_tofb(dst, src, c); fb_memcpy_toio(dst, src, c);
dst += c; dst += c;
src += c; src += c;
*ppos += c; *ppos += c;
......
...@@ -737,7 +737,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -737,7 +737,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
info->var.bits_per_pixel); info->var.bits_per_pixel);
size *= info->var.yres_virtual; size *= info->var.yres_virtual;
fb_memset(info->screen_base, 0, size); fb_memset_io(info->screen_base, 0, size);
if (register_framebuffer(info) < 0) if (register_framebuffer(info) < 0)
goto out_unmap; goto out_unmap;
......
...@@ -801,7 +801,7 @@ static int __maybe_unused pvr2fb_common_init(void) ...@@ -801,7 +801,7 @@ static int __maybe_unused pvr2fb_common_init(void)
goto out_err; goto out_err;
} }
fb_memset(fb_info->screen_base, 0, pvr2_fix.smem_len); fb_memset_io(fb_info->screen_base, 0, pvr2_fix.smem_len);
pvr2_fix.ypanstep = nopan ? 0 : 1; pvr2_fix.ypanstep = nopan ? 0 : 1;
pvr2_fix.ywrapstep = nowrap ? 0 : 1; pvr2_fix.ywrapstep = nowrap ? 0 : 1;
......
...@@ -335,7 +335,7 @@ static int sst_calc_pll(const int freq, int *freq_out, struct pll_timing *t) ...@@ -335,7 +335,7 @@ static int sst_calc_pll(const int freq, int *freq_out, struct pll_timing *t)
static void sstfb_clear_screen(struct fb_info *info) static void sstfb_clear_screen(struct fb_info *info)
{ {
/* clear screen */ /* clear screen */
fb_memset(info->screen_base, 0, info->fix.smem_len); fb_memset_io(info->screen_base, 0, info->fix.smem_len);
} }
......
...@@ -527,8 +527,8 @@ rattlerSetupPlanes(struct stifb_info *fb) ...@@ -527,8 +527,8 @@ rattlerSetupPlanes(struct stifb_info *fb)
fb->id = saved_id; fb->id = saved_id;
for (y = 0; y < fb->info.var.yres; ++y) for (y = 0; y < fb->info.var.yres; ++y)
fb_memset(fb->info.screen_base + y * fb->info.fix.line_length, fb_memset_io(fb->info.screen_base + y * fb->info.fix.line_length,
0xff, fb->info.var.xres * fb->info.var.bits_per_pixel/8); 0xff, fb->info.var.xres * fb->info.var.bits_per_pixel/8);
CRX24_SET_OVLY_MASK(fb); CRX24_SET_OVLY_MASK(fb);
SETUP_FB(fb); SETUP_FB(fb);
......
...@@ -1116,7 +1116,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1116,7 +1116,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
u8 *mask = (u8 *)cursor->mask; u8 *mask = (u8 *)cursor->mask;
int i; int i;
fb_memset(cursorbase, 0, 1024); fb_memset_io(cursorbase, 0, 1024);
for (i = 0; i < cursor->image.height; i++) { for (i = 0; i < cursor->image.height; i++) {
int h = 0; int h = 0;
......
...@@ -108,28 +108,28 @@ static inline void fb_writeq(u64 b, volatile void __iomem *addr) ...@@ -108,28 +108,28 @@ static inline void fb_writeq(u64 b, volatile void __iomem *addr)
#endif #endif
#endif #endif
#ifndef fb_memcpy_fromfb #ifndef fb_memcpy_fromio
static inline void fb_memcpy_fromfb(void *to, const volatile void __iomem *from, size_t n) static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
{ {
memcpy_fromio(to, from, n); memcpy_fromio(to, from, n);
} }
#define fb_memcpy_fromfb fb_memcpy_fromfb #define fb_memcpy_fromio fb_memcpy_fromio
#endif #endif
#ifndef fb_memcpy_tofb #ifndef fb_memcpy_toio
static inline void fb_memcpy_tofb(volatile void __iomem *to, const void *from, size_t n) static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
{ {
memcpy_toio(to, from, n); memcpy_toio(to, from, n);
} }
#define fb_memcpy_tofb fb_memcpy_tofb #define fb_memcpy_toio fb_memcpy_toio
#endif #endif
#ifndef fb_memset #ifndef fb_memset
static inline void fb_memset(volatile void __iomem *addr, int c, size_t n) static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n)
{ {
memset_io(addr, c, n); memset_io(addr, c, n);
} }
#define fb_memset fb_memset #define fb_memset fb_memset_io
#endif #endif
#endif /* __ASM_GENERIC_FB_H_ */ #endif /* __ASM_GENERIC_FB_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment