Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp299060lqp; Wed, 12 Jun 2024 01:46:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUo0M3ajLiAawU18OkH8dCH1yL0sfHF65W9PKsOSqBeS50pJwjAMLR8YOyWkD69+zxfZlFGgAJEJ9OIDb/Eu6etzmYp6H4pOy5W3tUMZg== X-Google-Smtp-Source: AGHT+IHY2G2grlh9KKHl8wZ+Eoc3x7/zpLVVaNK97G16dgSdh9hQJ6Wz4JmXeipZKaq8ipxfShZf X-Received: by 2002:a17:90a:a88c:b0:2c2:deda:8561 with SMTP id 98e67ed59e1d1-2c4a76f674dmr1053498a91.41.1718181966049; Wed, 12 Jun 2024 01:46:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718181966; cv=pass; d=google.com; s=arc-20160816; b=emQDTuJ+RQC1ik3OP8HB07Ix9PGhcmCZv7ugR4uNcGzRAidm2ESYvEKo7ZBvies5JV bzmvuGb0GTMV0/Fkvqe3Lw5x0Q48Ft2IRMPwa6O7qIA0p0LoBEkLnn/hot961GcDTHBS utGdGS9oxg2WumAjRx8NA/jDrzx4rZfOKK3MO4K6g9XPl2kz/8A8Luf+h/H7sZm0EAhY GmnXICiqPnMxMNtGyZ97hamIcah8fen2mRsUkASx9cFCP9BKUVtQ1I9w/lBR6p52HRTi hm4ll5qFQYUUItLI/0p6pLamVWtDFp9xk13sxsRjhDzZ851ltNCmT7nLG7avGyFwTeS1 1L4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=Mmdle60OyXYzHnY4uAc3ZIp5lh6qnfcxEmNuLz4sZH8=; fh=jKEwOLJL6pTMfT9pVY9YgzAtVD3u/HVKF22J5dHjGqE=; b=Wv4RnMrYILyRghVHSqW05rS3UC7BID9GtI6TkS0J7x3mXPmQuUSjl9/D1G1DKrgVdG NFwBOPi4P4debch2+CwvltsjwVQiqXB7msumrrsJ+GTYAbur3rtfr8pRgyAcr12PEdBA CCO4DKTaVcd2kyIP3GaZ+BYh9+iaG9SyPLFtlzQz40fuZyqKdOVBwqbkM5kjG64obemY dnuIclSJ6j2r+gUlW6NlpEHi6welOAEs1FA4HLw8VIgeX1+pHxHm3S5xFb9fYR6PdWkG 11tvCC++HFlFFP2SCH11MY4Oz0njXQ4bLDRcqUvy7Db65sCiQUdW2pSxN8Lae0KpWWrn h03g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Kp5EAU7x; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-211201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211201-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a773871asi1068475a91.189.2024.06.12.01.46.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:46:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Kp5EAU7x; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-211201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211201-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A4749281810 for ; Wed, 12 Jun 2024 08:46:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BADE16D33B; Wed, 12 Jun 2024 08:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Kp5EAU7x" Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD737757F8 for ; Wed, 12 Jun 2024 08:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718181959; cv=none; b=nISBsZ6tSHVrWepv4wfPOBKaSUpjeGB9wh9JYGj+LuXTk3o9XEc2/uaAOQinS8BIxD6Q4sHpyT6WRCFUAIEWvkW58p+boV6YPv5zC77y9hmDNAtJfYrO5LmAqIAF5tTVFWHljHcsshtlEshi8svLPquUp+3lhMQnxNYDvjZ9VsI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718181959; c=relaxed/simple; bh=+Kc/AhCmJZDN+z1v5B5jpkDqHq+Ce7zdIcHo4V7c5vo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QcXsVhu+IdvRyIwk1OKJB37gkOhUAyomvAw5ZDvJm0Q6nYMhDU8GmrdLrJXNnXmmybg/vqfHGZ0wMtCvNn8IG1G5AVHtxygIB6GdMvg/yJLcnMWyl1KBWjjnuGKpNBLLkC9ia1C8yn01QwfQyCWrGMh+0MxUFG3oul7VL0F+Pn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=Kp5EAU7x; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52bc88fb243so447489e87.3 for ; Wed, 12 Jun 2024 01:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1718181956; x=1718786756; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=Mmdle60OyXYzHnY4uAc3ZIp5lh6qnfcxEmNuLz4sZH8=; b=Kp5EAU7xiwHVfGM4ZYoDdody7GnYJ02CYvguGJ3xAWGF1YGZplT0Ic83N69sL8p8hE CzVa0Hd5f9+924r1hdVWf0v/hG1BW0Q9QYLSD+ffWvtG5vgVmne4INFSyxP4EF8HqbUa EycvSqh/iaYseD0xBQg64GwDc/eFYUzsUpHh8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718181956; x=1718786756; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Mmdle60OyXYzHnY4uAc3ZIp5lh6qnfcxEmNuLz4sZH8=; b=XvSMlERm941Ld0Gq/rykShzTvwRFFmkK6bqrKDG/Orpb4+UqZ/1FYiSGxFTLaNa2AY 3CtueQ/kS6C7hrmLlk4b4eN1YoCIzzVN6pCL+Co8i8Pgra02ra02aDXlDwLJ3lgXdudo MtEW5AEYXutdOPsHzVDPS646apFlxMPvXBeipRxUXEt8SnSV91MkMtoLqJZ3206q+Thr mxfDPwpKCEmlGMyfvLXedBVp6mpOs8AESwS/RsTnlvOR+AvVZ0GGfD5cX7m7daO5vq/i jCUtNfC6uib7ZLAOkRJbdbOHxnIpExO2gFyAVvGFOUXFAlKG7JND/eDcBqWngBW1snDt gj0g== X-Forwarded-Encrypted: i=1; AJvYcCXaAG/qa04ipTlwTZ2j1XX2Qw3oIHXstqDr7P6171Z4S42/ogrc2a3U+OH9IR0hocyOsmAWyPv5oN9aK0+pszGWvUh/aSmvQ/raZEx/ X-Gm-Message-State: AOJu0YzPlekKYkFppyRX89rb80eaaCGvUHOjY67GfJuraD4LuHqJ5ad4 dvx7FHLaez8HJHp5G21PqBf6iKJm8U8ygfe6vacbKxKseAphSUw/ggfudtnoFM4= X-Received: by 2002:a2e:2281:0:b0:2ea:eac6:6872 with SMTP id 38308e7fff4ca-2ebfc815c37mr7977921fa.0.1718181955802; Wed, 12 Jun 2024 01:45:55 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422871f9068sm16507935e9.43.2024.06.12.01.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:45:55 -0700 (PDT) Date: Wed, 12 Jun 2024 10:45:53 +0200 From: Daniel Vetter To: Thomas Zimmermann Cc: Peng Fan , "Peng Fan (OSS)" , Maarten Lankhorst , Maxime Ripard , David Airlie , Daniel Vetter , Javier Martinez Canillas , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] drm/fbdev-dma: fix getting smem_start Message-ID: Mail-Followup-To: Thomas Zimmermann , Peng Fan , "Peng Fan (OSS)" , Maarten Lankhorst , Maxime Ripard , David Airlie , Javier Martinez Canillas , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" References: <20240604080328.4024838-1-peng.fan@oss.nxp.com> <8f4a6d80-dd3e-422f-88af-d26f50c973ff@suse.de> <766908de-922c-4d71-bb04-29dbe4d1d64d@suse.de> <6c01bee4-c3f5-496e-8b4f-a29c97954808@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c01bee4-c3f5-496e-8b4f-a29c97954808@suse.de> X-Operating-System: Linux phenom 6.8.9-amd64 On Tue, Jun 11, 2024 at 11:29:58AM +0200, Thomas Zimmermann wrote: > Hi > > Am 11.06.24 um 10:23 schrieb Peng Fan: > > > Subject: Re: [PATCH] drm/fbdev-dma: fix getting smem_start > > > > > > Hi > > > > > > Am 11.06.24 um 03:00 schrieb Peng Fan: > > > > > Subject: Re: [PATCH] drm/fbdev-dma: fix getting smem_start > > > > > > > > > > Hi > > > > > > > > > > Am 04.06.24 um 10:03 schrieb Peng Fan (OSS): > > > > > > From: Peng Fan > > > > > > > > > > > > If 'info->screen_buffer' locates in vmalloc address space, > > > > > > virt_to_page will not be able to get correct results. With > > > > > > CONFIG_DEBUG_VM and CONFIG_DEBUG_VIRTUAL enabled on ARM64, > > > > > there is dump below: > > > > > > > > > > Which graphics driver triggers this bug? > > > > It is NXP i.MX95 DPU driver which is still in NXP downstream repo. > > > Which DRM memory manager does that driver use? > > DRM_GEM_DMA_DRIVER_OPS > > So fbdev-dma would be correct. But with the gem-dma allocator, wouldn't you > allocate from one of these dma_alloc_() calls at [1] ? How does the drivers > end up with vmalloc'd fbdev memory? Specifically in the light of the docs at > [2]. I think when you have an iommu dma_alloc just allocates pages, and uses the iommu to make it all contiguous for the device, and vmalloc for the kernel. So it's not allocated with vmalloc(), just ends up getting mapped into the vmalloc range. -Sima > > [1] https://elixir.bootlin.com/linux/v6.9/source/drivers/gpu/drm/drm_gem_dma_helper.c#L146 > [2] https://elixir.bootlin.com/linux/v6.9/source/Documentation/core-api/dma-api-howto.rst#L124 > > Best regards > Thomas > > > > > > I'm asking because if the driver allocates BOs via vmalloc(), should it really > > > use fbdev-dma? > > We use it for fbdev emulation. If drm_kms_helper.fbdev_emulation is 0, > > fbdev emulation could be disabled. > > > > Thanks > > Peng > > > Best regards > > > Thomas > > > > > > > Thanks, > > > > Peng. > > > -- > > > -- > > > Thomas Zimmermann > > > Graphics Driver Developer > > > SUSE Software Solutions Germany GmbH > > > Frankenstrasse 146, 90461 Nuernberg, Germany > > > GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB > > > 36809 (AG Nuernberg) > > -- > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Frankenstrasse 146, 90461 Nuernberg, Germany > GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman > HRB 36809 (AG Nuernberg) > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch