Re: [PATCH v2 5/5] fbdev: Define framebuffer I/O from Linux' I/O functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "Geert Uytterhoeven" <geert@xxxxxxxxxxxxxx>, "Robin Murphy" <robin.murphy@xxxxxxx>
- Subject: Re: [PATCH v2 5/5] fbdev: Define framebuffer I/O from Linux' I/O functions
- From: "Arnd Bergmann" <arnd@xxxxxxxx>
- Date: Fri, 28 Apr 2023 14:17:24 +0100
- Cc: "Thomas Zimmermann" <tzimmermann@xxxxxxx>, "Helge Deller" <deller@xxxxxx>, "Javier Martinez Canillas" <javierm@xxxxxxxxxx>, "Daniel Vetter" <daniel@xxxxxxxx>, "Vineet Gupta" <vgupta@xxxxxxxxxx>, "Huacai Chen" <chenhuacai@xxxxxxxxxx>, "WANG Xuerui" <kernel@xxxxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>, "James E . J . Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, "Sam Ravnborg" <sam@xxxxxxxxxxxx>, linux-fbdev@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, Linux-Arch <linux-arch@xxxxxxxxxxxxxxx>, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx
- Feedback-id: i56a14606:Fastmail
- In-reply-to: <CAMuHMdUGjtiAR37L4_e0_p8ee2=gxoUj7+e7rqMLTBK+vpV4yw@mail.gmail.com>
- References: <20230428092711.406-1-tzimmermann@suse.de> <20230428092711.406-6-tzimmermann@suse.de> <430c73f0-45f4-f81e-6506-bc8cc955d936@arm.com> <CAMuHMdUGjtiAR37L4_e0_p8ee2=gxoUj7+e7rqMLTBK+vpV4yw@mail.gmail.com>
- User-agent: Cyrus-JMAP/3.9.0-alpha0-374-g72c94f7a42-fm-20230417.001-g72c94f7a
On Fri, Apr 28, 2023, at 13:27, Geert Uytterhoeven wrote:
> On Fri, Apr 28, 2023 at 2:18 PM Robin Murphy <robin.murphy@xxxxxxx> wrote:
>> On 2023-04-28 10:27, Thomas Zimmermann wrote:
>> > -
>> > -#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || \
>> > - defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || \
>> > - defined(__arm__) || defined(__aarch64__) || defined(__mips__)
>> > -
>> > -#define fb_readb __raw_readb
>> > -#define fb_readw __raw_readw
>> > -#define fb_readl __raw_readl
>> > -#define fb_readq __raw_readq
>> > -#define fb_writeb __raw_writeb
>> > -#define fb_writew __raw_writew
>> > -#define fb_writel __raw_writel
>> > -#define fb_writeq __raw_writeq
>>
>> Note that on at least some architectures, the __raw variants are
>> native-endian, whereas the regular accessors are explicitly
>> little-endian, so there is a slight risk of inadvertently changing
>> behaviour on big-endian systems (MIPS most likely, but a few old ARM
>> platforms run BE as well).
>
> Also on m68k, when ISA or PCI are enabled.
>
> In addition, the non-raw variants may do some extras to guarantee
> ordering, which you do not need on a frame buffer.
>
> So I'd go for the __raw_*() variants everywhere.
The only implementations in fbdev are
1) sparc sbus
2) __raw_writel
3) direct pointer dereference
But none use the byte-swapping writel() implementations, and
the only ones that use the direct pointer dereference or sbus
are the ones on which these are defined the same as __raw_writel
Arnd
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]