From patchwork Fri Apr 28 12:24:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 678084 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97D13C77B7F for ; Fri, 28 Apr 2023 12:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230248AbjD1MZC (ORCPT ); Fri, 28 Apr 2023 08:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346096AbjD1MZA (ORCPT ); Fri, 28 Apr 2023 08:25:00 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F13B270A for ; Fri, 28 Apr 2023 05:24:59 -0700 (PDT) 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 41B272008B; Fri, 28 Apr 2023 12:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682684698; 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=Ht2sX/GgfWs/nLE3JvKaUqmOG3/3TmdFw8dueDM8Hyc=; b=TAKv5qSp9/GmhrVKLPwYqQhLsWHAe5V6WkSHmmSRfsKeX8FfeEzrV/wAYoDCs1cfnmD+zE Hs0CZERgw60eTcw6AQdDN4CXRVBhkBgx5RThuUJuaEt5AUhu5Jx96EXPYgavjscSA1SU7g RE1+W4xub8K/X6DVKEh4Ru/C845FoBU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682684698; 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=Ht2sX/GgfWs/nLE3JvKaUqmOG3/3TmdFw8dueDM8Hyc=; b=Cdlu4icMhk+04e5s3NexwbdTkGcKc1EjTfBK/4DVHTnNX/J4Bk48S4POwC8vWLtCVyZVCr r6hgYKWDETrRyhDg== 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 07EA7139C3; Fri, 28 Apr 2023 12:24:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YP7NABq7S2RgeAAAMHmgww (envelope-from ); Fri, 28 Apr 2023 12:24:58 +0000 From: Thomas Zimmermann To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@gmail.com, daniel@ffwll.ch, javierm@redhat.com, deller@gmx.de, geert@linux-m68k.org, sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 09/19] fbdev/ps3fb: Use struct fb_info.screen_buffer Date: Fri, 28 Apr 2023 14:24:42 +0200 Message-Id: <20230428122452.4856-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230428122452.4856-1-tzimmermann@suse.de> References: <20230428122452.4856-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann --- drivers/video/fbdev/ps3fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/ps3fb.c b/drivers/video/fbdev/ps3fb.c index 98aaa330a193..d4abcf8aff75 100644 --- a/drivers/video/fbdev/ps3fb.c +++ b/drivers/video/fbdev/ps3fb.c @@ -650,7 +650,7 @@ static int ps3fb_set_par(struct fb_info *info) } /* Clear XDR frame buffer memory */ - memset((void __force *)info->screen_base, 0, info->fix.smem_len); + memset(info->screen_buffer, 0, info->fix.smem_len); /* Clear DDR frame buffer memory */ lines = vmode->yres * par->num_frames; @@ -1140,7 +1140,7 @@ static int ps3fb_probe(struct ps3_system_bus_device *dev) * memory */ fb_start = ps3fb_videomemory.address + GPU_FB_START; - info->screen_base = (char __force __iomem *)fb_start; + info->screen_buffer = fb_start; info->fix.smem_start = __pa(fb_start); info->fix.smem_len = ps3fb_videomemory.size - GPU_FB_START;