Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp378088rdh; Wed, 7 Feb 2024 07:23:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUpiJz3NIgOUlz0ITPW1J9l+c2xZMVDDV9Ucd9dnaqBHGxn5Fj/SgezVq46HKwfSZGb+zbeg3qfAJ6/8zbOoN85L0oKaCjRHY2YWJYcJQ== X-Google-Smtp-Source: AGHT+IGEttQDq5Ui10bJn0zOp8U6be2YJyA4fFeVGN5bobn2QG4jyFl+wbbTHFl91z4gtRMX0Hx3 X-Received: by 2002:a05:6a00:3023:b0:6e0:2c77:a501 with SMTP id ay35-20020a056a00302300b006e02c77a501mr3698616pfb.20.1707319397306; Wed, 07 Feb 2024 07:23:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707319397; cv=pass; d=google.com; s=arc-20160816; b=ESaGeoULlPQgN46r9hPg8QnjNBPmIksMd9Tx3fiUxDyJHKjOZ9o9cY51lmS3bH0fs6 l7/McCcPlKVgNdAp8tSsHs+CwUJ0SUwpoC0cnYWsUflxWFrktP2CM4SsB42SEuopL7re yGUiVG48DkQ8U8w+XHiEAXvBvfrfewzzlwoaNj+4L9Fr3hDfe1h8GiYnkJuPF0EmYggM ZK+uds/oJb3R6Vv+huM4/772DgznhwmDFzzuzVQtgljkuJOA4Ck7UcehJ3uTZk+yv/15 D75nauUrI10C6bkkJxsZCzBJZU0Z/RJCtjynlT5n9SxvKxZtDTsc9zpSMkK83n/luoZi PWTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:date:dkim-signature:message-id; bh=BcrHDCtY4EmMAqg4uodbZ6nytdDsnnuuhPuoEVB1AqU=; fh=hwp0K92uAPCCGZPYN/q4/Pm3oNyDF5SbHqtbCfuC/8Y=; b=Gssdg20WJKMIoaiIFYeWQHhIYSw59fF5FcaB7/rNzwyW7kCEF5z2crGvwI+Nc+hlTv /jhjJkyd9HXoNtOPE+rmyo81KwU15TjRufFlay2RMKhBnVu44RCRcMsl5qkxpsdja4Ip +wZH0mBhllkWd9ajsRBnhm2APgbJPLjsGCf2FC7+n489xbMm4G/mvLV6rbd9+S31PkB6 N5loHb6AiVt0iJv3OXIkM5zdHg3ZJKY1KY/SsWqosIlkqyXbWtAfVKdmoO0+AOkMDZN7 a4aFuuL+iF5ygsarhGqoI2tBSIg/FIGjFbNbV/N3YtF5jdjj8kc+Lr9U/C9OufiLSO/l 0T7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ne58+47S; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-56709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=2; AJvYcCXmORx8wBrkl6rYWeEwYGJeaZ1lWE4bnR/ylJgPe7cBITwpHL93bNoyv+pzs7/jBe4jwcyisGhy8nsIwHNh7BlrKxBowY1SsxU9677zmw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m25-20020a637d59000000b005d9135f4514si1638767pgn.450.2024.02.07.07.23.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 07:23:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56709-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=@linux.dev header.s=key1 header.b=ne58+47S; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-56709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 CC3C62869C0 for ; Wed, 7 Feb 2024 15:23:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F17547F7E5; Wed, 7 Feb 2024 15:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ne58+47S" Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06CFD7F7D5 for ; Wed, 7 Feb 2024 15:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707319362; cv=none; b=ptnsyMR5JZBw2Wp/VE4EkACh5XWngOYDqCB/xdbTU+tKLSYCIx/wNML/2KuDD2Y4lhm8g7YrG3uSNhGKoZ6W0VePP7x3QjzH153RStZTqIFG+BEDflwqCPk+FJFNGZAx0st9ytqxuNx8rt6oH3RhCfTOibtwxzkygTOPqIURRk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707319362; c=relaxed/simple; bh=2/mtwgRzlJOkc0LXlTrmrg1S+ufrZk1Z+V5fxCx51kA=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=c+wZDVLpslBjJeHP0FcheqX9o3sxEFXEDQSrdRGeFXfi6T0ZxGcEn+qUwBIukj14NJ9HJnKHoQmQ+Ej2/nLzacWpm4j2jFK3x2gB15X9QYdfAVW1bFUQy+8NjTnPT6P11AXMrvligeI9MLqdUPmvZG/GqoVCgpsCepg5+DRQep0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ne58+47S; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707319357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BcrHDCtY4EmMAqg4uodbZ6nytdDsnnuuhPuoEVB1AqU=; b=ne58+47SUtp/Ee1jtsQ5M/swxzbAZXspv1TYStfC4sOqG1J4NK5Q5Rob9sXsHR/3PEOINx OrSyjt3tR6MrYpv8ATy84ExlFHy3/GTcZedjtzQ5oPkmKsLpxtb7ZYyfQA21fJe1xX2Eud fBempHikef5QSeQwAVbXMpqXoPFHvBk= Date: Wed, 7 Feb 2024 23:22:20 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [etnaviv-next v13 7/7] drm/etnaviv: Add support for vivante GPU cores attached via PCI(e) To: Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240206172759.421737-1-sui.jingfeng@linux.dev> <20240206172759.421737-8-sui.jingfeng@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Hi, On 2024/2/7 17:35, Daniel Vetter wrote: > On Wed, Feb 07, 2024 at 01:27:59AM +0800, Sui Jingfeng wrote: >> The component helper functions are the glue, which is used to bind multiple >> GPU cores to a virtual master platform device. Which is fine and works well >> for the SoCs who contains multiple GPU cores. >> >> The problem is that usperspace programs (such as X server and Mesa) will >> search the PCIe device to use if it is exist. In other words, usperspace >> programs open the PCIe device with higher priority. Creating a virtual >> master platform device for PCI(e) GPUs is unnecessary, as the PCI device >> has been created by the time drm/etnaviv is loaded. >> >> we create virtual platform devices as a representation for the vivante GPU >> ip core. As all of subcomponent are attached via the PCIe master device, >> we reflect this hardware layout by binding all of the virtual child to the >> the real master. >> >> Signed-off-by: Sui Jingfeng > Uh so my understanding is that drivers really shouldn't create platform > devices of their own. > Yes, At least for DT-based systems, this driver can be modified to let the core to create the virtual master for us. We don't have to create platform devices by our own(refer to the drm/etnaviv driver). I means that we could put the following example device node into the .dts file. gpu_2d: gpu@A0000 { compatible = "vivante,gc"; reg = <0xA0000 0x4000>; }; gpu_3d: gpu@90000 { compatible = "vivante,gc"; reg = <0x90000 0x4000>; }; gpu@0 { compatible = "etnaviv"; cores = <&gpu_2d &gpu_3d>; dma-coherent; dma-mask = <0xffffffff> virtual_master; }; But now, I'm afraid it's too late. Because the DTS/DTB may already have been burned into board's BIOS for years. I guess, nowadays, modifying(changes) this driver have to take the backward compatibility constraint into consideration. Since we only have one chance to form the spec, that happens when this driver was initially merged. Apparently, we miss it.