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);