[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <260ee591-a71b-4c83-a775-5591d4222cec@app.fastmail.com>
Date: Sat, 29 Apr 2023 16:11:13 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Thomas Zimmermann" <tzimmermann@...e.de>,
"Geert Uytterhoeven" <geert@...ux-m68k.org>,
"Robin Murphy" <robin.murphy@....com>
Cc: "Helge Deller" <deller@....de>,
"Javier Martinez Canillas" <javierm@...hat.com>,
"Daniel Vetter" <daniel@...ll.ch>,
"Vineet Gupta" <vgupta@...nel.org>,
"Huacai Chen" <chenhuacai@...nel.org>,
"WANG Xuerui" <kernel@...0n.name>,
"David S . Miller" <davem@...emloft.net>,
"James E . J . Bottomley" <James.Bottomley@...senpartnership.com>,
"Sam Ravnborg" <sam@...nborg.org>, linux-fbdev@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
Linux-Arch <linux-arch@...r.kernel.org>,
linux-snps-arc@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-ia64@...r.kernel.org, loongarch@...ts.linux.dev,
linux-m68k@...ts.linux-m68k.org, sparclinux@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-parisc@...r.kernel.org
Subject: Re: [PATCH v2 5/5] fbdev: Define framebuffer I/O from Linux' I/O functions
On Sat, Apr 29, 2023, at 14:26, Thomas Zimmermann wrote:
> Am 28.04.23 um 15:17 schrieb Arnd Bergmann:
>> 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
>
> After thinking a bit more about the requirements, I'd like to got back
> to v1, but with a different spin. We want to avoid ordering guarantees,
> so I looked at the _relaxed() helpers, but they seem to swap bytes to
> little endian.
Right, the _relaxed() oens are clearly wrong, aside from
the byteswap they also include barriers on some architectures
where the __raw_* version is more relaxed than the required
semantics for relaxed.
> I guess we can remove the fb_mem*() functions entirely. They are the
> same as the non-fb_ counterparts.
These might actually be different in some cases, or sub-optimal
at the moment. memcpy()/memset() don't take __iomem pointers, so they
cause sparse warnings, while the memset_io()/memcpy_fromio()/
memcpy_toio() sometimes fall back to bytewise access that is slower
than word-sized copy. I only looked at the readl/writel style
functions earlier, no idea what we want here.
> For the fb read/write helpers, I'd
> like to add them to <asm-generic/fb.h> in a platform-neutral way. They'd
> be wrappers around __raw_(), as I wouldn't want invocations of __raw_()
> functions in the fbdev drivers.
That sounds good to me.
Arnd
Powered by blists - more mailing lists