Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2095551rwr; Fri, 28 Apr 2023 06:13:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6b8dLtJY7Xz4Htt0LdV+m+OX4s0wcyzNnwPlBy1Ud5vFlxud5jxbpErL3yHKxAtUxvMSJZ X-Received: by 2002:a05:6a20:12d6:b0:f3:256:24d3 with SMTP id v22-20020a056a2012d600b000f3025624d3mr7196512pzg.11.1682687606928; Fri, 28 Apr 2023 06:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682687606; cv=none; d=google.com; s=arc-20160816; b=wTivKl/WD58IsAbfpzrW2x/uJynFpnRPK25ojsZDoclcdc328kmErggC2kFC6K5XtS H9liaK+5TqC39yolnE2pq0acxKAbTCy/3y4GLQdPhfYFhFnXF293FXLyMR8+bpX5W3EA xbpRnrWT5T+bzhKyKEf+noSG1Lar3Lo4NDO6QICoYyvWj5blMPPdKErQFHUIf0+NaSq2 0nWePqDOQXAEGi6eIZfo+lEk/LtShS1hHL+TF63d8COcxtiw972JHJ9lD/GtN/zoOG28 WFL1aQXKc4tjmzVX7ZWJMuBIBRJHiQ4ozqfCHDghRfLHOR6MAUdZSI+ILqP528bK7tw9 WsRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=kmbigf8ZVmooEPRLcPWea0C5h/tG8tqKZ9j5z66PqBY=; b=gUTEeVOnK1zI/uTG8rGJELGPvQGPuBhEtFNkqdQ1lbqJNm6bfJMndR23MxAOz6dGLy CbGi9s5hL6Oo03lw4D08f1CqWG/tGIsT7zvJO+nyK1PyzGzCLEn8I0abww8JPe+vZi8D +4gzfPX2cjN9l8Syw/sbJ2hqhj6s/vXQimuirrt2oD2EGQ3urhv2Zvr1+9Umx34QnR57 yCp6Jobu4pNtbuu06tGFB31QHb/prXJ6fluVERJWUfMC6DUWOMf/B4zVVpSl1k+I61Qt pn9RtNRSnjrv61FZ4Sz18c58ZkLXzOglyrPuNBIW5piqSZXYu401JuPdjDAFy7HgsmTU RXOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa1 header.b=eF1EsYiP; dkim=neutral (no key) header.i=@ravnborg.org header.b=4Jlvbtvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k24-20020a63f018000000b00513f070aa0dsi4691913pgh.655.2023.04.28.06.13.14; Fri, 28 Apr 2023 06:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa1 header.b=eF1EsYiP; dkim=neutral (no key) header.i=@ravnborg.org header.b=4Jlvbtvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346157AbjD1NMr (ORCPT + 99 others); Fri, 28 Apr 2023 09:12:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbjD1NMn (ORCPT ); Fri, 28 Apr 2023 09:12:43 -0400 Received: from mailrelay2-1.pub.mailoutpod2-cph3.one.com (mailrelay2-1.pub.mailoutpod2-cph3.one.com [IPv6:2a02:2350:5:401::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49BBB40DA for ; Fri, 28 Apr 2023 06:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=kmbigf8ZVmooEPRLcPWea0C5h/tG8tqKZ9j5z66PqBY=; b=eF1EsYiPJqXNskjn8lLNQ9+SL1ozu7DWmdUJ0wcEG54JzKFiSjRAPjbhy8H0+ZeYNmOBVGFyCGbxz 1DqXAIXpm/M1j1pEPlF21UxeOY9nSl8/Iap7s1D3yCRgky5Tf80L/WY954alIRbLpoRtvZVhxcohcH gZD+6fQpR0DA7lwuphoh9i3Dd/maumGn+Tt03U+E+G1J826wfTSa+oaLhdKuvV7O3rOy6M3AH/bTVT eeFuoeTpNjqcA1avBxePv+IBiCUAGPqV57NpcpjKAT9+Yl5+7MpsaighKpk8/33r2f8BLL2Qa32pZL 7l5szrsw+UlNB1/m+sTEJZXBaipCRvA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=kmbigf8ZVmooEPRLcPWea0C5h/tG8tqKZ9j5z66PqBY=; b=4Jlvbtvr17/0MN2lAZB4KR0YNvraiUSF3TAKjdHVbDRCCaeKQbtDwZJbVZrTzY+ezyqRT4rd+YKPh HNdg4s7Ag== X-HalOne-ID: 4f01baa5-e5c6-11ed-95e5-13111ccb208d Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay2 (Halon) with ESMTPSA id 4f01baa5-e5c6-11ed-95e5-13111ccb208d; Fri, 28 Apr 2023 13:12:23 +0000 (UTC) Date: Fri, 28 Apr 2023 15:12:21 +0200 From: Sam Ravnborg 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 Subject: Re: [PATCH v2 5/5] fbdev: Define framebuffer I/O from Linux' I/O functions Message-ID: <20230428131221.GE3995435@ravnborg.org> References: <20230428092711.406-1-tzimmermann@suse.de> <20230428092711.406-6-tzimmermann@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230428092711.406-6-tzimmermann@suse.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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