Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1046201rwd; Tue, 13 Jun 2023 04:14:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49EndAfG3Mk589hdh+jF8ecOBgTAtGfVGwaunPyW8jYFLxCvesPKvLYrVJYOkz4Y6kWh8v X-Received: by 2002:aa7:c416:0:b0:505:d16:9374 with SMTP id j22-20020aa7c416000000b005050d169374mr9100296edq.9.1686654863512; Tue, 13 Jun 2023 04:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686654863; cv=none; d=google.com; s=arc-20160816; b=AE+mEYHEwTFFcw8fa3v0hAjH6heMLeoTY7EbPraZZt8yoTHAcCYlLFCWGPz4eGl2bQ QNu8D2wYjoTcVgUgl1MDeh1ejhimIQ+7DwWIMPuPYlbhlzeu8ivZF1vSyzx4ECO9ek6c o4PAF1CXXNms3GqDlif6DejMSscXWV8BXfvdIBULOmyFcwAcL5kUS+/1WcNASwLDQ6ib XzggSQk1zA2NXttz0Y4uGUWUlCYUD8RrfHtjovj/ubZAaIIksidp8w1+7PYx1dXdFAkj XuJlEN4/UPp5UUgBdXs2ERDn6Mh8/HnZlXa0H8GUZVXw8YLVoI3SoMWZlGoX2l5QWKes 3BBQ== 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=vPsOMjaD5uleu7jrKBWZZNZzb4UiXrU9dQ+7yy+n1umgIe63czL8G/6OmG8QRQQW6Z U16pfJiNAm+W/DSiUd8mKCQ4KPbdV1Ix7FJArueVc3q2Oij8wmmfpyDIhdsC1cKslb7T HyP9vWjENTZQTPm4v4Ft7jbz7vLl9j7hQ/wl4B+GX+/nGKk+4HJKW+cQ0wHyLf6c9mMU ybb2rYyO10gUANWmGf7exqTXITzW+6uu3TTPIlKD+Zbdp6GGilR0BTBnrMOh8I2Jf83t Dm4kzDqEZ2VokdWtc+90hRM+rXUFOXhEZssxG28Rhg7TlYCIrlVxSWUpVayT1EaYbL97 60sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KpOGwMTR; dkim=neutral (no key) header.i=@suse.de; 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 f26-20020a056402151a00b0051493282fafsi7132080edw.690.2023.06.13.04.13.51; Tue, 13 Jun 2023 04:14:23 -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=KpOGwMTR; dkim=neutral (no key) header.i=@suse.de; 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 S238753AbjFMLLD (ORCPT + 99 others); Tue, 13 Jun 2023 07:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241644AbjFMLKC (ORCPT ); Tue, 13 Jun 2023 07:10:02 -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 C0A94E52; Tue, 13 Jun 2023 04:10:01 -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 4B6681FD9A; Tue, 13 Jun 2023 11:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686654600; 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=KpOGwMTRGofNmhOvJtJWHYoxw7MmbRGeo6FzxVMzqS8Cl/HkPaqlqAIbbj5QVOxQDh/1ef HmTOZZdLLfzm9zdlL6u/vxhlgRbWB0WsEox8pd5anT+ZsyfUUVWGtiHUZ7ZUy3ZgGKZhKE 8wfoh2o8hDRXm8FwGh53HXFXlR5ZspA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686654600; 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=BH3aTWJc5uDayXV3wpXjuSh1Sh5kbMo7UKgjKKzOa4KrYc6ekCR5qDLHKStl5r3NnssLBl 0ZAPAlm7SNuT1iDA== 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 064B813483; Tue, 13 Jun 2023 11:10:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KPbCAIhOiGR8CQAAMHmgww (envelope-from ); Tue, 13 Jun 2023 11:10:00 +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 v3 12/38] fbdev/ep93xx-fb: Alloc DMA memory from hardware device Date: Tue, 13 Jun 2023 13:06:47 +0200 Message-ID: <20230613110953.24176-13-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230613110953.24176-1-tzimmermann@suse.de> References: <20230613110953.24176-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,URIBL_BLOCKED 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