From patchwork Wed Feb 7 13:47:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 771054 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D466977F23 for ; Wed, 7 Feb 2024 13:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707313782; cv=none; b=ryNavYUGQsQelcFDREnH2OtNLzC7GPlyN58e8r/N7LXvFsCfqf8vAZa5rP7QMNDhEHhjeF7h401qGlqtnMd6PZM8cmC3AG2Lns9R4EgXfAosM5N9u9UeBcZ1+ajs+xkKSOqhq0HPpZBfi4xZuyOZfIS4QfluLxU5rNcjAw/bAg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707313782; c=relaxed/simple; bh=Aq7rHZDXrNzFCFawuZKxq2ZLrmcpCprahXFUyK8W/fA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bKeg163bopICQ9YC8Oh1ZhQh7kpxgUdhYh6TE0doYOm3PGvCZcZnmdzK5OwCY9w9OLANGYdhGU2xiyUurGDHiuwE001Rpo38Q21ThvnqOeMO2XgYLFZA4/9030kFuIL4BgTjirPfNA90lsQAIOivecTv/Wpc6ULl4RQSQRmSeE8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=zV6RQpW3; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Z9jG/9eF; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=zV6RQpW3; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Z9jG/9eF; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="zV6RQpW3"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Z9jG/9eF"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="zV6RQpW3"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Z9jG/9eF" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CBDA422305; Wed, 7 Feb 2024 13:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707313777; 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=l7/m6ngH/9vR7GU3dOozu7ziOJrbdZSSV92eIclE80M=; b=zV6RQpW3bKTOS2uqTULwl9TSW9yvpF9M9zEuQOIeJUD95IzdCqGK4Y7A+QWI1/P6DzkvZW qbK1OdzU5y3/j3n9XeHLg/gay4ACx7ajikyAB7SptNLQHp3/d+T0obqbD3rJ6Q9lkSabn6 XVtspSFwHTkf1eOZDqXqFtnlHi3H6RA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707313777; 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=l7/m6ngH/9vR7GU3dOozu7ziOJrbdZSSV92eIclE80M=; b=Z9jG/9eF86O+xymlhlBRWA1t2cXILrJ6pvphGXtZnktaT1bjk+1hZszBisOtJfrARUK7CF pQyI08KzBxQKlnAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707313777; 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=l7/m6ngH/9vR7GU3dOozu7ziOJrbdZSSV92eIclE80M=; b=zV6RQpW3bKTOS2uqTULwl9TSW9yvpF9M9zEuQOIeJUD95IzdCqGK4Y7A+QWI1/P6DzkvZW qbK1OdzU5y3/j3n9XeHLg/gay4ACx7ajikyAB7SptNLQHp3/d+T0obqbD3rJ6Q9lkSabn6 XVtspSFwHTkf1eOZDqXqFtnlHi3H6RA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707313777; 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=l7/m6ngH/9vR7GU3dOozu7ziOJrbdZSSV92eIclE80M=; b=Z9jG/9eF86O+xymlhlBRWA1t2cXILrJ6pvphGXtZnktaT1bjk+1hZszBisOtJfrARUK7CF pQyI08KzBxQKlnAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 870A2139B9; Wed, 7 Feb 2024 13:49:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id aL1qH3GKw2V7IQAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 13:49:37 +0000 From: Thomas Zimmermann To: javierm@redhat.com, sui.jingfeng@linux.dev, pjones@redhat.com, deller@gmx.de, ardb@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v3 8/8] fbdev/efifb: Remove framebuffer relocation tracking Date: Wed, 7 Feb 2024 14:47:17 +0100 Message-ID: <20240207134932.7321-9-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240207134932.7321-1-tzimmermann@suse.de> References: <20240207134932.7321-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; FREEMAIL_ENVRCPT(0.00)[gmx.de]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RL4936hw7dbgk3hb39jfn1xy19)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[8]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FREEMAIL_TO(0.00)[redhat.com,linux.dev,gmx.de,kernel.org]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[26.53%] X-Spam-Flag: NO If the firmware framebuffer has been reloacted, the sysfb code fixes the screen_info state before it creates the framebuffer's platform device. Efifb will automatically receive a screen_info with updated values. Hence remove the tracking from efifb. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Sui Jingfeng --- drivers/video/fbdev/efifb.c | 76 +------------------------------------ 1 file changed, 1 insertion(+), 75 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index f76b7ae007518..8dd82afb3452b 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -47,8 +46,6 @@ static bool use_bgrt = true; static bool request_mem_succeeded = false; 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]; resource_size_t base; @@ -348,9 +345,6 @@ static struct attribute *efifb_attrs[] = { }; ATTRIBUTE_GROUPS(efifb); -static struct resource *bar_resource; -static u64 bar_offset; - static int efifb_probe(struct platform_device *dev) { struct screen_info *si; @@ -411,21 +405,7 @@ static int efifb_probe(struct platform_device *dev) si->rsvd_pos = 24; } - efifb_fix.smem_start = si->lfb_base; - - if (si->capabilities & VIDEO_CAPABILITY_64BIT_BASE) { - u64 ext_lfb_base; - - ext_lfb_base = (u64)(unsigned long)si->ext_lfb_base << 32; - efifb_fix.smem_start |= ext_lfb_base; - } - - if (bar_resource && - bar_resource->start + bar_offset != efifb_fix.smem_start) { - dev_info(&efifb_pci_dev->dev, - "BAR has moved, updating efifb address\n"); - efifb_fix.smem_start = bar_resource->start + bar_offset; - } + efifb_fix.smem_start = __screen_info_lfb_base(si); efifb_defined.bits_per_pixel = si->lfb_depth; efifb_defined.xres = si->lfb_width; @@ -640,57 +620,3 @@ static struct platform_driver efifb_driver = { }; builtin_platform_driver(efifb_driver); - -#if defined(CONFIG_PCI) - -static void record_efifb_bar_resource(struct pci_dev *dev, int idx, u64 offset) -{ - u16 word; - - efifb_pci_dev = dev; - - pci_read_config_word(dev, PCI_COMMAND, &word); - if (!(word & PCI_COMMAND_MEMORY)) { - dev_err(&dev->dev, - "BAR %d: assigned to efifb but device is disabled!\n", - idx); - return; - } - - bar_resource = &dev->resource[idx]; - bar_offset = offset; - - dev_info(&dev->dev, "BAR %d: assigned to efifb\n", idx); -} - -static void efifb_fixup_resources(struct pci_dev *dev) -{ - u64 base = screen_info.lfb_base; - u64 size = screen_info.lfb_size; - int i; - - if (efifb_pci_dev || screen_info.orig_video_isVGA != VIDEO_TYPE_EFI) - return; - - if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE) - base |= (u64)screen_info.ext_lfb_base << 32; - - if (!base) - return; - - for (i = 0; i < PCI_STD_NUM_BARS; i++) { - struct resource *res = &dev->resource[i]; - - if (!(res->flags & IORESOURCE_MEM)) - continue; - - if (res->start <= base && res->end >= base + size - 1) { - record_efifb_bar_resource(dev, i, base - res->start); - break; - } - } -} -DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY, - 16, efifb_fixup_resources); - -#endif