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