From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Ravnborg Date: Fri, 28 Apr 2023 13:12:21 +0000 Subject: Re: [PATCH v2 5/5] fbdev: Define framebuffer I/O from Linux' I/O functions Message-Id: <20230428131221.GE3995435@ravnborg.org> List-Id: References: <20230428092711.406-1-tzimmermann@suse.de> <20230428092711.406-6-tzimmermann@suse.de> In-Reply-To: <20230428092711.406-6-tzimmermann@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Zimmermann Cc: deller@gmx.de, geert@linux-m68k.org, javierm@redhat.com, daniel@ffwll.ch, vgupta@kernel.org, chenhuacai@kernel.org, kernel@xen0n.name, davem@davemloft.net, James.Bottomley@hansenpartnership.com, arnd@arndb.de, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, sparclinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org Hi Thomas, On Fri, Apr 28, 2023 at 11:27:11AM +0200, Thomas Zimmermann wrote: > Implement framebuffer I/O helpers, such as fb_read*() and fb_write*() > with Linux' regular I/O functions. Remove all ifdef cases for the > various architectures. > > Most of the supported architectures use __raw_() I/O functions or treat > framebuffer memory like regular memory. This is also implemented by the > architectures' I/O function, so we can use them instead. > > Sparc uses SBus to connect to framebuffer devices. It provides respective > implementations of the framebuffer I/O helpers. The involved sbus_() > I/O helpers map to the same code as Sparc's regular I/O functions. As > with other platforms, we can use those instead. > > We leave a TODO item to replace all fb_() functions with their regular > I/O counterparts throughout the fbdev drivers. > > Signed-off-by: Thomas Zimmermann > --- > include/linux/fb.h | 63 +++++++++++----------------------------------- > 1 file changed, 15 insertions(+), 48 deletions(-) > > diff --git a/include/linux/fb.h b/include/linux/fb.h > index 08cb47da71f8..4aa9e90edd17 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -15,7 +15,6 @@ > #include > #include > #include > -#include > > struct vm_area_struct; > struct fb_info; > @@ -511,58 +510,26 @@ struct fb_info { > */ > #define STUPID_ACCELF_TEXT_SHIT > > -// This will go away > -#if defined(__sparc__) > - > -/* We map all of our framebuffers such that big-endian accesses > - * are what we want, so the following is sufficient. > +/* > + * TODO: Update fbdev drivers to call the I/O helpers directly and > + * remove the fb_() tokens. > */ When the __raw_* variants are used, as Geert points out, then I think the memcpy / memset can be replaced, but the rest seems fine to keep. My personal opinion is that __raw_* is for macro use etc, and not something to use everywhere. So I like the fb_read/fb_write macros. But that is just my color of the bikeshed. Sam