From 81ea5144f0cb88ae417f66448e66fd41cbe1e2c6 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 17 Apr 2023 14:56:37 +0200 Subject: arch/ia64: Implement with generic helpers Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-6-tzimmermann@suse.de --- arch/ia64/include/asm/fb.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'arch/ia64/include') diff --git a/arch/ia64/include/asm/fb.h b/arch/ia64/include/asm/fb.h index 5f95782bfa46..0208f64a0da0 100644 --- a/arch/ia64/include/asm/fb.h +++ b/arch/ia64/include/asm/fb.h @@ -2,11 +2,12 @@ #ifndef _ASM_FB_H_ #define _ASM_FB_H_ -#include -#include #include + #include +struct file; + static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, unsigned long off) { @@ -15,10 +16,8 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, else vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); } +#define fb_pgprotect fb_pgprotect -static inline int fb_is_primary_device(struct fb_info *info) -{ - return 0; -} +#include #endif /* _ASM_FB_H_ */ -- cgit From 8f8eaa1b023580f7dce7fe8d73539b093edea65b Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 May 2023 12:24:43 +0200 Subject: fbdev: Move framebuffer I/O helpers into Implement framebuffer I/O helpers, such as fb_read*() and fb_write*(), in the architecture's header file or the generic one. The common case has been the use of regular I/O functions, such as __raw_readb() or memset_io(). A few architectures used plain system- memory reads and writes. Sparc used helpers for its SBus. The architectures that used special cases provide the same code in their __raw_*() I/O helpers. So the patch replaces this code with the __raw_*() functions and moves it to for all architectures. v8: * remove garbage after commit-message tags v6: * fix fb_readq()/fb_writeq() on 64-bit mips (kernel test robot) v5: * include in ; fix s390 build v4: * ia64, loongarch, sparc64: add fb_mem*() to arch headers to keep current semantics (Arnd) v3: * implement all architectures with generic helpers * support reordering and native byte order (Geert, Arnd) Signed-off-by: Thomas Zimmermann Tested-by: Sui Jingfeng Reviewed-by: Arnd Bergmann Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-7-tzimmermann@suse.de --- arch/ia64/include/asm/fb.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'arch/ia64/include') diff --git a/arch/ia64/include/asm/fb.h b/arch/ia64/include/asm/fb.h index 0208f64a0da0..bcf982043a5c 100644 --- a/arch/ia64/include/asm/fb.h +++ b/arch/ia64/include/asm/fb.h @@ -2,7 +2,9 @@ #ifndef _ASM_FB_H_ #define _ASM_FB_H_ +#include #include +#include #include @@ -18,6 +20,24 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, } #define fb_pgprotect fb_pgprotect +static inline void fb_memcpy_fromfb(void *to, const volatile void __iomem *from, size_t n) +{ + memcpy(to, (void __force *)from, n); +} +#define fb_memcpy_fromfb fb_memcpy_fromfb + +static inline void fb_memcpy_tofb(volatile void __iomem *to, const void *from, size_t n) +{ + memcpy((void __force *)to, from, n); +} +#define fb_memcpy_tofb fb_memcpy_tofb + +static inline void fb_memset(volatile void __iomem *addr, int c, size_t n) +{ + memset((void __force *)addr, c, n); +} +#define fb_memset fb_memset + #include #endif /* _ASM_FB_H_ */ -- cgit From 20d54e48d9c705091a025afff5839da2ea606f6b Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 May 2023 12:24:44 +0200 Subject: 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: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-8-tzimmermann@suse.de --- arch/ia64/include/asm/fb.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'arch/ia64/include') diff --git a/arch/ia64/include/asm/fb.h b/arch/ia64/include/asm/fb.h index bcf982043a5c..1717b26fd423 100644 --- a/arch/ia64/include/asm/fb.h +++ b/arch/ia64/include/asm/fb.h @@ -20,23 +20,23 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, } #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); } -#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); } -#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); } -#define fb_memset fb_memset +#define fb_memset fb_memset_io #include -- cgit