Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5620201rwd; Mon, 12 Jun 2023 07:32:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44aE7eVXt+04NqdxNJdhDiXrHrAFTihHh8lO2wYG3feO9xSsZqEJS+sCU3NCamTEbepauH X-Received: by 2002:a17:907:785:b0:968:2bb1:f39d with SMTP id xd5-20020a170907078500b009682bb1f39dmr10350204ejb.36.1686580365443; Mon, 12 Jun 2023 07:32:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686580365; cv=none; d=google.com; s=arc-20160816; b=HCwrUaBsN8oectmvQsoqxz4MzWiu7lBwFXVOpUC6cBMfrgHnJ6w6GNvE4iUaJP0IZW 0GTv9UmiWz0KCE4oWXdXIl5OIJwSUiyQeGwW2pbORBu9G+umUwwrafYMV9PT+BIOpzsM lvVnrzirhHkP9jYM7XEo4sW+LOOG6Eg/S1MDSfySJ1NBs/Ayte4Oo4FwgQOgXoBa3T5B mJY2bJ2BD8e8zE2eWNEpHZjuXw/Ukx4S+nyMlNnTnjG4x5LEfTum4naHIKSDv45ja8Af f5sysgpbvUMiLyPujRA7RDhA1HtmGomfI7DuFH2Jh+/mK69xMPcM4cip67yXCh/nX5mc slzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=wgea4CAx5RQUmrYwJYNcyiyGnDDQ3dqg16YEIp4VW1k=; b=d7rFQu+NiHcw1ptzrK04TTSiymT5fsyh8oWCKcWj7/kEXG7AIiwoLwZPBqcymsiUXm /VrYuTcI/GW0tITJYdhhqQp0WYyb7wZ0mJ5iI6b15aQpyplt88XzppZbpba3vZFYB1mM D0uufXz6FdZq5jLs/R64smkrdVz6Ok/rYiDOkS1brJAEdf+61XjOXJT15iokYTYXi0W4 vVwXT8B8M3DIOdcx339YMZlwUpKIZkZ5c0G8NYRiGPt/d3PCypvZiDBEARWoK0wVdrTn kXestnj3PmF789LwTO5GqaHyiknHZHfwOhPyPTCqkz5EL/G+rXXB2xW8GruCZWmMfucv h/HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=piT0tDi1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="y7enem/a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020a1709064ed400b0096f5b58e7f2si5313123ejv.778.2023.06.12.07.32.20; Mon, 12 Jun 2023 07:32:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=piT0tDi1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="y7enem/a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237801AbjFLOOq (ORCPT + 99 others); Mon, 12 Jun 2023 10:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237341AbjFLOOD (ORCPT ); Mon, 12 Jun 2023 10:14:03 -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 7658F10C4; Mon, 12 Jun 2023 07:14:00 -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 D2F6920487; Mon, 12 Jun 2023 14:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686579238; 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=wgea4CAx5RQUmrYwJYNcyiyGnDDQ3dqg16YEIp4VW1k=; b=piT0tDi1k9GcInx2VZawxHTEUmo2GUSb9G3n/TbHXMhvuQlgrWIbbSpC7QeLwMxNIAN3vk BKMMEeXRYEjhnYn4InzLNw8mNeIFW69LpZJDyVZmXFtHFva0ZIgCP0vBU6pkTiC4UgL7Pb BFmZBmsSL1PCA2RFkGUhpZComRzERy0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686579238; 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=wgea4CAx5RQUmrYwJYNcyiyGnDDQ3dqg16YEIp4VW1k=; b=y7enem/ailjQhCZUOs9GcJ2zdJtJLqZ/6l9bBay5RCU9uOv4oi3yhizKOazmW1ooU9Hale IG3q1iWDXJNUIdAQ== 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 86A4113A67; Mon, 12 Jun 2023 14:13:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iKDkHyYoh2RwGQAAMHmgww (envelope-from ); Mon, 12 Jun 2023 14:13:58 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, javierm@redhat.com, sam@ravnborg.org, deller@gmx.de, geert+renesas@glider.be, lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, dan.carpenter@linaro.org, michael.j.ruhl@intel.com Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sh@vger.kernel.org, linux-omap@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 12/38] fbdev/ep93xx-fb: Alloc DMA memory from hardware device Date: Mon, 12 Jun 2023 16:07:50 +0200 Message-ID: <20230612141352.29939-13-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612141352.29939-1-tzimmermann@suse.de> References: <20230612141352.29939-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pass the hardware device to the DMA helpers dma_alloc_wc(), dma_mmap_wc() and dma_free_coherent(). The fbdev device that is currently being used is a software device and does not provide DMA memory. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/ep93xx-fb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c index 94fe52928be25..376ee59e925c2 100644 --- a/drivers/video/fbdev/ep93xx-fb.c +++ b/drivers/video/fbdev/ep93xx-fb.c @@ -312,7 +312,7 @@ static int ep93xxfb_mmap(struct fb_info *info, struct vm_area_struct *vma) unsigned int offset = vma->vm_pgoff << PAGE_SHIFT; if (offset < info->fix.smem_len) { - return dma_mmap_wc(info->dev, vma, info->screen_base, + return dma_mmap_wc(info->device, vma, info->screen_base, info->fix.smem_start, info->fix.smem_len); } @@ -423,7 +423,7 @@ static int ep93xxfb_alloc_videomem(struct fb_info *info) /* Maximum 16bpp -> used memory is maximum x*y*2 bytes */ fb_size = EP93XXFB_MAX_XRES * EP93XXFB_MAX_YRES * 2; - virt_addr = dma_alloc_wc(info->dev, fb_size, &phys_addr, GFP_KERNEL); + virt_addr = dma_alloc_wc(info->device, fb_size, &phys_addr, GFP_KERNEL); if (!virt_addr) return -ENOMEM; @@ -440,7 +440,7 @@ static int ep93xxfb_alloc_videomem(struct fb_info *info) "has bit 27 set: cannot init framebuffer\n", phys_addr); - dma_free_coherent(info->dev, fb_size, virt_addr, phys_addr); + dma_free_coherent(info->device, fb_size, virt_addr, phys_addr); return -ENOMEM; } @@ -454,7 +454,7 @@ static int ep93xxfb_alloc_videomem(struct fb_info *info) static void ep93xxfb_dealloc_videomem(struct fb_info *info) { if (info->screen_base) - dma_free_coherent(info->dev, info->fix.smem_len, + dma_free_coherent(info->device, info->fix.smem_len, info->screen_base, info->fix.smem_start); } -- 2.41.0