From patchwork Mon Dec 19 16:04:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC23AC4332F for ; Mon, 19 Dec 2022 17:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AlKPhCRm2nUZAFCGUE3GIODe22L8TtjzNeYDZUslS4Y=; b=zvcqwu5KNXNcZr BXcnyZmfiax1hm+trfP/YfA9rGPTJKSYx0Xsd7ifQ+HGqZj+Ml9k42bsQ/kRD9FZJltC2V9Zq3yUH 6Xg7juwMGfmrBsErnR3dQbrQa03wXwNSN6JLGoc9VhPHt284K6Rv01DEjoFjr95AL+iMp4fcOkzBI YzcK8gcWpIz5HzCGqbHGJBbOrp+My7xBBDQGrCaUn0YwMCsKIHxb6g223BgYwIjxeFt8X9xS1TYD6 vfFJ+cTXqxF6g1Hm5kRFWFlmhor73v0WP+uxwPT/AGbifV1QlOB8Je7X00RAn6pXhr8jeRtwpmFGf VZRAaAvd3u0KiuwolpaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7K8v-00GvKM-Am; Mon, 19 Dec 2022 17:41:38 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idn-00Fmuv-Le for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:28 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BFC7C60F21; Mon, 19 Dec 2022 16:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0aR/7zFFg6opL9Sswet7ilYlrwEicNIovKojH/nmoWY=; b=bGEDJKn4Nwf6TsCbG2/dCdacpEPM1FAG+frz2BSnI0hzyfybAerHTKemiCgf9kfdtlZIM1 rnX4VyKXFRrqi33on7Ci/RbaKdebTLAtjrIpsf0bAXKZwNS18VSKcLo3XcqpwumY/sESoY ETmo/ogos0cAGYArM4ar9DBb0ic8N8I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465918; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0aR/7zFFg6opL9Sswet7ilYlrwEicNIovKojH/nmoWY=; b=hLadcWTjfhJunbRRm9pANWRI7ofUt7yf9j+g+bFlaED6UhkD3EaREXKJiv1PajaAbRL4ac Y6/HVNbxpcwj+OBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 87D8F13911; Mon, 19 Dec 2022 16:05:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qGT7H76LoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:18 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 01/18] fbcon: Remove trailing whitespaces Date: Mon, 19 Dec 2022 17:04:59 +0100 Message-Id: <20221219160516.23436-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080524_032495_23672B6F X-CRM114-Status: GOOD ( 16.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/core/fbcon.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index c0143d38df83..500b26d652f6 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -26,7 +26,7 @@ * * Hardware cursor support added by Emmanuel Marty (core@ggi-project.org) * Smart redraw scrolling, arbitrary font width support, 512char font support - * and software scrollback added by + * and software scrollback added by * Jakub Jelinek (jj@ultra.linux.cz) * * Random hacking by Martin Mares @@ -127,7 +127,7 @@ static int logo_shown = FBCON_LOGO_CANSHOW; /* console mappings */ static unsigned int first_fb_vc; static unsigned int last_fb_vc = MAX_NR_CONSOLES - 1; -static int fbcon_is_default = 1; +static int fbcon_is_default = 1; static int primary_device = -1; static int fbcon_has_console_bind; @@ -415,12 +415,12 @@ static int __init fb_console_setup(char *this_opt) strscpy(fontname, options + 5, sizeof(fontname)); continue; } - + if (!strncmp(options, "scrollback:", 11)) { pr_warn("Ignoring scrollback size option\n"); continue; } - + if (!strncmp(options, "map:", 4)) { options += 4; if (*options) { @@ -446,7 +446,7 @@ static int __init fb_console_setup(char *this_opt) last_fb_vc = simple_strtoul(options, &options, 10) - 1; if (last_fb_vc < first_fb_vc || last_fb_vc >= MAX_NR_CONSOLES) last_fb_vc = MAX_NR_CONSOLES - 1; - fbcon_is_default = 0; + fbcon_is_default = 0; continue; } @@ -940,7 +940,7 @@ static const char *fbcon_startup(void) info = fbcon_registered_fb[info_idx]; if (!info) return NULL; - + if (fbcon_open(info)) return NULL; @@ -1999,7 +1999,7 @@ static void updatescrollmode(struct fbcon_display *p, #define PITCH(w) (((w) + 7) >> 3) #define CALC_FONTSZ(h, p, c) ((h) * (p) * (c)) /* size = height * pitch * charcount */ -static int fbcon_resize(struct vc_data *vc, unsigned int width, +static int fbcon_resize(struct vc_data *vc, unsigned int width, unsigned int height, unsigned int user) { struct fb_info *info = fbcon_info_from_console(vc->vc_num); @@ -2174,7 +2174,7 @@ static int fbcon_switch(struct vc_data *vc) ops->update_start(info); } - fbcon_set_palette(vc, color_table); + fbcon_set_palette(vc, color_table); fbcon_clear_margins(vc, 0); if (logo_shown == FBCON_LOGO_DRAW) { @@ -2343,7 +2343,7 @@ static void set_vc_hi_font(struct vc_data *vc, bool set) vc->vc_complement_mask >>= 1; vc->vc_s_complement_mask >>= 1; } - + /* ++Edmund: reorder the attribute bits */ if (vc->vc_can_do_color) { unsigned short *cp = @@ -2366,7 +2366,7 @@ static void set_vc_hi_font(struct vc_data *vc, bool set) vc->vc_complement_mask <<= 1; vc->vc_s_complement_mask <<= 1; } - + /* ++Edmund: reorder the attribute bits */ { unsigned short *cp = @@ -2527,7 +2527,7 @@ static int fbcon_set_font(struct vc_data *vc, struct console_font *font, /* Check if the same font is on some other console already */ for (i = first_fb_vc; i <= last_fb_vc; i++) { struct vc_data *tmp = vc_cons[i].d; - + if (fb_display[i].userfont && fb_display[i].fontdata && FNTSUM(fb_display[i].fontdata) == csum && @@ -3435,5 +3435,5 @@ void __exit fb_console_exit(void) do_unregister_con_driver(&fb_con); console_unlock(); -} +} #endif From patchwork Mon Dec 19 16:05:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C405EC4332F for ; Mon, 19 Dec 2022 17:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lB642XXCxzpdBSLkpVXHROYdyGP7lSpBzcFLzW47Zak=; b=NZP/5j27Y/y7OE LmwNKNUlR7vNoBXgwvUh6ahT7I3nsdn1Q0iilNu2wTYeXnfiX6BkfVzbI4l/1/sfEQ0qCN/vxqEjX ojfz15cc8eFWPPsJlc4WlP2qnbWAd3tmCO/ZzzpjhqYBDAvBAKmCrKfTlQuZD1i9ZyQ0XIY+foBwo gFlq8o75V3ccnEW37VleVmRX+twl4LNz50fuSNg9qme+Y60LqGLQAuhmAfn1Qw4zSSB7O9qukiw6q /LPL1cVvdQDIrbWLeX3t77KndrKI2/bsZsZRC9yIpqEso7EYfbnkiVP0Y6RK1J0d0y+HXIZn+fNgF lQM9F9nzIuVMSubiGgWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7K83-00GuiN-Ma; Mon, 19 Dec 2022 17:40:44 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idn-00Fmuz-NQ for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:29 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0796461067; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=69qvRJt9dPgqQNta8R4MzEBubU4rlE+sQe1t6RNuAKU=; b=QTBorkF0/jrcJexym83GrqOAhTMVDvYEGm3m2hcE+ofn/1DEesjc40qGagcGmqFOIi8VML kPp0/BAgAb0vhHNNj2HDwUWLUqBz6Ay7SCfn8vyiyo8Jvu0lV9B1WZK7K7RacxyRDsvA4E vp1TMkh6hO8sSC3/Uaw2M3uoG6Voz0o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=69qvRJt9dPgqQNta8R4MzEBubU4rlE+sQe1t6RNuAKU=; b=/2sPOhMvtrkhzdSGV3gI9/CKIROCWhDl2D3pPAWtpbx8/HnrMbiv/j+1pui+bnA0+zgXiW AaiNk+TKvuw9OxCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C4A2513910; Mon, 19 Dec 2022 16:05:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EDcHL76LoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:18 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 02/18] Revert "fbcon: don't lose the console font across generic->chip driver switch" Date: Mon, 19 Dec 2022 17:05:00 +0100 Message-Id: <20221219160516.23436-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080524_154865_B0A29A25 X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This reverts commit ae1287865f5361fa138d4d3b1b6277908b54eac9. Always free the console font when deinitializing the framebuffer console. Subsequent framebuffer consoles will then use the default font. Rely on userspace to load any user-configured font for these consoles. Commit ae1287865f53 ("fbcon: don't lose the console font across generic->chip driver switch") was introduced to work around losing the font during graphics-device handover. [1][2] It kept a dangling pointer with the font data between loading the two consoles, which is fairly adventurous hack. It also never covered cases when the other consoles, such as VGA text mode, where involved. The problem has meanwhile been solved in userspace. Systemd comes with a udev rule that re-installs the configured font when a console comes up. [3] So the kernel workaround can be removed. This also removes one of the two special cases triggered by setting FBINFO_MISC_FIRMWARE in an fbdev driver. Tested during device handover from efifb and simpledrm to radeon. Udev reloads the configured console font for the new driver's terminal. Signed-off-by: Thomas Zimmermann Link: https://bugzilla.redhat.com/show_bug.cgi?id=892340 # 1 Link: https://bugzilla.redhat.com/show_bug.cgi?id=1074624 # 2 Link: https://cgit.freedesktop.org/systemd/systemd/tree/src/vconsole/90-vconsole.rules.in?h=v222 # 3 Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/core/fbcon.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 500b26d652f6..90b36b3adfd0 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -958,7 +958,7 @@ static const char *fbcon_startup(void) set_blitting_type(vc, info); /* Setup default font */ - if (!p->fontdata && !vc->vc_font.data) { + if (!p->fontdata) { if (!fontname[0] || !(font = find_font(fontname))) font = get_default_font(info->var.xres, info->var.yres, @@ -968,8 +968,6 @@ static const char *fbcon_startup(void) vc->vc_font.height = font->height; vc->vc_font.data = (void *)(p->fontdata = font->data); vc->vc_font.charcount = font->charcount; - } else { - p->fontdata = vc->vc_font.data; } cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); @@ -1135,9 +1133,9 @@ static void fbcon_init(struct vc_data *vc, int init) ops->p = &fb_display[fg_console]; } -static void fbcon_free_font(struct fbcon_display *p, bool freefont) +static void fbcon_free_font(struct fbcon_display *p) { - if (freefont && p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0)) + if (p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0)) kfree(p->fontdata - FONT_EXTRA_WORDS * sizeof(int)); p->fontdata = NULL; p->userfont = 0; @@ -1172,8 +1170,8 @@ static void fbcon_deinit(struct vc_data *vc) struct fb_info *info; struct fbcon_ops *ops; int idx; - bool free_font = true; + fbcon_free_font(p); idx = con2fb_map[vc->vc_num]; if (idx == -1) @@ -1184,8 +1182,6 @@ static void fbcon_deinit(struct vc_data *vc) if (!info) goto finished; - if (info->flags & FBINFO_MISC_FIRMWARE) - free_font = false; ops = info->fbcon_par; if (!ops) @@ -1197,9 +1193,8 @@ static void fbcon_deinit(struct vc_data *vc) ops->initialized = false; finished: - fbcon_free_font(p, free_font); - if (free_font) - vc->vc_font.data = NULL; + fbcon_free_font(p); + vc->vc_font.data = NULL; if (vc->vc_hi_font_mask && vc->vc_screenbuf) set_vc_hi_font(vc, false); From patchwork Mon Dec 19 16:05:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076932 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F7BBC4332F for ; Mon, 19 Dec 2022 17:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nsKDY1ff45FuxbGIXgmY8Yam66j+wTT1E1qC9jyNNNc=; b=GY47HSy3mUevLg WoRTaQoCsCzqwvhzSZMxZvwHOi3gMfD2fbvYh/Lh+AM7gTErp0R0DL4xDS5JTapln3PW/kYkwNsh6 9P7Gz6qf8KJSEBiusP1nxBajpEkdFa5mlKAq+E4rnkQPFglzFtvDvXj10TS50OYjxkHkxwgFSegka vkwndGMKdqxj/qdNFZkyrCTehBtefDKKt3uKmLExdJge1hepbmqfg3gGHEPBs1y9AL6jWvPImVu16 Ew1rVCBaoPM+VZp+SNA2fBV6fDHalPWvw5QlElG86uJH12EHPY5ECncNTU/cHUSDfmzhGauKSuMb/ 3DJKhg1au9PUGjidUv1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7K7W-00GuNA-GR; Mon, 19 Dec 2022 17:40:10 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idn-00Fmuw-G6 for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:25 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 478C961064; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j/WtPNqywsSEpr9FxudsrWxg3jx8uCB1LXApMkuTryQ=; b=G35pyIWtUBenUQJ21IDQMaeZhTCkQDBgHsBHlaZexD2tT6jjxWspJCrKctcXKlxpJvUr5G Lm5SxZBKR5MkFnp/YyLOBQmyZSTVBQr45Gp2uzqp9tt9RYU3tZxz4OKhr+nDw3nJ7k9yq2 X2GDmZLIW2P+amGNg0oac8WNUHhq92Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j/WtPNqywsSEpr9FxudsrWxg3jx8uCB1LXApMkuTryQ=; b=KULvcwF459ruE1RaBsiyv6Z46t8FqmxzXFTC+65BjstpU+SJBvqbRuql7IxV+K53bZyKw3 zVsDOCVA/qEPRHBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0C8CD13911; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4JchAr+LoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:19 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 03/18] drm/gma500: Do not set struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:01 +0100 Message-Id: <20221219160516.23436-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080523_773958_17381410 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generic fbdev drivers use the apertures field in struct fb_info to control ownership of the framebuffer memory and graphics device. Do not set the values in gma500. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/gma500/framebuffer.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 8d5a37b8f110..9e892a82e109 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -297,11 +297,6 @@ static int psbfb_create(struct drm_fb_helper *fb_helper, info->screen_base = dev_priv->vram_addr + backing->offset; info->screen_size = size; - if (dev_priv->gtt.stolen_size) { - info->apertures->ranges[0].base = dev_priv->fb_base; - info->apertures->ranges[0].size = dev_priv->gtt.stolen_size; - } - drm_fb_helper_fill_info(info, fb_helper, sizes); info->fix.mmio_start = pci_resource_start(pdev, 0); From patchwork Mon Dec 19 16:05:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C312DC4332F for ; Mon, 19 Dec 2022 17:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9hHIjyIdmD1C4TNx0kn88idwN1/6PVsKGpRp8vWEZEA=; b=aGLRtkdodYyNQZ 7EGatodSc4tmTwCE9COJP8E/bXf8Te3+Cj69/ZLBS8J+7/c8tGzaTjN/WDm+xpbqnKvJeLlf2dlXF eh7H+7xEDL/MQY3DgEXfC2OTGG2Ca0Gp/thqHGdFlv2pi3JPVFSNInC7K5LEug7ID+VsLrnCT4fiM IkfWAPqaUOt/S+ghUEBDF7i2tyL49s2G2vDCDWgKDq1j4egYnnPuUS9wk2RuqBmsV5WasWve+akUr j/ssBPYXYvfWxxWz9bmQEU6l06ZERgCBAIjazRtDQgVnGPPuaKl68LcU2xErOeYa8EtdThloHBXjA N73DW/3CR2LyH2NB0J0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KBm-00GxWN-IU; Mon, 19 Dec 2022 17:44:35 +0000 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idp-00Fmv5-A3 for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:31 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7F84F38145; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fUg69Q6qEszR/WHAWAwnkSfcltjIyOVm1DIp4dya8uM=; b=2NgbyN6O+VYVJ9thzpCsCEsN9zlWzf/ypUilGv03NfFWXKz+WRkP/GFeL9JXyLcUcJ85F9 MXjuAupX9a44GRRVja5B7dkPStf+Aq1ZNLoGq3q5ImeZI4FPJIXjitvUsN0YVBjf9Z1NI2 RgIR4imKcr2rZ+/rX3NLJISzxvCaCug= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fUg69Q6qEszR/WHAWAwnkSfcltjIyOVm1DIp4dya8uM=; b=I6xUkz4ToabEbnD4TGTMJ5I4iz49ya5BZg2GGspLCu77K9rPJL8erbwLZJZn/2/m4ivwGY TVAFwwfP0OSenYCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 489E513910; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kCHPEL+LoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:19 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 04/18] drm/i915: Do not set struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:02 +0100 Message-Id: <20221219160516.23436-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080525_715363_87739046 X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generic fbdev drivers use the apertures field in struct fb_info to control ownership of the framebuffer memory and graphics device. Do not set the values in i915. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/i915/display/intel_fbdev.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 03ed4607a46d..bbdb98d7c96e 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -267,23 +267,16 @@ static int intelfb_create(struct drm_fb_helper *helper, info->fbops = &intelfb_ops; - /* setup aperture base/size for vesafb takeover */ obj = intel_fb_obj(&intel_fb->base); if (i915_gem_object_is_lmem(obj)) { struct intel_memory_region *mem = obj->mm.region; - info->apertures->ranges[0].base = mem->io_start; - info->apertures->ranges[0].size = mem->io_size; - /* Use fbdev's framebuffer from lmem for discrete */ info->fix.smem_start = (unsigned long)(mem->io_start + i915_gem_object_get_dma_address(obj, 0)); info->fix.smem_len = obj->base.size; } else { - info->apertures->ranges[0].base = ggtt->gmadr.start; - info->apertures->ranges[0].size = ggtt->mappable_end; - /* Our framebuffer is the entirety of fbdev's system memory */ info->fix.smem_start = (unsigned long)(ggtt->gmadr.start + i915_ggtt_offset(vma)); From patchwork Mon Dec 19 16:05:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81F77C4167B for ; Mon, 19 Dec 2022 17:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LJ36TnzMfaMEroklPpXYztavt4VFPfB7sRYi/nrfWoU=; b=mhc1ikd60Axl9d vNutxdMoOya6zdA3pn4KR7wcZX9+POA+rpGCdfbtgzXNC4dxlYYOJch0lC5THPMNkQqsR19reaaIw 7dTkcHr1dDodTYH7awo3wVjgw1JzWnKwNr/BEtXjsNvTdQj6+c+YtX9dcR/EGXQ7ftGLw/OTyUB4/ OyVq1zcaqEJJcvrKZwOLKfIDLNCZ0y0u1Jb+rqqKccBhsaeiGbA4ncMJV3n5EePlQK5J/81x/xK6H PnKFQR/87CUBTG66UM9qXtD6EPQJ+okr18IGhhBk6gN9ImeZXFDyPQwaPGgrbyuXRjnPcXDo82MCK Z+BlTonAZGmDukMx7S8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7K9N-00GviI-Fg; Mon, 19 Dec 2022 17:42:05 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Ido-00FmvE-8z for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:28 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BB55738147; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B1Bjd03lm0DwMyY2YjMzGZpYf7L4MqyCiluRtjym5FE=; b=D7j3tHH2cs+pxTIOw8M6U1/iCI/E/isj06FzWjsk7C5BJ1I+K8jFZdN8kwPoVqQ/5uF3tc MUhFj/wteKNobnARqKgHM3KiB8NCSlwqkwF5Jp3T94dEEMOPMnMAHUDwxL74d4yUoCpNcV 4uRv07GSFptFMZethEPlmEuffG710aY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465919; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B1Bjd03lm0DwMyY2YjMzGZpYf7L4MqyCiluRtjym5FE=; b=cOqA3MEgffTKTZ2NIMHjKmyvVRJj1E/N9M7Wi+Ws/knLntrtjVJI78p1jfG7stGeCwQlLO PRd3Mq+ZJPnyghCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 83A8C13911; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KBFDH7+LoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:19 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 05/18] drm/radeon: Do not set struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:03 +0100 Message-Id: <20221219160516.23436-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080524_557095_21FEE6C7 X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generic fbdev drivers use the apertures field in struct fb_info to control ownership of the framebuffer memory and graphics device. Do not set the values in radeon. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/radeon/radeon_fb.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index c1710ed1cab8..fe4087bfdb3c 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -277,10 +277,6 @@ static int radeonfb_create(struct drm_fb_helper *helper, drm_fb_helper_fill_info(info, &rfbdev->helper, sizes); - /* setup aperture base/size for vesafb takeover */ - info->apertures->ranges[0].base = rdev->mc.aper_base; - info->apertures->ranges[0].size = rdev->mc.aper_size; - /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ if (info->screen_base == NULL) { From patchwork Mon Dec 19 16:05:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44E16C4332F for ; Mon, 19 Dec 2022 17:41:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sBehlNQ4bHYfdxpT8Jx4g0rrfJj94YtTAWrh29PPKVQ=; b=x8IboZGPAvx0OV QvonN+lQ/2FYL2NZ4BYOy03BLLk64784lWvYAbaEArLpAHNQDGAETViRACq7Zv7MflXwKLpqw9kRL CniknmP21UWN/Nuqk0r+BGTP/V1jebB2AG/Q2rqtJ+JqqNBFZ2v1SRSCnYI//Q9Fmm6obG3TubJ03 GdNk2jg+BcKTF8fvQ3PyXYR4rGQKljjZUZzxuJ1E2rYDpHGNIL4SH/e5IJ8ygAeVw+tUkQN85kKwu HZyAMaTFV2IjdHxWXb0iSKeJIAvu2DDvlCCJsdFlk3PHs0ZdSFUthty1fuArnmfYstPb9ufEbjObB kKXiZUyMgUXCf+LAGfVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7K7G-00GuCf-5L; Mon, 19 Dec 2022 17:39:54 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idn-00FmvR-MY for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:25 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0149F61068; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MkPYodRrthK0KDBelPZoq1tuzpwIojBeCxchBxVgzPA=; b=ro9yZlUCx8QuAlERVeZyPJN9g9OhhaxO5d7ESIL3UsPNdGw0kCGUMtPWMIquXrs5/Zq79Y snMbSHLsZdDUKR3/Yw5wwcbpWOxxWa4CtqtesA/JV3XokIgEgYifcVD3rqy8eVC7PnKaNx hvtF/0cl83XF+s6EmjoBs7VoRyTwGpo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MkPYodRrthK0KDBelPZoq1tuzpwIojBeCxchBxVgzPA=; b=vUSQsDsmtdQiPYQA2ZMfMetE64EB+Un8y/dDtLEtxzGoK5WR+iCn+CoewFEIt08C57Q47e HHuEGJuPHO/LWTDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BEA2713910; Mon, 19 Dec 2022 16:05:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UCusLb+LoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:19 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 06/18] drm/fb-helper: Do not allocate unused apertures structure Date: Mon, 19 Dec 2022 17:05:04 +0100 Message-Id: <20221219160516.23436-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080523_992140_E1C83297 X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The apertures field in struct fb_info is not used by DRM drivers. Do not allocate it. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/drm_fb_helper.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index b3a731b9170a..e8a7e8be91d9 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -473,8 +473,8 @@ EXPORT_SYMBOL(drm_fb_helper_init); * drm_fb_helper_alloc_info - allocate fb_info and some of its members * @fb_helper: driver-allocated fbdev helper * - * A helper to alloc fb_info and the members cmap and apertures. Called - * by the driver within the fb_probe fb_helper callback function. Drivers do not + * A helper to alloc fb_info and the member cmap. Called by the driver + * within the fb_probe fb_helper callback function. Drivers do not * need to release the allocated fb_info structure themselves, this is * automatically done when calling drm_fb_helper_fini(). * @@ -496,27 +496,11 @@ struct fb_info *drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper) if (ret) goto err_release; - /* - * TODO: We really should be smarter here and alloc an aperture - * for each IORESOURCE_MEM resource helper->dev->dev has and also - * init the ranges of the appertures based on the resources. - * Note some drivers currently count on there being only 1 empty - * aperture and fill this themselves, these will need to be dealt - * with somehow when fixing this. - */ - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto err_free_cmap; - } - fb_helper->info = info; info->skip_vt_switch = true; return info; -err_free_cmap: - fb_dealloc_cmap(&info->cmap); err_release: framebuffer_release(info); return ERR_PTR(ret); From patchwork Mon Dec 19 16:05:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076933 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7AADC4332F for ; Mon, 19 Dec 2022 17:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6aDT6zaqfXhTU7HyUExJ+WPa3LsW0TF68aHx6LMgRB4=; b=L5KCmOoRBwioge buQapjlS+4QiGF9OnD00gRhiL5ynCsWIsOt+rnk0ZzmtDIx+0OmvTOO3ieYLNZXFeajFYpS1ny0d2 F8Bsyv0Yi9llRGvIe5yD15TbjAs0A12g1b1WfTA04IH7YEv5yqM4nKDb20ISkbN7ZTjPoJHEkwq2H 36R8uJ+dbMhFF/KOOZx8Zz7deNarjkZ/sRpznmDQapI3xTPpAxqyPLZBGxA133yeNLrjnfOO03q4+ LQHmg/e0l2i0425/Itbid+0MuHet/xIGwQ9hJYENx9WOP6EuewTw8I8RMFzp25l//tGpkMnY5VPU4 7Md7VZvckFX0Sel82o1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7K7l-00GuWX-KI; Mon, 19 Dec 2022 17:40:25 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idn-00Fmvc-Mq for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:28 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3D0B261069; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kw4PCYbRKyTYm5bvhnSq7yK73tS8WkU4oVIsN0XjlAs=; b=XRpD+7A47u27mhj9WIia4vQucs01xOEb7OZFcFYLFJ9+KLVhlOUuXr1Tg2PJLCXczohGR+ zXm+8yvSYixyCtX51jHwKURm8vZOio5HfRT8cd8lM4HAXFVRMwX432qVslkrgFWhOT4EjB e0KX4gzDcSdrUCrWk0AE8wedxLHnZhU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kw4PCYbRKyTYm5bvhnSq7yK73tS8WkU4oVIsN0XjlAs=; b=WN4Coft+2mZbZl0Hz4sAfWdk5nLpNgDT4S3LPKv+Xj+Mt38OALgt+G6TR+6aArpZSLuOtJ dsT5xh7OZtEC8UDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0624A13910; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kH15AMCLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:20 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 07/18] fbdev/clps711x-fb: Do not set struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:05 +0100 Message-Id: <20221219160516.23436-8-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080524_117210_867AEAE5 X-CRM114-Status: GOOD ( 12.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generic fbdev drivers use the apertures field in struct fb_info to control ownership of the framebuffer memory and graphics device. Do not set the values in clps711x-fb. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/clps711x-fb.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c index a1061c2f1640..45c75ff01eca 100644 --- a/drivers/video/fbdev/clps711x-fb.c +++ b/drivers/video/fbdev/clps711x-fb.c @@ -251,16 +251,8 @@ static int clps711x_fb_probe(struct platform_device *pdev) goto out_fb_release; } - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto out_fb_release; - } - cfb->buffsize = resource_size(res); info->fix.smem_start = res->start; - info->apertures->ranges[0].base = info->fix.smem_start; - info->apertures->ranges[0].size = cfb->buffsize; cfb->clk = devm_clk_get(dev, NULL); if (IS_ERR(cfb->clk)) { @@ -345,7 +337,7 @@ static int clps711x_fb_probe(struct platform_device *pdev) &clps711x_lcd_ops); if (!IS_ERR(lcd)) return 0; - + ret = PTR_ERR(lcd); unregister_framebuffer(info); From patchwork Mon Dec 19 16:05:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9143AC10F1B for ; Mon, 19 Dec 2022 17:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bzowEGeGIgdnE8gQ6Wlmi4jmPnBfcjEtTVPxqDFRKm4=; b=4ni03T1CQr4eJO iIUjS5bwJWAFFzLEWZvY3nzEW69B1SGgpBTT4ZdxPnbeq11kEdSlD5miI/VxWrI2MUl8r8POuvFS8 WiTZjHA2MwqgpuOXLgNpvRYy72tSf2BIa0egW7v3quIj/3HsIW5Qxy3nzD5ow74eIb7ZL1qHr8Gfz qmite1PCC8UiQJN8Lqm2FjupLhefkA+eABAxJVunUoLtaNLsXPHQVSpBxW7yj7C6+SBxckF5kw7Yi 5W19hocunmsbQyEBYuCs/1iTGSHYh9xtjHnKKBDssZsC56rx2ukzyoB04TU3syBiA62XP8Qhje5jO J3LWHbh0SlFuJfBIG7HQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KB1-00Gwxr-8G; Mon, 19 Dec 2022 17:43:47 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Ido-00Fmvq-9Z for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:28 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7A57F38148; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y+BusCraEh5B/kjNqlmWH+J56/01IzSqEoXG4u/ApxA=; b=k7jGbHXivI8oaQx7V9IBKJo+DdTFFl41MQn27pb9GsHRNJ74ovh21uVJdx1DBf6AM1AN94 tUvpGhJrqeLTJvrIVht5sLAu5lgKhrihHp3PQF08mHJCtJiLIq764LPsFwt9m1Grq4ptQU Z2SZ8LUremjqHJ6YvZlq3xNvFen8q8M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y+BusCraEh5B/kjNqlmWH+J56/01IzSqEoXG4u/ApxA=; b=y/6SDwejq5Tt4rZOdRLJCx0aYachA6O9xsFjfG0AGO+GH3NwOR3y+4LVALyVGFr4W8+Vb3 MB84pAqpOitWoQBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 415CB13911; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mKASD8CLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:20 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 08/18] fbdev/hyperv-fb: Do not set struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:06 +0100 Message-Id: <20221219160516.23436-9-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080524_582274_1D388FD5 X-CRM114-Status: GOOD ( 13.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generic fbdev drivers use the apertures field in struct fb_info to control ownership of the framebuffer memory and graphics device. Do not set the values in hyperv-fb. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Michael Kelley --- drivers/video/fbdev/hyperv_fb.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index d8edb5635f77..1c7d6ff5a6c0 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -988,13 +988,10 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) struct pci_dev *pdev = NULL; void __iomem *fb_virt; int gen2vm = efi_enabled(EFI_BOOT); + resource_size_t base, size; phys_addr_t paddr; int ret; - info->apertures = alloc_apertures(1); - if (!info->apertures) - return -ENOMEM; - if (!gen2vm) { pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT, PCI_DEVICE_ID_HYPERV_VIDEO, NULL); @@ -1003,8 +1000,8 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) return -ENODEV; } - info->apertures->ranges[0].base = pci_resource_start(pdev, 0); - info->apertures->ranges[0].size = pci_resource_len(pdev, 0); + base = pci_resource_start(pdev, 0); + size = pci_resource_len(pdev, 0); /* * For Gen 1 VM, we can directly use the contiguous memory @@ -1027,8 +1024,8 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) } pr_info("Unable to allocate enough contiguous physical memory on Gen 1 VM. Using MMIO instead.\n"); } else { - info->apertures->ranges[0].base = screen_info.lfb_base; - info->apertures->ranges[0].size = screen_info.lfb_size; + base = screen_info.lfb_base; + size = screen_info.lfb_size; } /* @@ -1070,9 +1067,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) info->screen_size = dio_fb_size; getmem_done: - aperture_remove_conflicting_devices(info->apertures->ranges[0].base, - info->apertures->ranges[0].size, - false, KBUILD_MODNAME); + aperture_remove_conflicting_devices(base, size, false, KBUILD_MODNAME); if (gen2vm) { /* framebuffer is reallocated, clear screen_info to avoid misuse from kexec */ From patchwork Mon Dec 19 16:05:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9557AC4332F for ; Mon, 19 Dec 2022 17:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VtksrOv78yi8b16FkN1C9oX4QAT07DeQSGUXeblmolk=; b=HRacccm6taf+6i NhuOGpPi3Al0sgUoehAjmYu2CcJ9YnfhwJHn5euFsfBxUmP89M+Din0ncXLzmeJe7yvhF54Ro1y8u OxduhE3GMBblNkFt5g9MG2No46l4qcufP0dBG28nvII9CBQv4uuAuTxCoqWkGUjzmQFmdVyCxO6kL aBINXzWlIWRWYeGD9EFKXhQFCbZV4srszQwS1zqU91TkhXVmiX3KyFuGZI+mqMHInouZyAZAiNx3f qkbC732JrexVQHzaVXkaSh+DRT6uclOjbiLru4ulGss8VCdmEw45OG6jmaGi4YtUajSLK5XAJsESI HOU7JxXzkcciT7LDFrWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KFi-00H0Ox-S1; Mon, 19 Dec 2022 17:48:41 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Ids-00Fn0b-Hx for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:33 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B36CB6089B; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lVYvLsFG6f+exAHX9YV2exCISsylgNZMOA5W08XvPSQ=; b=WDWo93d+J2PYNjBpbcWDD3AL8nfm2we1M6PNPvbJFxhIjK1TbLS+wJRRCLoSGIgT7jjL0q 5+iemEoD93yfLjOoycJUnrNs4iF1NUfDrs2VAHOfs9H3zg648rJKWhktVvEmKweAj5YHIM SrHlgeZZTrHu84SnOlEaP7pQr2HGb54= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lVYvLsFG6f+exAHX9YV2exCISsylgNZMOA5W08XvPSQ=; b=+xrS6xZIUrSmCMlgO66EWNJJ3CEPP+VBlznk8HddOxqlBDznZvrjsXBPed+3YaY1zpA5oU H04kQ+iuTDU1GcDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7E2D713910; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OEPfHcCLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:20 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 09/18] vfio-mdev/mdpy-fb: Do not set struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:07 +0100 Message-Id: <20221219160516.23436-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080528_893425_F53E3CCE X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Generic fbdev drivers use the apertures field in struct fb_info to control ownership of the framebuffer memory and graphics device. Do not set the values in mdpy-fb. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- samples/vfio-mdev/mdpy-fb.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c index 9ec93d90e8a5..1de5801cd2e8 100644 --- a/samples/vfio-mdev/mdpy-fb.c +++ b/samples/vfio-mdev/mdpy-fb.c @@ -161,14 +161,6 @@ static int mdpy_fb_probe(struct pci_dev *pdev, goto err_release_fb; } - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto err_unmap; - } - info->apertures->ranges[0].base = info->fix.smem_start; - info->apertures->ranges[0].size = info->fix.smem_len; - info->fbops = &mdpy_fb_ops; info->flags = FBINFO_DEFAULT; info->pseudo_palette = par->palette; From patchwork Mon Dec 19 16:05:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42865C4332F for ; Mon, 19 Dec 2022 17:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e3A9+gXWEx1ECTOUmHXdz5OBYwN0MQTTNoaAU/SwKCY=; b=i4T7uF19EBlxgQ Pt6xO00eetg5eI3VJju3/rI5RubGiCaDyX+NWnwCSZ/jP9pAZjO0HANSIk/wI8JiIKvc5atoggAnP bKjRlPcykk52EqHchkA/JodHc6HSgUB+KuPQbXnSrNnMgzLiRWrOHp+luM90C2Qs5T5QrAMcOlf+k LTa5mVgRVcEBonficd332HnHJYM4GLcHXGnc1uUTGL+v5axM5/+HL3PgOzExMxBtlElGJ1sngnwnr Yciec2vxFDJJw4uCL6AUa1qACthjt2PIcEpf6TDtmfh6WFL0X7bGxqHrLxF2PxKXma2zmINllszy/ pnSv69rMPoRDJvXxm3+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7K9s-00Gw70-7N; Mon, 19 Dec 2022 17:42:36 +0000 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idp-00FmwL-Ac for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:31 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F2E2738149; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=obTd6Vm1en8QYigHEu9RhDcL5tb/CmpPkDgnKAoQ5jE=; b=b4K4FAar1WgYMZX5pfZnzCVcF80GxF/BuZdANPvIPGZthi5DRao3/arOXSSrCzmw+/YfIu DkFh6mfpuAErsioiYMFs06ZKz2+V2DVmkQA/tHWYwslk5m/ZgqIWKw4b6LELWED4hBlVJq 1O/aqwBiAkBpVH844qCWXsHTJU1MG4w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=obTd6Vm1en8QYigHEu9RhDcL5tb/CmpPkDgnKAoQ5jE=; b=472H4JvHPod2/eeTkuU93yA7QE5pwbZ5rhmYSoL7HgEUeRiKO1eB//pWB5b5OYjMvvrDAE xRpEqrP5VJVl4uAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B7D6213911; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SMr4K8CLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:20 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 10/18] fbdev/efifb: Add struct efifb_par for driver data Date: Mon, 19 Dec 2022 17:05:08 +0100 Message-Id: <20221219160516.23436-11-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080525_695048_55BD1D02 X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The efifb_par structure holds the palette for efifb. It will also be useful for storing the device's aperture range. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/efifb.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 16c1aaae9afa..694013f62781 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -49,6 +49,10 @@ static u64 mem_flags = EFI_MEMORY_WC | EFI_MEMORY_UC; static struct pci_dev *efifb_pci_dev; /* dev with BAR covering the efifb */ +struct efifb_par { + u32 pseudo_palette[16]; +}; + static struct fb_var_screeninfo efifb_defined = { .activate = FB_ACTIVATE_NOW, .height = -1, @@ -351,6 +355,7 @@ static u64 bar_offset; static int efifb_probe(struct platform_device *dev) { struct fb_info *info; + struct efifb_par *par; int err, orientation; unsigned int size_vmode; unsigned int size_remap; @@ -447,14 +452,14 @@ static int efifb_probe(struct platform_device *dev) efifb_fix.smem_start); } - info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); + info = framebuffer_alloc(sizeof(*par), &dev->dev); if (!info) { err = -ENOMEM; goto err_release_mem; } platform_set_drvdata(dev, info); - info->pseudo_palette = info->par; - info->par = NULL; + par = info->par; + info->pseudo_palette = par->pseudo_palette; info->apertures = alloc_apertures(1); if (!info->apertures) { From patchwork Mon Dec 19 16:05:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076962 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8C5EC4332F for ; Mon, 19 Dec 2022 18:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iFBDUusDXc+fplB3qgJ27RKh8Z3mgKIjtMliYvKwMZQ=; b=NbWAxGKX2HD/Hg zehMn+qan0FoYySJoZb0f7ehYltIFDCabV8K7EL7GMlFzdzJP0nMHKO4gni4HmUKt8wATt1+7EJDP ecFetAItj02eRyYD8piO4SI/EY8XWmpnd7G3vW9ASaPnL34WzIs/1FNCSm1v53wQBLi4g+CTMnvWw EjSypmndqFU37K5ON+LaqayEJvKu5ph65EyheG09qN7JECBB6F+WZFd012vduKRWf/Sl3V/w8/Vmu KVspN/SWfI3vCSR8e3ReH62sryNW/yrpUV49ycEjTXoFhJblScViUx5e5hp5PeHFpw8ZEqkRPFZSB ZtQm2qfgNuMdYWPITtWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KRV-00H7zr-D0; Mon, 19 Dec 2022 18:00:51 +0000 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idu-00Fn3c-FK for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:37 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 38E023814A; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RqquY0vRF4j2TZClbWT3UuEK0xCY+Dj3YMKH6n7ha14=; b=1oqZO6f7Z/UK84n1HDTBt6BQhym72ZyWuk2ESMExKZbV8MO0N7rtVzJ880pZ0h6s477vjm f9tqz07CfPWKgPKXZ9ychqFwzTUaKY2zhWShDBXxPZ836suqvL/KOpUsA00a2nmsiIu5Ql xeA4F2VVY2hIft7Hu7z5lm10b9phdhM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RqquY0vRF4j2TZClbWT3UuEK0xCY+Dj3YMKH6n7ha14=; b=1ANZjnO6UjrMzIpnHT3KrA22LyztidJt0BlWk2ZQ5LJVf4lyUGmVU4NfBdvaaZnfa8RMRW 0zl4uWZWKK6zEKAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 025F113910; Mon, 19 Dec 2022 16:05:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CCZGO8CLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:20 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 11/18] fbdev/efifb: Do not use struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:09 +0100 Message-Id: <20221219160516.23436-12-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080530_774954_E550DD37 X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Acquire ownership of the firmware scanout buffer by calling Linux' aperture helpers. Remove the use of struct fb_info.apertures and do not set FBINFO_MISC_FIRMWARE; both of which previously configured buffer ownership. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/efifb.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 694013f62781..a5779fb453a2 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -7,6 +7,7 @@ * */ +#include #include #include #include @@ -51,6 +52,8 @@ static struct pci_dev *efifb_pci_dev; /* dev with BAR covering the efifb */ struct efifb_par { u32 pseudo_palette[16]; + resource_size_t base; + resource_size_t size; }; static struct fb_var_screeninfo efifb_defined = { @@ -253,6 +256,8 @@ static inline void efifb_show_boot_graphics(struct fb_info *info) {} */ static void efifb_destroy(struct fb_info *info) { + struct efifb_par *par = info->par; + if (efifb_pci_dev) pm_runtime_put(&efifb_pci_dev->dev); @@ -264,8 +269,7 @@ static void efifb_destroy(struct fb_info *info) } if (request_mem_succeeded) - release_mem_region(info->apertures->ranges[0].base, - info->apertures->ranges[0].size); + release_mem_region(par->base, par->size); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); @@ -461,13 +465,8 @@ static int efifb_probe(struct platform_device *dev) par = info->par; info->pseudo_palette = par->pseudo_palette; - info->apertures = alloc_apertures(1); - if (!info->apertures) { - err = -ENOMEM; - goto err_release_fb; - } - info->apertures->ranges[0].base = efifb_fix.smem_start; - info->apertures->ranges[0].size = size_remap; + par->base = efifb_fix.smem_start; + par->size = size_remap; if (efi_enabled(EFI_MEMMAP) && !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) { @@ -556,7 +555,7 @@ static int efifb_probe(struct platform_device *dev) info->fbops = &efifb_ops; info->var = efifb_defined; info->fix = efifb_fix; - info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE; + info->flags = FBINFO_FLAG_DEFAULT; orientation = drm_get_panel_orientation_quirk(efifb_defined.xres, efifb_defined.yres); @@ -589,6 +588,11 @@ static int efifb_probe(struct platform_device *dev) if (efifb_pci_dev) WARN_ON(pm_runtime_get_sync(&efifb_pci_dev->dev) < 0); + err = devm_aperture_acquire_for_platform_device(dev, par->base, par->size); + if (err) { + pr_err("efifb: cannot acquire aperture\n"); + goto err_put_rpm_ref; + } err = register_framebuffer(info); if (err < 0) { pr_err("efifb: cannot register framebuffer\n"); From patchwork Mon Dec 19 16:05:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3F51C4332F for ; Mon, 19 Dec 2022 17:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RkVPcIbNZBxYAfzOvfpvxgZUEZ0U4ZinduXMTOI/WJ0=; b=FJRwS3D4bLqGgz DN4elnArScinuubJhgn9/5DASPb+I8qEIl4Wip/JfMrod/l00Ib0l51xTCZyikVhC3goVcSmSSzTl 5OpRqX9nljeONKH/Tp/SzETdCS7q9qqUjefVTDbxig+ZYkGCZlrNVipaIvo1OF8kfQwwoX2LdCMyY fy4haaWBi4uOWPV/0DbO1YrtGGA41OIaRsn36adz9dNpqaYjp5rB0yi/csZuE8Uz8HL9alplGH7kM E/kkofbXOXMIq4WDeL60McMzweU1xZ7+uKdCEYw5l1YLYVvXbrhTiETZKPJ22MyWVTVkUBVWUbQW2 /VdgqXWEPjgZAcCs3nGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KCg-00GyDP-9b; Mon, 19 Dec 2022 17:45:31 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idq-00Fn0a-Ve for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:31 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 74E9F6106C; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaoy/wsHmACEkNUPQDwCodxxk7bv39KwEjjtHvnuLPY=; b=zwnnLeVgu/s3egNObkVdpEXh77/XY3MobzVV5GJI1gttTfIxX9W8Q+m9TprcXlLjjw5+zk eYu4mOF+QvFS83FmGpyu69FfHB3eEEm8yYax1itCD+SjBRqew7QTnHV/9t85tFIVD0Q/VT APbe3gfOruEA6qOqZIn72uYlYQfIdv8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaoy/wsHmACEkNUPQDwCodxxk7bv39KwEjjtHvnuLPY=; b=kus+BY2vnPzmJQDjGCUVRzdQvBFM+NEu81vfD1mSWOqYl5qrrmEPyKieCOyRumTRUCMg+9 UvJt4LdI4sHWxXDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3DD7913910; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SH0nDsGLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:21 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 12/18] fbdev/offb: Allocate struct offb_par with framebuffer_alloc() Date: Mon, 19 Dec 2022 17:05:10 +0100 Message-Id: <20221219160516.23436-13-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080527_245199_DED5ADD4 X-CRM114-Status: GOOD ( 12.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move the palette array into struct offb_par and allocate both via framebuffer_alloc(), as intended by fbdev. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/offb.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index 91001990e351..a298adcee2d9 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -53,10 +53,9 @@ struct offb_par { volatile void __iomem *cmap_data; int cmap_type; int blanked; + u32 pseudo_palette[16]; }; -struct offb_par default_par; - #ifdef CONFIG_PPC32 extern boot_infos_t *boot_infos; #endif @@ -393,11 +392,11 @@ static void offb_init_fb(struct platform_device *parent, const char *name, int foreign_endian, struct device_node *dp) { unsigned long res_size = pitch * height; - struct offb_par *par = &default_par; unsigned long res_start = address; struct fb_fix_screeninfo *fix; struct fb_var_screeninfo *var; struct fb_info *info; + struct offb_par *par; if (!request_mem_region(res_start, res_size, "offb")) return; @@ -411,17 +410,15 @@ static void offb_init_fb(struct platform_device *parent, const char *name, return; } - info = framebuffer_alloc(sizeof(u32) * 16, &parent->dev); - + info = framebuffer_alloc(sizeof(*par), &parent->dev); if (!info) { release_mem_region(res_start, res_size); return; } platform_set_drvdata(parent, info); - + par = info->par; fix = &info->fix; var = &info->var; - info->par = par; if (name) { strcpy(fix->id, "OFfb "); @@ -515,7 +512,7 @@ static void offb_init_fb(struct platform_device *parent, const char *name, info->fbops = &offb_ops; info->screen_base = ioremap(address, fix->smem_len); - info->pseudo_palette = (void *) (info + 1); + info->pseudo_palette = par->pseudo_palette; info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE | foreign_endian; fb_alloc_cmap(&info->cmap, 256, 0); From patchwork Mon Dec 19 16:05:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CB20C4332F for ; Mon, 19 Dec 2022 17:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=riMsOD6KM2Q2i439MOOrYAvmPhqEBmIiBQ52vQzvizQ=; b=Q4IWRAErxlDFSe RUbdf/ILeUvU4AHnr4NgM1lRYpfEAImk2G6oJOC+GdyEGlRX2R5yK3Nm4ZX25ee5PNF11Busb7U4K RFHTPiCD2M145UY3p6fbmzE0K5q1LRop3GPvLZP6QZAn51pZMmGy+QNsgX3ZnWXvbfNfs3GZRVwrF QbNAt9utOpd61SzHEJBwBwm77VUBb34e/zGl9WZEbq7Ni05AFD9EwaTVd6Yj5HFugoWz7wNiNyE37 qq/ESKITYORB9EMdZ6CdUPHWWgbZJtKlT7Cip53w1JVVaqy6o8PN3UCg7JdOgyvvC7yAcMZ9x9SwN Q6dE55R237alWQoZiDmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KEq-00Gzpc-Vl; Mon, 19 Dec 2022 17:47:45 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Ids-00Fn1E-GO for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:33 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id ADBD86106D; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I2jMhvkkO9mLB5vKRkLVLy8CI9SvsP5N5f5b7as6/CU=; b=jlpOqVgx0JWpTTagkVpW0ycTf7HMO7BrUqOyZsmYdexIVlgyax/4nsXQ1e5aeNnK8JEgso Pyx/hzHSa8UEUO71MJtxg+IZuyN2EUVVYXXUoOZyRrJeKVx9RvNrXToFeGkKWDOC6L1D8Z fTUh3hZdQ8cKVdwNPhEdHXlhpcX90D4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I2jMhvkkO9mLB5vKRkLVLy8CI9SvsP5N5f5b7as6/CU=; b=Wm9K/NTKX3LnQnA38r1Gk4tbb2AN+sCRv18AFj9TkilcgUWn68U33ad4UIIbSy2ix+gjvy cyGTCUDg0bWPbuDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 77E5B13911; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QAxqHMGLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:21 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 13/18] fbdev/offb: Do not use struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:11 +0100 Message-Id: <20221219160516.23436-14-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080528_814890_006A8504 X-CRM114-Status: GOOD ( 14.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Acquire ownership of the firmware scanout buffer by calling Linux' aperture helpers. Remove the use of struct fb_info.apertures and do not set FBINFO_MISC_FIRMWARE; both of which previously configured buffer ownership. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/offb.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index a298adcee2d9..f7ad6bc9d02d 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -12,6 +12,7 @@ * more details. */ +#include #include #include #include @@ -54,6 +55,8 @@ struct offb_par { int cmap_type; int blanked; u32 pseudo_palette[16]; + resource_size_t base; + resource_size_t size; }; #ifdef CONFIG_PPC32 @@ -279,9 +282,11 @@ static int offb_set_par(struct fb_info *info) static void offb_destroy(struct fb_info *info) { + struct offb_par *par = info->par; + if (info->screen_base) iounmap(info->screen_base); - release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); + release_mem_region(par->base, par->size); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); } @@ -503,20 +508,18 @@ static void offb_init_fb(struct platform_device *parent, const char *name, var->sync = 0; var->vmode = FB_VMODE_NONINTERLACED; - /* set offb aperture size for generic probing */ - info->apertures = alloc_apertures(1); - if (!info->apertures) - goto out_aper; - info->apertures->ranges[0].base = address; - info->apertures->ranges[0].size = fix->smem_len; + par->base = address; + par->size = fix->smem_len; info->fbops = &offb_ops; info->screen_base = ioremap(address, fix->smem_len); info->pseudo_palette = par->pseudo_palette; - info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE | foreign_endian; + info->flags = FBINFO_DEFAULT | foreign_endian; fb_alloc_cmap(&info->cmap, 256, 0); + if (devm_aperture_acquire_for_platform_device(parent, par->base, par->size) < 0) + goto out_err; if (register_framebuffer(info) < 0) goto out_err; @@ -526,7 +529,6 @@ static void offb_init_fb(struct platform_device *parent, const char *name, out_err: fb_dealloc_cmap(&info->cmap); iounmap(info->screen_base); -out_aper: iounmap(par->cmap_adr); par->cmap_adr = NULL; framebuffer_release(info); From patchwork Mon Dec 19 16:05:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 429FEC4332F for ; Mon, 19 Dec 2022 17:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2VLItqQf2y6jYVGeXF/4rarW715ZVA6w1ArfZnDR1w0=; b=p1FMji5TVDp1Ll +OFg27ulzI1rqtYvEKYUBsx8xiYbFy9BOubdMXONiOKPTaJDq/+aoHahAx05iTyAzkQVOzQ0lElsd pelw+l2mYxPIuZGDnl4PZHQIBowHCUInJDx/BTpeVDsrpT1WNLv3hOAVrkj9U/0Tymb90T6SuNkE4 pAUqSTPaPFIcrjmcSzsJrVYBxKTfjhcl1Yhlqo1vYoTF95kiryxtT25JVN6l94Hv8udZS0XJOSeZ+ ZJ58a7xWN0F07vXronX0CWOxR95g01CX7tXIEx/3Y+Sqm4rFvjhQg8EbHtbY740fQCqL1pg7KbXql RAAbhbEZobr3flMq1Rqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KI6-00H1rq-EA; Mon, 19 Dec 2022 17:51:09 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Ids-00Fn1D-Hv for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:34 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E58076106A; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7AvP4+yrQ3bqo6F1yy3Vq9Bwx8SPA/+CqvfnX9hA8B0=; b=M/XBwN5UhKeDbKvr5oX4umQ0oHUhZterr0ZR0WuuMHRxAqyUbyaPouEQ3nNOpM6lIFsBkV xL3V8ZvSN6VD+r9nr+QWea8Bkvg88x0UV6Q6hRMeAIfDGTnV1Xx1vrBRSSvdGzVg2Rb2IW uTRijUmIYmENMgW2/6TSCqV9MpTs8KA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465921; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7AvP4+yrQ3bqo6F1yy3Vq9Bwx8SPA/+CqvfnX9hA8B0=; b=lHANT5l5RGXad1u1esQPLu8UjEwNWcGQmLkf4YhEjPM4ut4rAQKRoR5hVPdV18HkxRP1yH 9erCkjmEUHp9YiAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B0B7113910; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eDMHKsGLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:21 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 14/18] fbdev/simplefb: Do not use struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:12 +0100 Message-Id: <20221219160516.23436-15-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080528_913847_A4A1CC86 X-CRM114-Status: GOOD ( 14.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Acquire ownership of the firmware scanout buffer by calling Linux' aperture helpers. Remove the use of struct fb_info.apertures and do not set FBINFO_MISC_FIRMWARE; both of which previously configured buffer ownership. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/simplefb.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index e770b4a356b5..10d71879d340 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -12,6 +12,7 @@ * Copyright (C) 1996 Paul Mackerras */ +#include #include #include #include @@ -68,6 +69,8 @@ static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, struct simplefb_par { u32 palette[PSEUDO_PALETTE_SIZE]; + resource_size_t base; + resource_size_t size; struct resource *mem; #if defined CONFIG_OF && defined CONFIG_COMMON_CLK bool clks_enabled; @@ -472,16 +475,11 @@ static int simplefb_probe(struct platform_device *pdev) info->var.blue = params.format->blue; info->var.transp = params.format->transp; - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto error_fb_release; - } - info->apertures->ranges[0].base = info->fix.smem_start; - info->apertures->ranges[0].size = info->fix.smem_len; + par->base = info->fix.smem_start; + par->size = info->fix.smem_len; info->fbops = &simplefb_ops; - info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE; + info->flags = FBINFO_DEFAULT; info->screen_base = ioremap_wc(info->fix.smem_start, info->fix.smem_len); if (!info->screen_base) { @@ -511,6 +509,11 @@ static int simplefb_probe(struct platform_device *pdev) if (mem != res) par->mem = mem; /* release in clean-up handler */ + ret = devm_aperture_acquire_for_platform_device(pdev, par->base, par->size); + if (ret) { + dev_err(&pdev->dev, "Unable to acquire aperture: %d\n", ret); + goto error_regulators; + } ret = register_framebuffer(info); if (ret < 0) { dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret); From patchwork Mon Dec 19 16:05:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF6D1C4332F for ; Mon, 19 Dec 2022 17:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KOADcbymhV8VhH1A9SLnd4JCK9pD7wjS2RRGDzaY2ME=; b=MCru8h7np5Itpw vK3l6MEL8vzqOL/Y/KBZ0evOJYknBBoX8mSsYMbX+u7ubaisjCt9EF5yGy7ZxtHqQwdu2J1+qlx7n Et9O5nLrefi8CgqV/AIHI5q6NXGMxHGem0rz4JEjxOtEC+V/UpPIfBI2EfvvXcpoeqYc9b0BbRB0q Mj7Ufz0/QFQDdFAAmDWWEk0h/HicvoUU1V66G12mGsmxS8Pjc6dmWZBJcxchroDN4VgOIODOHf7M3 KFDsHqbCvWEkLIzq7X7RzL/3AZWDOGw2erMQd4Lkv1wDM7PRjq0PjtrR3YUSP6CqcVqluPURFpoAk 1yQO30Ns5cDZNCGRxq7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KHJ-00H1SC-Uv; Mon, 19 Dec 2022 17:50:19 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idt-00Fn3a-WF for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:34 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 27ADF6106E; Mon, 19 Dec 2022 16:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hk5EKSUL389KsnsC/G3K1wHJayEh/SOXo4ItcALV1Ag=; b=QmXXYlFXdG0dSdHbUVlQ1pBn85w1xRlIeCKDPeIEgqjXvs9YOQpLfBrcpQai8KNTcUgWWE PhIZo4ftOUK/WV/kScRCmMUM/wzhlqRxZSS0oh9/O6QLc4EoED4y2IwV5NvvdrWTzneA+p zWJeSck1MA+ahx+UzXdP+LnA8VopBMg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hk5EKSUL389KsnsC/G3K1wHJayEh/SOXo4ItcALV1Ag=; b=mqL6Vjk4YynhjeMTYPsc0SkyQ4Rtk3Ol/IUTDWJgY23ZYs3AxewUZ0B4rQn6Omkf8Dyedl Ch6EJrXpKWzqEsBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E89FB13911; Mon, 19 Dec 2022 16:05:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MDD0N8GLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:21 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 15/18] fbdev/vesafb: Remove trailing whitespaces Date: Mon, 19 Dec 2022 17:05:13 +0100 Message-Id: <20221219160516.23436-16-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080530_403460_56E17B11 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/vesafb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c index 929d4775cb4b..47ce244e4bb8 100644 --- a/drivers/video/fbdev/vesafb.c +++ b/drivers/video/fbdev/vesafb.c @@ -140,7 +140,7 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green, * (according to the entries in the `var' structure). Return * != 0 for invalid regno. */ - + if (regno >= info->cmap.len) return 1; @@ -209,13 +209,13 @@ static struct fb_ops vesafb_ops = { static int vesafb_setup(char *options) { char *this_opt; - + if (!options || !*options) return 0; - + while ((this_opt = strsep(&options, ",")) != NULL) { if (!*this_opt) continue; - + if (! strcmp(this_opt, "inverse")) inverse=1; else if (! strcmp(this_opt, "redraw")) @@ -381,7 +381,7 @@ static int vesafb_probe(struct platform_device *dev) vesafb_defined.pixclock = 10000000 / vesafb_defined.xres * 1000 / vesafb_defined.yres; vesafb_defined.left_margin = (vesafb_defined.xres / 8) & 0xf8; vesafb_defined.hsync_len = (vesafb_defined.xres / 8) & 0xf8; - + vesafb_defined.red.offset = screen_info.red_pos; vesafb_defined.red.length = screen_info.red_size; vesafb_defined.green.offset = screen_info.green_pos; From patchwork Mon Dec 19 16:05:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7A64C4332F for ; Mon, 19 Dec 2022 17:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=prFTdbijP5p+41SyRTUPrzxRBpDf1a7iHW2QXs2/mF0=; b=sJSDNJFce72CnH kdNR2yM3Apm8gzX2BjNxfKuAwudTG3AYUcbdSl+XKhXwKlWictEui6LC2CW99fhp+/YEDPgzjWFOl X3vfR5OG66n5nv0/4Y8CkjxMmW+usyVIzKN2Nfv62j9rLlgwy5bkJBWf26gnLPwWIjIyT0wCK4ncE 5jmEKcewjTCbIXrkyQn7V2O7Q1nGYxWSdorglvFz1Mf7pd9K0rjvqlJeHvXplECg+OyHqCg1fDqdM cqgqd4hZlVKXaeALAaxuspJbgRy5Dk9c2C3LNxzPrSIm4e7R/jMkIZD5BpWFadSiRPHABLLzA0hcr hdaJaT2qkKCpPoYRTT4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KOx-00H6IU-7A; Mon, 19 Dec 2022 17:58:13 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idu-00Fn3Z-9F for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:36 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 62A4D6106B; Mon, 19 Dec 2022 16:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TA3a5UCvu+T6cGVUv2fP+uAA75vjFZc4XwLIqHS7zss=; b=FNwQicw5ASnAz1j2lbGQUHsL358NMsllfeHdZm5DLNhxsOLY9lu9Stw1PHBh0VJEbxCH1Q nxik6kB49QPVBopQkOiTnZRRAtP+zVFL95RKZjlqvpGDbpGdOYoMCMzR8ySAhy14H0L4Ee /J0OXjgcfHGKJYvXOvi43e3h8hTsqbQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TA3a5UCvu+T6cGVUv2fP+uAA75vjFZc4XwLIqHS7zss=; b=2GyFGQ6UIYjZ/0fswPwJCnbqyO1wiWiMMEIGx6DNWI5pWAT1nZ+lopSVkSzPsJF0sPeBYi 5hx2jNvDMjFsEyDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2BD7913910; Mon, 19 Dec 2022 16:05:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sJrdCcKLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:22 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 16/18] fbdev/vesafb: Do not use struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:14 +0100 Message-Id: <20221219160516.23436-17-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080530_633255_0C060799 X-CRM114-Status: GOOD ( 15.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Acquire ownership of the firmware scanout buffer by calling Linux' aperture helpers. Remove the use of struct fb_info.apertures and do not set FBINFO_MISC_FIRMWARE; both of which previously configured buffer ownership. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/vesafb.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c index 47ce244e4bb8..3f8bdfcf51f0 100644 --- a/drivers/video/fbdev/vesafb.c +++ b/drivers/video/fbdev/vesafb.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include @@ -31,6 +32,8 @@ struct vesafb_par { u32 pseudo_palette[256]; + resource_size_t base; + resource_size_t size; int wc_cookie; struct resource *region; }; @@ -191,7 +194,7 @@ static void vesafb_destroy(struct fb_info *info) arch_phys_wc_del(par->wc_cookie); if (info->screen_base) iounmap(info->screen_base); - release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); + release_mem_region(par->base, par->size); framebuffer_release(info); } @@ -316,14 +319,8 @@ static int vesafb_probe(struct platform_device *dev) par = info->par; info->pseudo_palette = par->pseudo_palette; - /* set vesafb aperture size for generic probing */ - info->apertures = alloc_apertures(1); - if (!info->apertures) { - err = -ENOMEM; - goto err; - } - info->apertures->ranges[0].base = screen_info.lfb_base; - info->apertures->ranges[0].size = size_total; + par->base = screen_info.lfb_base; + par->size = size_total; printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n", vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, vesafb_fix.line_length, screen_info.pages); @@ -460,27 +457,29 @@ static int vesafb_probe(struct platform_device *dev) info->fbops = &vesafb_ops; info->var = vesafb_defined; info->fix = vesafb_fix; - info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE | - (ypan ? FBINFO_HWACCEL_YPAN : 0); + info->flags = FBINFO_FLAG_DEFAULT | (ypan ? FBINFO_HWACCEL_YPAN : 0); if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { err = -ENOMEM; goto err_release_region; } + err = devm_aperture_acquire_for_platform_device(dev, par->base, par->size); + if (err) + goto err_fb_dealloc_cmap; if (register_framebuffer(info)<0) { err = -EINVAL; - fb_dealloc_cmap(&info->cmap); - goto err_release_region; + goto err_fb_dealloc_cmap; } fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; +err_fb_dealloc_cmap: + fb_dealloc_cmap(&info->cmap); err_release_region: arch_phys_wc_del(par->wc_cookie); if (info->screen_base) iounmap(info->screen_base); if (par->region) release_region(0x3c0, 32); -err: framebuffer_release(info); release_mem_region(vesafb_fix.smem_start, size_total); return err; From patchwork Mon Dec 19 16:05:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13A7BC4332F for ; Mon, 19 Dec 2022 17:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LbsLj5jgbSqh+AWgRGrS1LwDgcLnyeBmC8SOHfrnaOo=; b=VA+7IGp4IB/MO/ ixdFA4aFBgQwhlMIX2yy0DMIXEGOWcH5YNVEerzwqo6XlcC5UCqUeKljx/7GY5ZGULndzsq1Xc7/D FLyu3q9R085jjD7cIHuPOpzu25njAWFvWVlldmGV/CWwzrjLiJoKirdjA65dfY4XAuGSE3e2R+Swq RXKnyLJsyxL9T18RjwxtP3c0drVsBXA5nWhusI1MYD7ucXKKNxCho7+OaV9n4MaeTnWTwyF1oCYYh 0nrvUJjGjacloO0gkqxA3S1dN8+0ECbXx+5GUCkDDzc9CpTzO2PK40rF+m/jStoAbsb1mb6IHhz09 ufFtgE406kuGsYPLR19Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KMK-00H4bc-J2; Mon, 19 Dec 2022 17:55:29 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idu-00Fn3d-DD for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:37 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9A86561070; Mon, 19 Dec 2022 16:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tODQtTMeTfmKegWRuyf0irbV/Qbn+oauEz8jBZiC7ks=; b=XpXjQRx/afBB9uzeaqHmLbQZsK0h0uK8PfVRDOwPtHMSnlzEzAXsh8+2aZmFXzLlZgRfi4 LkiEm+eKrL7VSjXepbfTzWk7RikH1cmcfbSyzYQZpoRgH1lOK2D4DDdsbQEC7FAqf8FOXi WlKFj+y5xs6yqC43EiAaoWjsF3G2iFc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tODQtTMeTfmKegWRuyf0irbV/Qbn+oauEz8jBZiC7ks=; b=w/EFAXWRWb+AjGEDlRJ7PJ13k1pIXyqXpAJi+uiD2/Eat9uBrrFWupWfUTlsKR17J2ZpVR UNulA9cvw7oIpjBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 65D0313911; Mon, 19 Dec 2022 16:05:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oAgDGMKLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:22 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 17/18] fbdev/vga16fb: Do not use struct fb_info.apertures Date: Mon, 19 Dec 2022 17:05:15 +0100 Message-Id: <20221219160516.23436-18-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080530_845613_CD151F09 X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Acquire ownership of the firmware scanout buffer by calling Linux' aperture helpers. Remove the use of struct fb_info.apertures and do not set FBINFO_MISC_FIRMWARE; both of which previously configured buffer ownership. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/vga16fb.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c index af47f8217095..1a8ffdb2be26 100644 --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -10,6 +10,7 @@ * archive for more details. */ +#include #include #include #include @@ -1324,11 +1325,6 @@ static int vga16fb_probe(struct platform_device *dev) ret = -ENOMEM; goto err_fb_alloc; } - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto err_ioremap; - } /* XXX share VGA_FB_PHYS_BASE and I/O region with vgacon and others */ info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS_BASE, 0); @@ -1363,8 +1359,7 @@ static int vga16fb_probe(struct platform_device *dev) info->fix = vga16fb_fix; /* supports rectangles with widths of multiples of 8 */ info->pixmap.blit_x = 1 << 7 | 1 << 15 | 1 << 23 | 1 << 31; - info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE | - FBINFO_HWACCEL_YPAN; + info->flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_YPAN; i = (info->var.bits_per_pixel == 8) ? 256 : 16; ret = fb_alloc_cmap(&info->cmap, i, 0); @@ -1382,9 +1377,9 @@ static int vga16fb_probe(struct platform_device *dev) vga16fb_update_fix(info); - info->apertures->ranges[0].base = VGA_FB_PHYS_BASE; - info->apertures->ranges[0].size = VGA_FB_PHYS_SIZE; - + ret = devm_aperture_acquire_for_platform_device(dev, VGA_FB_PHYS_BASE, VGA_FB_PHYS_SIZE); + if (ret) + goto err_check_var; if (register_framebuffer(info) < 0) { printk(KERN_ERR "vga16fb: unable to register framebuffer\n"); ret = -EINVAL; From patchwork Mon Dec 19 16:05:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13076948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A94BAC4332F for ; Mon, 19 Dec 2022 17:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dzrod1H64O1gowMCKAJUyJFriMNdupx3RAq1WSMrHBc=; b=U0ZJTIxqK2ec5w uofnDIDJgYmb+ID+H25ol2xP+Nbxo/iEAagXEAy/RDpS3ghKO0IJzO17PcUyCSvP+Rhgg5DCusVca NsJl3dMYWvlFKLz9pouxD8XKjFkO1wjVdI3NIkmLv09/4M0rOuaow68PwcSEJlMasy4LC2WKEac/N /FjFHafOYj7Zw9ULf+etra8e5oBfAm2gusIMfHtr4nS83i3OKo24tJ6SaZmV0UrETXXp+HWvPW3qY bvqMR1EhqXyf9JdxqkBHO7P9gkdBJs/yD0Ag7ZbTCpj+OcvP5yNG9x2XuJof1BeDWJ4mnuKVJAa2D CPnuHwVxgxJfADoZVg+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7KJV-00H2dS-Bk; Mon, 19 Dec 2022 17:52:36 +0000 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Idu-00Fn3b-0N for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 16:05:36 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D43293814D; Mon, 19 Dec 2022 16:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t7h0EXkUAVrRAP/PStW6XTr3++6xPsY6KDln6r0Rw7E=; b=u7ZYAWmY4Z+/LC6wlTezBTokc/XIEsHEjQ0W0RANZpeMnaZT6GB8YMAcYXr0BPDL7bvS4k s22o5XlBct47Iv4s8tcy2yfhv3zHzbqhQoxxkCRodTHaJfHYgYRtIbCq0z7lgLgd9RnnBc /a8jRAX7O8tgFDgmnQc2P2eBtggVyXg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671465922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t7h0EXkUAVrRAP/PStW6XTr3++6xPsY6KDln6r0Rw7E=; b=BJX4LNDRHzlZuDQdhKAJdNuaEUMNlnC8x6UTj+YQKrfJXdrFTqCnUrzFA23uDEl5GEt0la 5U6oHMHbA4uvxZAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9E74313910; Mon, 19 Dec 2022 16:05:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id cAPGJcKLoGPeZwAAMHmgww (envelope-from ); Mon, 19 Dec 2022 16:05:22 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, deller@gmx.de, javierm@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 18/18] drm/fbdev: Remove aperture handling and FBINFO_MISC_FIRMWARE Date: Mon, 19 Dec 2022 17:05:16 +0100 Message-Id: <20221219160516.23436-19-tzimmermann@suse.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221219160516.23436-1-tzimmermann@suse.de> References: <20221219160516.23436-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_080530_324231_F2BFF3B9 X-CRM114-Status: GOOD ( 16.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are no users left of struct fb_info.apertures and the flag FBINFO_MISC_FIRMWARE. Remove both and the aperture-ownership code in the fbdev core. All code for aperture ownership is now located in the fbdev drivers. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/core/fbmem.c | 33 ------------------------------ drivers/video/fbdev/core/fbsysfs.c | 1 - include/linux/fb.h | 22 -------------------- 3 files changed, 56 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 3a6c8458eb8d..02217c33d152 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -13,7 +13,6 @@ #include -#include #include #include #include @@ -1653,32 +1652,6 @@ static void do_unregister_framebuffer(struct fb_info *fb_info) put_fb_info(fb_info); } -static int fb_aperture_acquire_for_platform_device(struct fb_info *fb_info) -{ - struct apertures_struct *ap = fb_info->apertures; - struct device *dev = fb_info->device; - struct platform_device *pdev; - unsigned int i; - int ret; - - if (!ap) - return 0; - - if (!dev_is_platform(dev)) - return 0; - - pdev = to_platform_device(dev); - - for (ret = 0, i = 0; i < ap->count; ++i) { - ret = devm_aperture_acquire_for_platform_device(pdev, ap->ranges[i].base, - ap->ranges[i].size); - if (ret) - break; - } - - return ret; -} - /** * register_framebuffer - registers a frame buffer device * @fb_info: frame buffer info structure @@ -1693,12 +1666,6 @@ register_framebuffer(struct fb_info *fb_info) { int ret; - if (fb_info->flags & FBINFO_MISC_FIRMWARE) { - ret = fb_aperture_acquire_for_platform_device(fb_info); - if (ret) - return ret; - } - mutex_lock(®istration_lock); ret = do_register_framebuffer(fb_info); mutex_unlock(®istration_lock); diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c index 4d7f63892dcc..0c33c4adcd79 100644 --- a/drivers/video/fbdev/core/fbsysfs.c +++ b/drivers/video/fbdev/core/fbsysfs.c @@ -88,7 +88,6 @@ void framebuffer_release(struct fb_info *info) mutex_destroy(&info->bl_curve_mutex); #endif - kfree(info->apertures); kfree(info); } EXPORT_SYMBOL(framebuffer_release); diff --git a/include/linux/fb.h b/include/linux/fb.h index 96b96323e9cb..30183fd259ae 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -423,8 +423,6 @@ struct fb_tile_ops { */ #define FBINFO_MISC_ALWAYS_SETPAR 0x40000 -/* where the fb is a firmware driver, and can be replaced with a proper one */ -#define FBINFO_MISC_FIRMWARE 0x80000 /* * Host and GPU endianness differ. */ @@ -499,30 +497,10 @@ struct fb_info { void *fbcon_par; /* fbcon use-only private area */ /* From here on everything is device dependent */ void *par; - /* we need the PCI or similar aperture base/size not - smem_start/size as smem_start may just be an object - allocated inside the aperture so may not actually overlap */ - struct apertures_struct { - unsigned int count; - struct aperture { - resource_size_t base; - resource_size_t size; - } ranges[0]; - } *apertures; bool skip_vt_switch; /* no VT switch on suspend/resume required */ }; -static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { - struct apertures_struct *a; - - a = kzalloc(struct_size(a, ranges, max_num), GFP_KERNEL); - if (!a) - return NULL; - a->count = max_num; - return a; -} - #define FBINFO_FLAG_DEFAULT FBINFO_DEFAULT /* This will go away